Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Opening and read .dat file double format
Hi everyone I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) Thanks in advance
Re: Opening and read .dat file double format
On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: > Hi everyone > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) What format is the data in? ASCII? Binary? Matlab format? It makes a difference.
On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >> Hi everyone >> >> I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. Thanks Craig My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) im = IMAGE(Result) end But I got an image meaning nothing to me only white and black image Am I doing the right way or there are other ways to see the image Thanks
On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >> On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>> Hi everyone >>> >>> I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >> >> What format is the data in? ASCII? Binary? Matlab format? It makes a difference. > > Thanks Craig > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) > im = IMAGE(Result) > end > > But I got an image meaning nothing to me only white and black image > > Am I doing the right way or there are other ways to see the image > > Thanks Difficult to tell. My suggestion would be to try: template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) mn = min(Result, max=mx) print, mn, mx im = IMAGE(Result) im.min_value = mn im.max_value = mx Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) Cheers, Helder (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution.
On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >> On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>> On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> Hi everyone >>>> >>>> I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>> >>> What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >> >> Thanks Craig >> >> My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >> >> template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >> im = IMAGE(Result) >> end >> >> But I got an image meaning nothing to me only white and black image >> >> Am I doing the right way or there are other ways to see the image >> >> Thanks > > Difficult to tell. > My suggestion would be to try: > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) > mn = min(Result, max=mx) > print, mn, mx > im = IMAGE(Result) > im.min_value = mn > im.max_value = mx > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) > > Cheers, > Helder > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. Hi I got the same thing and the min vale is 0 and the max value is 255 any suggestions ?
On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >> On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>> On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > Hi everyone >>>> > >>>> > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> >>>> What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>> >>> Thanks Craig >>> >>> My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>> >>> template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>> im = IMAGE(Result) >>> end >>> >>> But I got an image meaning nothing to me only white and black image >>> >>> Am I doing the right way or there are other ways to see the image >>> >>> Thanks >> >> Difficult to tell. >> My suggestion would be to try: >> template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >> mn = min(Result, max=mx) >> print, mn, mx >> im = IMAGE(Result) >> im.min_value = mn >> im.max_value = mx >> >> Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >> >> Cheers, >> Helder >> >> (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. > > Hi > > I got the same thing and the min vale is 0 and the max value is 255 > > any suggestions ? I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. Why don't you try: Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) and see what happens. If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: array = make_array(4999, 8038, /double, /nozero) filename = 'C:\....' ;your file name OPENR, importUnit, filename, /GET_LUN READU, importUnit, array CLOSE, importUnit FREE_LUN, importUnit im = IMAGE(array) cheers, Helder
On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >> On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>> On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > Hi everyone >>>> > > >>>> > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > >>>> > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> >>>> Thanks Craig >>>> >>>> My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> >>>> template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> im = IMAGE(Result) >>>> end >>>> >>>> But I got an image meaning nothing to me only white and black image >>>> >>>> Am I doing the right way or there are other ways to see the image >>>> >>>> Thanks >>> >>> Difficult to tell. >>> My suggestion would be to try: >>> template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>> mn = min(Result, max=mx) >>> print, mn, mx >>> im = IMAGE(Result) >>> im.min_value = mn >>> im.max_value = mx >>> >>> Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>> >>> Cheers, >>> Helder >>> >>> (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >> >> Hi >> >> I got the same thing and the min vale is 0 and the max value is 255 >> >> any suggestions ? > > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. > Why don't you try: > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) > > and see what happens. > > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: > > array = make_array(4999, 8038, /double, /nozero) > filename = 'C:\....' ;your file name > OPENR, importUnit, filename, /GET_LUN > READU, importUnit, array > CLOSE, importUnit > FREE_LUN, importUnit > im = IMAGE(array) > > cheers, > Helder Thank you very much it's good know. I tried the OPENR way it's double. On my MATLAB code I seprated real and imaginary such as the following array = array (1:2:end, :) + j * array (2:2:end, :); how can that be done in IDL so I can have imagenary and real values Thanks
On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: > On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >> On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>> On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > Hi everyone >>>> > > > >>>> > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > >>>> > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > >>>> > Thanks Craig >>>> > >>>> > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > >>>> > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > im = IMAGE(Result) >>>> > end >>>> > >>>> > But I got an image meaning nothing to me only white and black image >>>> > >>>> > Am I doing the right way or there are other ways to see the image >>>> > >>>> > Thanks >>>> >>>> Difficult to tell. >>>> My suggestion would be to try: >>>> template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> mn = min(Result, max=mx) >>>> print, mn, mx >>>> im = IMAGE(Result) >>>> im.min_value = mn >>>> im.max_value = mx >>>> >>>> Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> >>>> Cheers, >>>> Helder >>>> >>>> (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>> >>> Hi >>> >>> I got the same thing and the min vale is 0 and the max value is 255 >>> >>> any suggestions ? >> >> I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >> Why don't you try: >> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >> >> and see what happens. >> >> If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >> >> array = make_array(4999, 8038, /double, /nozero) >> filename = 'C:\....' ;your file name >> OPENR, importUnit, filename, /GET_LUN >> READU, importUnit, array >> CLOSE, importUnit >> FREE_LUN, importUnit >> im = IMAGE(array) >> >> cheers, >> Helder > > Thank you very much it's good know. I tried the OPENR way it's double. > > On my MATLAB code I seprated real and imaginary such as the following > > array = array (1:2:end, :) + j * array (2:2:end, :); > > how can that be done in IDL so I can have imagenary and real values > > Thanks I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: array = make_array(4999, 8038, /dcomplex, /nozero) This is also a guess... but I suppose that imaginary data is written this way. Try this and then display the image as: im_r = IMAGE(real_part(array)) im_i = IMAGE(imaginary(array)) and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: http://www.exelisvis.com/docs/ABS.html http://www.exelisvis.com/docs/ATAN.html with the phase keyword. Cheers, Helder
On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: > On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >> On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>> On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > Hi everyone >>>> > > > > >>>> > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > >>>> > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > >>>> > > Thanks Craig >>>> > > >>>> > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > >>>> > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > im = IMAGE(Result) >>>> > > end >>>> > > >>>> > > But I got an image meaning nothing to me only white and black image >>>> > > >>>> > > Am I doing the right way or there are other ways to see the image >>>> > > >>>> > > Thanks >>>> > >>>> > Difficult to tell. >>>> > My suggestion would be to try: >>>> > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > mn = min(Result, max=mx) >>>> > print, mn, mx >>>> > im = IMAGE(Result) >>>> > im.min_value = mn >>>> > im.max_value = mx >>>> > >>>> > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > >>>> > Cheers, >>>> > Helder >>>> > >>>> > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> >>>> Hi >>>> >>>> I got the same thing and the min vale is 0 and the max value is 255 >>>> >>>> any suggestions ? >>> >>> I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>> Why don't you try: >>> Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>> >>> and see what happens. >>> >>> If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>> >>> array = make_array(4999, 8038, /double, /nozero) >>> filename = 'C:\....' ;your file name >>> OPENR, importUnit, filename, /GET_LUN >>> READU, importUnit, array >>> CLOSE, importUnit >>> FREE_LUN, importUnit >>> im = IMAGE(array) >>> >>> cheers, >>> Helder >> >> Thank you very much it's good know. I tried the OPENR way it's double. >> >> On my MATLAB code I seprated real and imaginary such as the following >> >> array = array (1:2:end, :) + j * array (2:2:end, :); >> >> how can that be done in IDL so I can have imagenary and real values >> >> Thanks > > I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: > array = make_array(4999, 8038, /dcomplex, /nozero) > This is also a guess... but I suppose that imaginary data is written this way. > Try this and then display the image as: > > im_r = IMAGE(real_part(array)) > im_i = IMAGE(imaginary(array)) > > and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: > http://www.exelisvis.com/docs/ABS.html > http://www.exelisvis.com/docs/ATAN.html with the phase keyword. > > Cheers, > Helder Thanks Helder for the help I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : % IMAGE: Unable to allocate memory: to make array. if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working Thanks
On Wednesday, December 23, 2015 at 3:33:21 AM UTC-8, Helder wrote: > On Wednesday, December 23, 2015 at 8:49:31 AM UTC, algha...@gmail.com wrote: >> On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: >>> On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >>>> On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>>> > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> > > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > > > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > > > Hi everyone >>>> > > > > > > >>>> > > > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > > > >>>> > > > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > > > >>>> > > > > Thanks Craig >>>> > > > > >>>> > > > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > > > >>>> > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > im = IMAGE(Result) >>>> > > > > end >>>> > > > > >>>> > > > > But I got an image meaning nothing to me only white and black image >>>> > > > > >>>> > > > > Am I doing the right way or there are other ways to see the image >>>> > > > > >>>> > > > > Thanks >>>> > > > >>>> > > > Difficult to tell. >>>> > > > My suggestion would be to try: >>>> > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > mn = min(Result, max=mx) >>>> > > > print, mn, mx >>>> > > > im = IMAGE(Result) >>>> > > > im.min_value = mn >>>> > > > im.max_value = mx >>>> > > > >>>> > > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > > > >>>> > > > Cheers, >>>> > > > Helder >>>> > > > >>>> > > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> > > >>>> > > Hi >>>> > > >>>> > > I got the same thing and the min vale is 0 and the max value is 255 >>>> > > >>>> > > any suggestions ? >>>> > >>>> > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>>> > Why don't you try: >>>> > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>>> > >>>> > and see what happens. >>>> > >>>> > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>>> > >>>> > array = make_array(4999, 8038, /double, /nozero) >>>> > filename = 'C:\....' ;your file name >>>> > OPENR, importUnit, filename, /GET_LUN >>>> > READU, importUnit, array >>>> > CLOSE, importUnit >>>> > FREE_LUN, importUnit >>>> > im = IMAGE(array) >>>> > >>>> > cheers, >>>> > Helder >>>> >>>> Thank you very much it's good know. I tried the OPENR way it's double. >>>> >>>> On my MATLAB code I seprated real and imaginary such as the following >>>> >>>> array = array (1:2:end, :) + j * array (2:2:end, :); >>>> >>>> how can that be done in IDL so I can have imagenary and real values >>>> >>>> Thanks >>> >>> I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: >>> array = make_array(4999, 8038, /dcomplex, /nozero) >>> This is also a guess... but I suppose that imaginary data is written this way. >>> Try this and then display the image as: >>> >>> im_r = IMAGE(real_part(array)) >>> im_i = IMAGE(imaginary(array)) >>> >>> and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: >>> http://www.exelisvis.com/docs/ABS.html >>> http://www.exelisvis.com/docs/ATAN.html with the phase keyword. >>> >>> Cheers, >>> Helder >> >> Thanks Helder for the help >> >> I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : >> >> % IMAGE: Unable to allocate memory: to make array. >> >> if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working >> >> Thanks > > Hi, > I think that the command: > print,ABS(image(array)) > makes no sense. > > What happens if you try this: > im_r = real_part(array) > im_i = imaginary(array) > > Everything ok? (it should not give an error unless you run out of memory) > If that is ok, then you can try to reduce the size of the images. Given that you have an odd number of rows (8039), you're going to have to use congrid to reduce the size of the image: > smaller_im_r = congrid(im_r,5000/10.0,8039/10.0) > smaller_im_i = congrid(im_i,5000/10.0,8039/10.0) > then > oIm_r = image(smaller_im_r) > oIm_i = image(smaller_im_i) > > If you do get an error, you have to tell me *which* line generated the error. > > Cheers, > Helder Thanks Helder for the help I finally got the image as follows array_VV = make_array(5000, 5359, /dcomplex, /nozero) filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') OPENR, importUnit, filename_VV, /GET_LUN READU, importUnit, array_VV A_VV = ABS(array_VV) B_VV = A_VV^(0.7/2) images_VV = image(B_VV, TITLE='Intensity VV') CLOSE, importUnit FREE_LUN, importUnit end Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter The secound is I want to open other .dat file dcomplex in the same page with the same number of array so I can compare them. Can I just copy the previouse thinf and pate it and change the file path ? is that right as follow array_HH = make_array(5000, 5359, /dcomplex, /nozero) filename_HH = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') OPENR, importUnit, filename_HH, /GET_LUN READU, importUnit, array_HH A = ABS(array_HH) B = A^(0.7/2) image_HH = image(B, TITLE='Intensity HH') CLOSE, importUnit FREE_LUN, importUnit array_VV = make_array(5000, 5359, /dcomplex, /nozero) filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') OPENR, importUnit, filename_VV, /GET_LUN READU, importUnit, array_VV A_VV = ABS(array_VV) B_VV = A_VV^(0.7/2) images_VV = image(B_VV, TITLE='Intensity VV') CLOSE, importUnit FREE_LUN, importUnit end Thanks you
On Friday, December 25, 2015 at 1:05:20 PM UTC, algha...@gmail.com wrote: > On Wednesday, December 23, 2015 at 3:33:21 AM UTC-8, Helder wrote: >> On Wednesday, December 23, 2015 at 8:49:31 AM UTC, algha...@gmail.com wrote: >>> On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: >>>> On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >>>> > On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>>> > > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> > > > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > > > > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > > > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > > > > Hi everyone >>>> > > > > > > > >>>> > > > > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > > > > >>>> > > > > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > > > > >>>> > > > > > Thanks Craig >>>> > > > > > >>>> > > > > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > > > > >>>> > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > im = IMAGE(Result) >>>> > > > > > end >>>> > > > > > >>>> > > > > > But I got an image meaning nothing to me only white and black image >>>> > > > > > >>>> > > > > > Am I doing the right way or there are other ways to see the image >>>> > > > > > >>>> > > > > > Thanks >>>> > > > > >>>> > > > > Difficult to tell. >>>> > > > > My suggestion would be to try: >>>> > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > mn = min(Result, max=mx) >>>> > > > > print, mn, mx >>>> > > > > im = IMAGE(Result) >>>> > > > > im.min_value = mn >>>> > > > > im.max_value = mx >>>> > > > > >>>> > > > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > > > > >>>> > > > > Cheers, >>>> > > > > Helder >>>> > > > > >>>> > > > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> > > > >>>> > > > Hi >>>> > > > >>>> > > > I got the same thing and the min vale is 0 and the max value is 255 >>>> > > > >>>> > > > any suggestions ? >>>> > > >>>> > > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>>> > > Why don't you try: >>>> > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>>> > > >>>> > > and see what happens. >>>> > > >>>> > > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>>> > > >>>> > > array = make_array(4999, 8038, /double, /nozero) >>>> > > filename = 'C:\....' ;your file name >>>> > > OPENR, importUnit, filename, /GET_LUN >>>> > > READU, importUnit, array >>>> > > CLOSE, importUnit >>>> > > FREE_LUN, importUnit >>>> > > im = IMAGE(array) >>>> > > >>>> > > cheers, >>>> > > Helder >>>> > >>>> > Thank you very much it's good know. I tried the OPENR way it's double. >>>> > >>>> > On my MATLAB code I seprated real and imaginary such as the following >>>> > >>>> > array = array (1:2:end, :) + j * array (2:2:end, :); >>>> > >>>> > how can that be done in IDL so I can have imagenary and real values >>>> > >>>> > Thanks >>>> >>>> I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: >>>> array = make_array(4999, 8038, /dcomplex, /nozero) >>>> This is also a guess... but I suppose that imaginary data is written this way. >>>> Try this and then display the image as: >>>> >>>> im_r = IMAGE(real_part(array)) >>>> im_i = IMAGE(imaginary(array)) >>>> >>>> and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: >>>> http://www.exelisvis.com/docs/ABS.html >>>> http://www.exelisvis.com/docs/ATAN.html with the phase keyword. >>>> >>>> Cheers, >>>> Helder >>> >>> Thanks Helder for the help >>> >>> I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : >>> >>> % IMAGE: Unable to allocate memory: to make array. >>> >>> if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working >>> >>> Thanks >> >> Hi, >> I think that the command: >> print,ABS(image(array)) >> makes no sense. >> >> What happens if you try this: >> im_r = real_part(array) >> im_i = imaginary(array) >> >> Everything ok? (it should not give an error unless you run out of memory) >> If that is ok, then you can try to reduce the size of the images. Given that you have an odd number of rows (8039), you're going to have to use congrid to reduce the size of the image: >> smaller_im_r = congrid(im_r,5000/10.0,8039/10.0) >> smaller_im_i = congrid(im_i,5000/10.0,8039/10.0) >> then >> oIm_r = image(smaller_im_r) >> oIm_i = image(smaller_im_i) >> >> If you do get an error, you have to tell me *which* line generated the error. >> >> Cheers, >> Helder > > Thanks Helder for the help I finally got the image as follows > > array_VV = make_array(5000, 5359, /dcomplex, /nozero) > filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') > OPENR, importUnit, filename_VV, /GET_LUN > READU, importUnit, array_VV > A_VV = ABS(array_VV) > B_VV = A_VV^(0.7/2) > images_VV = image(B_VV, TITLE='Intensity VV') > CLOSE, importUnit > FREE_LUN, importUnit > end > > Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter > > The secound is I want to open other .dat file dcomplex in the same page with the same number of array so I can compare them. Can I just copy the previouse thinf and pate it and change the file path ? is that right as follow > > array_HH = make_array(5000, 5359, /dcomplex, /nozero) > filename_HH = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') > OPENR, importUnit, filename_HH, /GET_LUN > READU, importUnit, array_HH > A = ABS(array_HH) > B = A^(0.7/2) > image_HH = image(B, TITLE='Intensity HH') > CLOSE, importUnit > FREE_LUN, importUnit > array_VV = make_array(5000, 5359, /dcomplex, /nozero) > filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') > OPENR, importUnit, filename_VV, /GET_LUN > READU, importUnit, array_VV > A_VV = ABS(array_VV) > B_VV = A_VV^(0.7/2) > images_VV = image(B_VV, TITLE='Intensity VV') > CLOSE, importUnit > FREE_LUN, importUnit > end > > > Thanks you A couple of comments: 1) after opening and reading the file, you can close it right away: > OPENR, importUnit, filename_VV, /GET_LUN > READU, importUnit, array_VV > CLOSE, importUnit > FREE_LUN, importUnit > A_VV = ABS(array_VV) > B_VV = A_VV^(0.7/2) > images_VV = image(B_VV, TITLE='Intensity VV') 2) regarding your question: > Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter remember my answer: im.min_value = mn im.max_value = mx check what im.max_value is and try to make it lower. This defines the white level. 3) same page? Try to adapt this code: ww = window(dimensions=[1200,600]) im1 = image(/test, margin=0, layout=[2,1,1], current=ww) im2 = image(/test, margin=0, layout=[2,1,2], current=ww) Check http://www.exelisvis.com/docs/IMAGE.html for details. Keep in mind that every image is about 400 Mb. Are you using 64-bit version of IDL (type print, !version to find out) Cheers, Helder
On Friday, December 25, 2015 at 2:11:02 PM UTC-8, Helder wrote: > On Friday, December 25, 2015 at 1:05:20 PM UTC, algha...@gmail.com wrote: >> On Wednesday, December 23, 2015 at 3:33:21 AM UTC-8, Helder wrote: >>> On Wednesday, December 23, 2015 at 8:49:31 AM UTC, algha...@gmail.com wrote: >>>> On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: >>>> > On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >>>> > > On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>>> > > > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> > > > > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > > > > > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > > > > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > > > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > > > > > Hi everyone >>>> > > > > > > > > >>>> > > > > > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > > > > > >>>> > > > > > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > > > > > >>>> > > > > > > Thanks Craig >>>> > > > > > > >>>> > > > > > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > > > > > >>>> > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > im = IMAGE(Result) >>>> > > > > > > end >>>> > > > > > > >>>> > > > > > > But I got an image meaning nothing to me only white and black image >>>> > > > > > > >>>> > > > > > > Am I doing the right way or there are other ways to see the image >>>> > > > > > > >>>> > > > > > > Thanks >>>> > > > > > >>>> > > > > > Difficult to tell. >>>> > > > > > My suggestion would be to try: >>>> > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > mn = min(Result, max=mx) >>>> > > > > > print, mn, mx >>>> > > > > > im = IMAGE(Result) >>>> > > > > > im.min_value = mn >>>> > > > > > im.max_value = mx >>>> > > > > > >>>> > > > > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > > > > > >>>> > > > > > Cheers, >>>> > > > > > Helder >>>> > > > > > >>>> > > > > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> > > > > >>>> > > > > Hi >>>> > > > > >>>> > > > > I got the same thing and the min vale is 0 and the max value is 255 >>>> > > > > >>>> > > > > any suggestions ? >>>> > > > >>>> > > > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>>> > > > Why don't you try: >>>> > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>>> > > > >>>> > > > and see what happens. >>>> > > > >>>> > > > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>>> > > > >>>> > > > array = make_array(4999, 8038, /double, /nozero) >>>> > > > filename = 'C:\....' ;your file name >>>> > > > OPENR, importUnit, filename, /GET_LUN >>>> > > > READU, importUnit, array >>>> > > > CLOSE, importUnit >>>> > > > FREE_LUN, importUnit >>>> > > > im = IMAGE(array) >>>> > > > >>>> > > > cheers, >>>> > > > Helder >>>> > > >>>> > > Thank you very much it's good know. I tried the OPENR way it's double. >>>> > > >>>> > > On my MATLAB code I seprated real and imaginary such as the following >>>> > > >>>> > > array = array (1:2:end, :) + j * array (2:2:end, :); >>>> > > >>>> > > how can that be done in IDL so I can have imagenary and real values >>>> > > >>>> > > Thanks >>>> > >>>> > I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: >>>> > array = make_array(4999, 8038, /dcomplex, /nozero) >>>> > This is also a guess... but I suppose that imaginary data is written this way. >>>> > Try this and then display the image as: >>>> > >>>> > im_r = IMAGE(real_part(array)) >>>> > im_i = IMAGE(imaginary(array)) >>>> > >>>> > and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: >>>> > http://www.exelisvis.com/docs/ABS.html >>>> > http://www.exelisvis.com/docs/ATAN.html with the phase keyword. >>>> > >>>> > Cheers, >>>> > Helder >>>> >>>> Thanks Helder for the help >>>> >>>> I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : >>>> >>>> % IMAGE: Unable to allocate memory: to make array. >>>> >>>> if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working >>>> >>>> Thanks >>> >>> Hi, >>> I think that the command: >>> print,ABS(image(array)) >>> makes no sense. >>> >>> What happens if you try this: >>> im_r = real_part(array) >>> im_i = imaginary(array) >>> >>> Everything ok? (it should not give an error unless you run out of memory) >>> If that is ok, then you can try to reduce the size of the images. Given that you have an odd number of rows (8039), you're going to have to use congrid to reduce the size of the image: >>> smaller_im_r = congrid(im_r,5000/10.0,8039/10.0) >>> smaller_im_i = congrid(im_i,5000/10.0,8039/10.0) >>> then >>> oIm_r = image(smaller_im_r) >>> oIm_i = image(smaller_im_i) >>> >>> If you do get an error, you have to tell me *which* line generated the error. >>> >>> Cheers, >>> Helder >> >> Thanks Helder for the help I finally got the image as follows >> >> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename_VV, /GET_LUN >> READU, importUnit, array_VV >> A_VV = ABS(array_VV) >> B_VV = A_VV^(0.7/2) >> images_VV = image(B_VV, TITLE='Intensity VV') >> CLOSE, importUnit >> FREE_LUN, importUnit >> end >> >> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >> >> The secound is I want to open other .dat file dcomplex in the same page with the same number of array so I can compare them. Can I just copy the previouse thinf and pate it and change the file path ? is that right as follow >> >> array_HH = make_array(5000, 5359, /dcomplex, /nozero) >> filename_HH = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename_HH, /GET_LUN >> READU, importUnit, array_HH >> A = ABS(array_HH) >> B = A^(0.7/2) >> image_HH = image(B, TITLE='Intensity HH') >> CLOSE, importUnit >> FREE_LUN, importUnit >> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename_VV, /GET_LUN >> READU, importUnit, array_VV >> A_VV = ABS(array_VV) >> B_VV = A_VV^(0.7/2) >> images_VV = image(B_VV, TITLE='Intensity VV') >> CLOSE, importUnit >> FREE_LUN, importUnit >> end >> >> >> Thanks you > > A couple of comments: > 1) after opening and reading the file, you can close it right away: > >> OPENR, importUnit, filename_VV, /GET_LUN >> READU, importUnit, array_VV >> CLOSE, importUnit >> FREE_LUN, importUnit >> A_VV = ABS(array_VV) >> B_VV = A_VV^(0.7/2) >> images_VV = image(B_VV, TITLE='Intensity VV') > > 2) regarding your question: >> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter > > remember my answer: > im.min_value = mn > im.max_value = mx > > check what im.max_value is and try to make it lower. This defines the white level. > > 3) same page? Try to adapt this code: > > ww = window(dimensions=[1200,600]) > im1 = image(/test, margin=0, layout=[2,1,1], current=ww) > im2 = image(/test, margin=0, layout=[2,1,2], current=ww) > > Check http://www.exelisvis.com/docs/IMAGE.html for details. > > Keep in mind that every image is about 400 Mb. Are you using 64-bit version of IDL (type print, !version to find out) > > Cheers, > Helder Thanks Helder What I mean in 3 is to open and read more than one file (complex- double ) and all the files have the same number of colomus and raws (5000,5359). So do I tried to do the previous step of opening a file twice but did not work The first file is: array_HH = make_array(5000, 5359, /dcomplex, /nozero) filename = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') OPENR, importUnit, filename, /GET_LUN READU, importUnit, array_HH CLOSE, importUnit FREE_LUN, importUnit array_VV = make_array(5000, 5359, /dcomplex, /nozero) filename_VV =('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\2015102111 5853_22_SAR_CPLX_0_pres_8.dat') OPENR, importUnit, filename_VV, /GET_LUN READU, importUnit, array_VV CLOSE, importUnit FREE_LUN, importUnit end This is what I need so I can compare things from file array_HH to array_VV Thanks
On Saturday, December 26, 2015 at 9:12:21 AM UTC, algha...@gmail.com wrote: > On Friday, December 25, 2015 at 2:11:02 PM UTC-8, Helder wrote: >> On Friday, December 25, 2015 at 1:05:20 PM UTC, algha...@gmail.com wrote: >>> On Wednesday, December 23, 2015 at 3:33:21 AM UTC-8, Helder wrote: >>>> On Wednesday, December 23, 2015 at 8:49:31 AM UTC, algha...@gmail.com wrote: >>>> > On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: >>>> > > On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >>>> > > > On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>>> > > > > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> > > > > > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > > > > > > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > > > > > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > > > > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > > > > > > Hi everyone >>>> > > > > > > > > > >>>> > > > > > > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > > > > > > >>>> > > > > > > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > > > > > > >>>> > > > > > > > Thanks Craig >>>> > > > > > > > >>>> > > > > > > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > > > > > > >>>> > > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > > im = IMAGE(Result) >>>> > > > > > > > end >>>> > > > > > > > >>>> > > > > > > > But I got an image meaning nothing to me only white and black image >>>> > > > > > > > >>>> > > > > > > > Am I doing the right way or there are other ways to see the image >>>> > > > > > > > >>>> > > > > > > > Thanks >>>> > > > > > > >>>> > > > > > > Difficult to tell. >>>> > > > > > > My suggestion would be to try: >>>> > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > mn = min(Result, max=mx) >>>> > > > > > > print, mn, mx >>>> > > > > > > im = IMAGE(Result) >>>> > > > > > > im.min_value = mn >>>> > > > > > > im.max_value = mx >>>> > > > > > > >>>> > > > > > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > > > > > > >>>> > > > > > > Cheers, >>>> > > > > > > Helder >>>> > > > > > > >>>> > > > > > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> > > > > > >>>> > > > > > Hi >>>> > > > > > >>>> > > > > > I got the same thing and the min vale is 0 and the max value is 255 >>>> > > > > > >>>> > > > > > any suggestions ? >>>> > > > > >>>> > > > > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>>> > > > > Why don't you try: >>>> > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>>> > > > > >>>> > > > > and see what happens. >>>> > > > > >>>> > > > > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>>> > > > > >>>> > > > > array = make_array(4999, 8038, /double, /nozero) >>>> > > > > filename = 'C:\....' ;your file name >>>> > > > > OPENR, importUnit, filename, /GET_LUN >>>> > > > > READU, importUnit, array >>>> > > > > CLOSE, importUnit >>>> > > > > FREE_LUN, importUnit >>>> > > > > im = IMAGE(array) >>>> > > > > >>>> > > > > cheers, >>>> > > > > Helder >>>> > > > >>>> > > > Thank you very much it's good know. I tried the OPENR way it's double. >>>> > > > >>>> > > > On my MATLAB code I seprated real and imaginary such as the following >>>> > > > >>>> > > > array = array (1:2:end, :) + j * array (2:2:end, :); >>>> > > > >>>> > > > how can that be done in IDL so I can have imagenary and real values >>>> > > > >>>> > > > Thanks >>>> > > >>>> > > I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: >>>> > > array = make_array(4999, 8038, /dcomplex, /nozero) >>>> > > This is also a guess... but I suppose that imaginary data is written this way. >>>> > > Try this and then display the image as: >>>> > > >>>> > > im_r = IMAGE(real_part(array)) >>>> > > im_i = IMAGE(imaginary(array)) >>>> > > >>>> > > and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: >>>> > > http://www.exelisvis.com/docs/ABS.html >>>> > > http://www.exelisvis.com/docs/ATAN.html with the phase keyword. >>>> > > >>>> > > Cheers, >>>> > > Helder >>>> > >>>> > Thanks Helder for the help >>>> > >>>> > I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : >>>> > >>>> > % IMAGE: Unable to allocate memory: to make array. >>>> > >>>> > if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working >>>> > >>>> > Thanks >>>> >>>> Hi, >>>> I think that the command: >>>> print,ABS(image(array)) >>>> makes no sense. >>>> >>>> What happens if you try this: >>>> im_r = real_part(array) >>>> im_i = imaginary(array) >>>> >>>> Everything ok? (it should not give an error unless you run out of memory) >>>> If that is ok, then you can try to reduce the size of the images. Given that you have an odd number of rows (8039), you're going to have to use congrid to reduce the size of the image: >>>> smaller_im_r = congrid(im_r,5000/10.0,8039/10.0) >>>> smaller_im_i = congrid(im_i,5000/10.0,8039/10.0) >>>> then >>>> oIm_r = image(smaller_im_r) >>>> oIm_i = image(smaller_im_i) >>>> >>>> If you do get an error, you have to tell me *which* line generated the error. >>>> >>>> Cheers, >>>> Helder >>> >>> Thanks Helder for the help I finally got the image as follows >>> >>> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >>> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >>> OPENR, importUnit, filename_VV, /GET_LUN >>> READU, importUnit, array_VV >>> A_VV = ABS(array_VV) >>> B_VV = A_VV^(0.7/2) >>> images_VV = image(B_VV, TITLE='Intensity VV') >>> CLOSE, importUnit >>> FREE_LUN, importUnit >>> end >>> >>> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >>> >>> The secound is I want to open other .dat file dcomplex in the same page with the same number of array so I can compare them. Can I just copy the previouse thinf and pate it and change the file path ? is that right as follow >>> >>> array_HH = make_array(5000, 5359, /dcomplex, /nozero) >>> filename_HH = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') >>> OPENR, importUnit, filename_HH, /GET_LUN >>> READU, importUnit, array_HH >>> A = ABS(array_HH) >>> B = A^(0.7/2) >>> image_HH = image(B, TITLE='Intensity HH') >>> CLOSE, importUnit >>> FREE_LUN, importUnit >>> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >>> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >>> OPENR, importUnit, filename_VV, /GET_LUN >>> READU, importUnit, array_VV >>> A_VV = ABS(array_VV) >>> B_VV = A_VV^(0.7/2) >>> images_VV = image(B_VV, TITLE='Intensity VV') >>> CLOSE, importUnit >>> FREE_LUN, importUnit >>> end >>> >>> >>> Thanks you >> >> A couple of comments: >> 1) after opening and reading the file, you can close it right away: >> >>> OPENR, importUnit, filename_VV, /GET_LUN >>> READU, importUnit, array_VV >>> CLOSE, importUnit >>> FREE_LUN, importUnit >>> A_VV = ABS(array_VV) >>> B_VV = A_VV^(0.7/2) >>> images_VV = image(B_VV, TITLE='Intensity VV') >> >> 2) regarding your question: >>> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >> >> remember my answer: >> im.min_value = mn >> im.max_value = mx >> >> check what im.max_value is and try to make it lower. This defines the white level. >> >> 3) same page? Try to adapt this code: >> >> ww = window(dimensions=[1200,600]) >> im1 = image(/test, margin=0, layout=[2,1,1], current=ww) >> im2 = image(/test, margin=0, layout=[2,1,2], current=ww) >> >> Check http://www.exelisvis.com/docs/IMAGE.html for details. >> >> Keep in mind that every image is about 400 Mb. Are you using 64-bit version of IDL (type print, !version to find out) >> >> Cheers, >> Helder > > Thanks Helder > > What I mean in 3 is to open and read more than one file (complex- double ) and all the files have the same number of colomus and raws (5000,5359). So do I tried to do the previous step of opening a file twice but did not work > The first file is: > array_HH = make_array(5000, 5359, /dcomplex, /nozero) > filename = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') > OPENR, importUnit, filename, /GET_LUN > READU, importUnit, array_HH > CLOSE, importUnit > FREE_LUN, importUnit > > array_VV = make_array(5000, 5359, /dcomplex, /nozero) > filename_VV =('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\2015102111 5853_22_SAR_CPLX_0_pres_8.dat') > OPENR, importUnit, filename_VV, /GET_LUN > READU, importUnit, array_VV > CLOSE, importUnit > FREE_LUN, importUnit > end > > This is what I need so I can compare things from file array_HH to array_VV > > Thanks why wouldn't that work? what is the error message? Which line throws the error? You've gotta tell a bit more if you want some response... h
On Saturday, December 26, 2015 at 3:14:12 AM UTC-8, Helder wrote: > On Saturday, December 26, 2015 at 9:12:21 AM UTC, algha...@gmail.com wrote: >> On Friday, December 25, 2015 at 2:11:02 PM UTC-8, Helder wrote: >>> On Friday, December 25, 2015 at 1:05:20 PM UTC, algha...@gmail.com wrote: >>>> On Wednesday, December 23, 2015 at 3:33:21 AM UTC-8, Helder wrote: >>>> > On Wednesday, December 23, 2015 at 8:49:31 AM UTC, algha...@gmail.com wrote: >>>> > > On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: >>>> > > > On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >>>> > > > > On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>>> > > > > > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> > > > > > > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > > > > > > > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > > > > > > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > > > > > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > > > > > > > Hi everyone >>>> > > > > > > > > > > >>>> > > > > > > > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > > > > > > > >>>> > > > > > > > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > > > > > > > >>>> > > > > > > > > Thanks Craig >>>> > > > > > > > > >>>> > > > > > > > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > > > > > > > >>>> > > > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > > > im = IMAGE(Result) >>>> > > > > > > > > end >>>> > > > > > > > > >>>> > > > > > > > > But I got an image meaning nothing to me only white and black image >>>> > > > > > > > > >>>> > > > > > > > > Am I doing the right way or there are other ways to see the image >>>> > > > > > > > > >>>> > > > > > > > > Thanks >>>> > > > > > > > >>>> > > > > > > > Difficult to tell. >>>> > > > > > > > My suggestion would be to try: >>>> > > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > > mn = min(Result, max=mx) >>>> > > > > > > > print, mn, mx >>>> > > > > > > > im = IMAGE(Result) >>>> > > > > > > > im.min_value = mn >>>> > > > > > > > im.max_value = mx >>>> > > > > > > > >>>> > > > > > > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > > > > > > > >>>> > > > > > > > Cheers, >>>> > > > > > > > Helder >>>> > > > > > > > >>>> > > > > > > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> > > > > > > >>>> > > > > > > Hi >>>> > > > > > > >>>> > > > > > > I got the same thing and the min vale is 0 and the max value is 255 >>>> > > > > > > >>>> > > > > > > any suggestions ? >>>> > > > > > >>>> > > > > > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>>> > > > > > Why don't you try: >>>> > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>>> > > > > > >>>> > > > > > and see what happens. >>>> > > > > > >>>> > > > > > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>>> > > > > > >>>> > > > > > array = make_array(4999, 8038, /double, /nozero) >>>> > > > > > filename = 'C:\....' ;your file name >>>> > > > > > OPENR, importUnit, filename, /GET_LUN >>>> > > > > > READU, importUnit, array >>>> > > > > > CLOSE, importUnit >>>> > > > > > FREE_LUN, importUnit >>>> > > > > > im = IMAGE(array) >>>> > > > > > >>>> > > > > > cheers, >>>> > > > > > Helder >>>> > > > > >>>> > > > > Thank you very much it's good know. I tried the OPENR way it's double. >>>> > > > > >>>> > > > > On my MATLAB code I seprated real and imaginary such as the following >>>> > > > > >>>> > > > > array = array (1:2:end, :) + j * array (2:2:end, :); >>>> > > > > >>>> > > > > how can that be done in IDL so I can have imagenary and real values >>>> > > > > >>>> > > > > Thanks >>>> > > > >>>> > > > I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: >>>> > > > array = make_array(4999, 8038, /dcomplex, /nozero) >>>> > > > This is also a guess... but I suppose that imaginary data is written this way. >>>> > > > Try this and then display the image as: >>>> > > > >>>> > > > im_r = IMAGE(real_part(array)) >>>> > > > im_i = IMAGE(imaginary(array)) >>>> > > > >>>> > > > and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: >>>> > > > http://www.exelisvis.com/docs/ABS.html >>>> > > > http://www.exelisvis.com/docs/ATAN.html with the phase keyword. >>>> > > > >>>> > > > Cheers, >>>> > > > Helder >>>> > > >>>> > > Thanks Helder for the help >>>> > > >>>> > > I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : >>>> > > >>>> > > % IMAGE: Unable to allocate memory: to make array. >>>> > > >>>> > > if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working >>>> > > >>>> > > Thanks >>>> > >>>> > Hi, >>>> > I think that the command: >>>> > print,ABS(image(array)) >>>> > makes no sense. >>>> > >>>> > What happens if you try this: >>>> > im_r = real_part(array) >>>> > im_i = imaginary(array) >>>> > >>>> > Everything ok? (it should not give an error unless you run out of memory) >>>> > If that is ok, then you can try to reduce the size of the images. Given that you have an odd number of rows (8039), you're going to have to use congrid to reduce the size of the image: >>>> > smaller_im_r = congrid(im_r,5000/10.0,8039/10.0) >>>> > smaller_im_i = congrid(im_i,5000/10.0,8039/10.0) >>>> > then >>>> > oIm_r = image(smaller_im_r) >>>> > oIm_i = image(smaller_im_i) >>>> > >>>> > If you do get an error, you have to tell me *which* line generated the error. >>>> > >>>> > Cheers, >>>> > Helder >>>> >>>> Thanks Helder for the help I finally got the image as follows >>>> >>>> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >>>> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >>>> OPENR, importUnit, filename_VV, /GET_LUN >>>> READU, importUnit, array_VV >>>> A_VV = ABS(array_VV) >>>> B_VV = A_VV^(0.7/2) >>>> images_VV = image(B_VV, TITLE='Intensity VV') >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> end >>>> >>>> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >>>> >>>> The secound is I want to open other .dat file dcomplex in the same page with the same number of array so I can compare them. Can I just copy the previouse thinf and pate it and change the file path ? is that right as follow >>>> >>>> array_HH = make_array(5000, 5359, /dcomplex, /nozero) >>>> filename_HH = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') >>>> OPENR, importUnit, filename_HH, /GET_LUN >>>> READU, importUnit, array_HH >>>> A = ABS(array_HH) >>>> B = A^(0.7/2) >>>> image_HH = image(B, TITLE='Intensity HH') >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >>>> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >>>> OPENR, importUnit, filename_VV, /GET_LUN >>>> READU, importUnit, array_VV >>>> A_VV = ABS(array_VV) >>>> B_VV = A_VV^(0.7/2) >>>> images_VV = image(B_VV, TITLE='Intensity VV') >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> end >>>> >>>> >>>> Thanks you >>> >>> A couple of comments: >>> 1) after opening and reading the file, you can close it right away: >>> >>>> OPENR, importUnit, filename_VV, /GET_LUN >>>> READU, importUnit, array_VV >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> A_VV = ABS(array_VV) >>>> B_VV = A_VV^(0.7/2) >>>> images_VV = image(B_VV, TITLE='Intensity VV') >>> >>> 2) regarding your question: >>>> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >>> >>> remember my answer: >>> im.min_value = mn >>> im.max_value = mx >>> >>> check what im.max_value is and try to make it lower. This defines the white level. >>> >>> 3) same page? Try to adapt this code: >>> >>> ww = window(dimensions=[1200,600]) >>> im1 = image(/test, margin=0, layout=[2,1,1], current=ww) >>> im2 = image(/test, margin=0, layout=[2,1,2], current=ww) >>> >>> Check http://www.exelisvis.com/docs/IMAGE.html for details. >>> >>> Keep in mind that every image is about 400 Mb. Are you using 64-bit version of IDL (type print, !version to find out) >>> >>> Cheers, >>> Helder >> >> Thanks Helder >> >> What I mean in 3 is to open and read more than one file (complex- double ) and all the files have the same number of colomus and raws (5000,5359). So do I tried to do the previous step of opening a file twice but did not work >> The first file is: >> array_HH = make_array(5000, 5359, /dcomplex, /nozero) >> filename = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename, /GET_LUN >> READU, importUnit, array_HH >> CLOSE, importUnit >> FREE_LUN, importUnit >> >> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >> filename_VV =('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\2015102111 5853_22_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename_VV, /GET_LUN >> READU, importUnit, array_VV >> CLOSE, importUnit >> FREE_LUN, importUnit >> end >> >> This is what I need so I can compare things from file array_HH to array_VV >> >> Thanks > > why wouldn't that work? what is the error message? Which line throws the error? > You've gotta tell a bit more if you want some response... > > h Sorry Helder When I run it in my desktop it works now but not in the laptob and I think memory issues Thanks
On Saturday, December 26, 2015 at 1:14:12 PM UTC+2, Helder wrote: > On Saturday, December 26, 2015 at 9:12:21 AM UTC, algha...@gmail.com wrote: >> On Friday, December 25, 2015 at 2:11:02 PM UTC-8, Helder wrote: >>> On Friday, December 25, 2015 at 1:05:20 PM UTC, algha...@gmail.com wrote: >>>> On Wednesday, December 23, 2015 at 3:33:21 AM UTC-8, Helder wrote: >>>> > On Wednesday, December 23, 2015 at 8:49:31 AM UTC, algha...@gmail.com wrote: >>>> > > On Monday, December 21, 2015 at 3:17:33 AM UTC-8, Helder wrote: >>>> > > > On Monday, December 21, 2015 at 11:04:11 AM UTC, algha...@gmail.com wrote: >>>> > > > > On Monday, December 21, 2015 at 1:42:19 AM UTC-8, Helder wrote: >>>> > > > > > On Monday, December 21, 2015 at 8:14:22 AM UTC, algha...@gmail.com wrote: >>>> > > > > > > On Sunday, December 20, 2015 at 9:52:23 AM UTC-8, Helder wrote: >>>> > > > > > > > On Sunday, December 20, 2015 at 4:42:19 PM UTC, algha...@gmail.com wrote: >>>> > > > > > > > > On Friday, December 18, 2015 at 7:22:10 AM UTC-8, Craig Markwardt wrote: >>>> > > > > > > > > > On Friday, December 18, 2015 at 7:26:07 AM UTC-5, algha...@gmail.com wrote: >>>> > > > > > > > > > > Hi everyone >>>> > > > > > > > > > > >>>> > > > > > > > > > > I have a .dat file double and is 5000 by 8039. I'm using the file in Matlab and I want to try to open it in IDL. So I know it is very basic question but I'm new in IDL and I want to start using it. After I open the file, I want to read like the value of (1,1) >>>> > > > > > > > > > >>>> > > > > > > > > > What format is the data in? ASCII? Binary? Matlab format? It makes a difference. >>>> > > > > > > > > >>>> > > > > > > > > Thanks Craig >>>> > > > > > > > > >>>> > > > > > > > > My data is Binary double format and I used the following because I want to extact the image to see as I'm doing in Matlab >>>> > > > > > > > > >>>> > > > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > > > im = IMAGE(Result) >>>> > > > > > > > > end >>>> > > > > > > > > >>>> > > > > > > > > But I got an image meaning nothing to me only white and black image >>>> > > > > > > > > >>>> > > > > > > > > Am I doing the right way or there are other ways to see the image >>>> > > > > > > > > >>>> > > > > > > > > Thanks >>>> > > > > > > > >>>> > > > > > > > Difficult to tell. >>>> > > > > > > > My suggestion would be to try: >>>> > > > > > > > template = BINARY_TEMPLATE('C:\Users\asus\Desktop\Metasensing\IDL_PROJE CTS\20151021115853_11_SAR_CPLX_0_pres_8.dat') >>>> > > > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', DATA_DIMS = [4999, 8038]) >>>> > > > > > > > mn = min(Result, max=mx) >>>> > > > > > > > print, mn, mx >>>> > > > > > > > im = IMAGE(Result) >>>> > > > > > > > im.min_value = mn >>>> > > > > > > > im.max_value = mx >>>> > > > > > > > >>>> > > > > > > > Any better? If not, what does "print, mn, mx" show? If you're getting the same value, then there must a problem with the import (read_binary()). (*) >>>> > > > > > > > >>>> > > > > > > > Cheers, >>>> > > > > > > > Helder >>>> > > > > > > > >>>> > > > > > > > (*) - or the min/max values are not evenly distributed. Meaning that if one pixel is 0, one is 1000 and the rest of your data is distributed between 500 and 501... then you won't see much unless you set min_value and max_value at 500 and 501. You could also try to have a look at the histogram distribution. >>>> > > > > > > >>>> > > > > > > Hi >>>> > > > > > > >>>> > > > > > > I got the same thing and the min vale is 0 and the max value is 255 >>>> > > > > > > >>>> > > > > > > any suggestions ? >>>> > > > > > >>>> > > > > > I just noticed that you import using BINARY_TEMPLATE() and READ_BINARY(). I never used these functions because I normally know how my template looks like and use readu directely. I'll try to do some guess work: it seems to me as if you're missing something. With binary_template you generate a structure for importing data that you call "template". This template should be used in READ_BINARY() to import the data, but you don't use it. >>>> > > > > > Why don't you try: >>>> > > > > > Result = READ_BINARY('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\ 20151021115853_11_SAR_CPLX_0_pres_8.dat', template=template, DATA_DIMS = [4999, 8038]) >>>> > > > > > >>>> > > > > > and see what happens. >>>> > > > > > >>>> > > > > > If that doesn't work out. Do you know how the data is stored? If it's a simple array of doubles, you could use something like: >>>> > > > > > >>>> > > > > > array = make_array(4999, 8038, /double, /nozero) >>>> > > > > > filename = 'C:\....' ;your file name >>>> > > > > > OPENR, importUnit, filename, /GET_LUN >>>> > > > > > READU, importUnit, array >>>> > > > > > CLOSE, importUnit >>>> > > > > > FREE_LUN, importUnit >>>> > > > > > im = IMAGE(array) >>>> > > > > > >>>> > > > > > cheers, >>>> > > > > > Helder >>>> > > > > >>>> > > > > Thank you very much it's good know. I tried the OPENR way it's double. >>>> > > > > >>>> > > > > On my MATLAB code I seprated real and imaginary such as the following >>>> > > > > >>>> > > > > array = array (1:2:end, :) + j * array (2:2:end, :); >>>> > > > > >>>> > > > > how can that be done in IDL so I can have imagenary and real values >>>> > > > > >>>> > > > > Thanks >>>> > > > >>>> > > > I don't know Matlab. But I guess (yes, it's a guess...) that those Matlab commands put every odd position value in the real part and even position values in the imaginary part. If so, then I would try with: >>>> > > > array = make_array(4999, 8038, /dcomplex, /nozero) >>>> > > > This is also a guess... but I suppose that imaginary data is written this way. >>>> > > > Try this and then display the image as: >>>> > > > >>>> > > > im_r = IMAGE(real_part(array)) >>>> > > > im_i = IMAGE(imaginary(array)) >>>> > > > >>>> > > > and you should see real and imaginary part displayed. Then you can play around and use other useful commands for imaginary data: abs() and atan(). See the help for details: >>>> > > > http://www.exelisvis.com/docs/ABS.html >>>> > > > http://www.exelisvis.com/docs/ATAN.html with the phase keyword. >>>> > > > >>>> > > > Cheers, >>>> > > > Helder >>>> > > >>>> > > Thanks Helder for the help >>>> > > >>>> > > I tried print,ABS(image(array)) and im_r = IMAGE(real_part(array)) and im_i = IMAGE(imaginary(array)) to see images but I'm getting the following : >>>> > > >>>> > > % IMAGE: Unable to allocate memory: to make array. >>>> > > >>>> > > if the problem is the memory is not enough, how can I get a small subset of the image and save it as a new file then I can see if it is working >>>> > > >>>> > > Thanks >>>> > >>>> > Hi, >>>> > I think that the command: >>>> > print,ABS(image(array)) >>>> > makes no sense. >>>> > >>>> > What happens if you try this: >>>> > im_r = real_part(array) >>>> > im_i = imaginary(array) >>>> > >>>> > Everything ok? (it should not give an error unless you run out of memory) >>>> > If that is ok, then you can try to reduce the size of the images. Given that you have an odd number of rows (8039), you're going to have to use congrid to reduce the size of the image: >>>> > smaller_im_r = congrid(im_r,5000/10.0,8039/10.0) >>>> > smaller_im_i = congrid(im_i,5000/10.0,8039/10.0) >>>> > then >>>> > oIm_r = image(smaller_im_r) >>>> > oIm_i = image(smaller_im_i) >>>> > >>>> > If you do get an error, you have to tell me *which* line generated the error. >>>> > >>>> > Cheers, >>>> > Helder >>>> >>>> Thanks Helder for the help I finally got the image as follows >>>> >>>> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >>>> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >>>> OPENR, importUnit, filename_VV, /GET_LUN >>>> READU, importUnit, array_VV >>>> A_VV = ABS(array_VV) >>>> B_VV = A_VV^(0.7/2) >>>> images_VV = image(B_VV, TITLE='Intensity VV') >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> end >>>> >>>> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >>>> >>>> The secound is I want to open other .dat file dcomplex in the same page with the same number of array so I can compare them. Can I just copy the previouse thinf and pate it and change the file path ? is that right as follow >>>> >>>> array_HH = make_array(5000, 5359, /dcomplex, /nozero) >>>> filename_HH = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') >>>> OPENR, importUnit, filename_HH, /GET_LUN >>>> READU, importUnit, array_HH >>>> A = ABS(array_HH) >>>> B = A^(0.7/2) >>>> image_HH = image(B, TITLE='Intensity HH') >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >>>> filename_VV = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_22_SAR_CPLX_0_pres_8.dat') >>>> OPENR, importUnit, filename_VV, /GET_LUN >>>> READU, importUnit, array_VV >>>> A_VV = ABS(array_VV) >>>> B_VV = A_VV^(0.7/2) >>>> images_VV = image(B_VV, TITLE='Intensity VV') >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> end >>>> >>>> >>>> Thanks you >>> >>> A couple of comments: >>> 1) after opening and reading the file, you can close it right away: >>> >>>> OPENR, importUnit, filename_VV, /GET_LUN >>>> READU, importUnit, array_VV >>>> CLOSE, importUnit >>>> FREE_LUN, importUnit >>>> A_VV = ABS(array_VV) >>>> B_VV = A_VV^(0.7/2) >>>> images_VV = image(B_VV, TITLE='Intensity VV') >>> >>> 2) regarding your question: >>>> Know I have two things to solve. The first one is the gray image is a little bit dark so how can I increase the intensity of it and make it more brighter >>> >>> remember my answer: >>> im.min_value = mn >>> im.max_value = mx >>> >>> check what im.max_value is and try to make it lower. This defines the white level. >>> >>> 3) same page? Try to adapt this code: >>> >>> ww = window(dimensions=[1200,600]) >>> im1 = image(/test, margin=0, layout=[2,1,1], current=ww) >>> im2 = image(/test, margin=0, layout=[2,1,2], current=ww) >>> >>> Check http://www.exelisvis.com/docs/IMAGE.html for details. >>> >>> Keep in mind that every image is about 400 Mb. Are you using 64-bit version of IDL (type print, !version to find out) >>> >>> Cheers, >>> Helder >> >> Thanks Helder >> >> What I mean in 3 is to open and read more than one file (complex- double ) and all the files have the same number of colomus and raws (5000,5359). So do I tried to do the previous step of opening a file twice but did not work >> The first file is: >> array_HH = make_array(5000, 5359, /dcomplex, /nozero) >> filename = ('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\20151021115 853_11_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename, /GET_LUN >> READU, importUnit, array_HH >> CLOSE, importUnit >> FREE_LUN, importUnit >> >> array_VV = make_array(5000, 5359, /dcomplex, /nozero) >> filename_VV =('C:\Users\asus\Desktop\Metasensing\IDL_PROJECTS\2015102111 5853_22_SAR_CPLX_0_pres_8.dat') >> OPENR, importUnit, filename_VV, /GET_LUN >> READU, importUnit, array_VV >> CLOSE, importUnit >> FREE_LUN, importUnit >> end >> >> This is what I need so I can compare things from file array_HH to array_VV >> >> Thanks > > why wouldn't that work? what is the error message? Which line throws the error? > You've gotta tell a bit more if you want some response... > > h Hi I have the image on the X-axis from 0 to 5000 and Y-axis from 0 to 5359 from the array[5000,5359]. I want to have the values in X-axis from 500 to 5500 and the Y-axis from -2697.5 to 2697.5 and finally I want to rotate the image 90 degree so everything to rotate even the axis What I have is the following ; Display the image. im = IMAGE(array, DIMENSIONS=[5000, 5359], MARGIN=0.2) ; Add the X and Y axes xax = AXIS('X',Title='Ground Range') yax = AXIS('Y'),Title='Azimuth')
What have you tried? What didn't work? Did you look at the documentation? If so, what didn't you find that you expected to find? Please give me a reason to answer this during the Christmas holidays... Cheers, Helder
On Saturday, December 26, 2015 at 6:05:24 PM UTC-8, Helder wrote: > What have you tried? What didn't work? Did you look at the documentation? If so, what didn't you find that you expected to find? > Please give me a reason to answer this during the Christmas holidays... > > Cheers, Helder I have tried XRANGE = [500,500] and did not work as follows: xax = AXIS('X',TITLE='Ground Range [m]',XRANGE = [500,5500]) Also, I tried xax = AXIS('X',TITLE='Ground Range [m]',AXIS_RANGE = [500,5500]) and it did not work. my array is 5000,5359 and on the axis it goes from 0 to 5000 and the other axis it goes from 0 to 5359 and what I want is to have the x-axis change to [500,5500] and the Y-axis=[-2679,2679] without any change in the image only the axis. I want to make something like x-axis= 0=500 and 5000=5500 Thanks
On Saturday, December 26, 2015 at 6:05:24 PM UTC-8, Helder wrote: > What have you tried? What didn't work? Did you look at the documentation? If so, what didn't you find that you expected to find? > Please give me a reason to answer this during the Christmas holidays... > > Cheers, Helder I have tried XRANGE = [500,5500] and did not work as follows: xax = AXIS('X',TITLE='Ground Range [m]',XRANGE = [500,5500]) Also, I tried xax = AXIS('X',TITLE='Ground Range [m]',AXIS_RANGE = [500,5500]) and it did not work. my array is 5000,5359 and on the axis it goes from 0 to 5000 and the other axis it goes from 0 to 5359 and what I want is to have the x-axis change to [500,5500] and the Y-axis=[-2679,2679] without any change in the image only the axis. I want to make something like x-axis= 0=500 and 5000=5500 and the y-axis =[0 = -2679 and 5359 = 2679] Thanks
On Monday, December 28, 2015 at 2:36:08 AM UTC-8, algha...@gmail.com wrote: > On Saturday, December 26, 2015 at 6:05:24 PM UTC-8, Helder wrote: >> What have you tried? What didn't work? Did you look at the documentation? If so, what didn't you find that you expected to find? >> Please give me a reason to answer this during the Christmas holidays... >> >> Cheers, Helder > > I have tried XRANGE = [500,5500] and did not work as follows: > xax = AXIS('X',TITLE='Ground Range [m]',XRANGE = [500,5500]) > Also, I tried xax = AXIS('X',TITLE='Ground Range [m]',AXIS_RANGE = [500,5500]) > and it did not work. > > my array is 5000,5359 and on the axis it goes from 0 to 5000 and the other axis it goes from 0 to 5359 and what I want is to have the x-axis change to [500,5500] and the Y-axis=[-2679,2679] without any change in the image only the axis. I want to make something like x-axis= 0=500 and 5000=5500 and the y-axis =[0 = -2679 and 5359 = 2679] > > Thanks Any Idea ??