X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 21 Mar 2011 07:55 AM by  anon
help in Etm data process
 8 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
21 Mar 2011 07:55 AM
    I got some ETM data from www. I write some IDL programs to process the ETM data. the data structure of ETM data is L7*******_B10.TIF L7*******_B20.TIF L7*******_B80.TIF, with a MTL.txt file. I use ENVI to open MTL.txt file, it shows me 3 different files, the first one is with 1 band(pan), the second is the thermal infrared band with 2 bands, the last is composed with 6 bands. I use ENVI_OPEN_FILE to open MTL.txt file, the r_fid returned a array of fid. 3 elements while I use this function in the For *** Endfor sometimes the r_fid returned is only one fid,I am not sure why this happened. someone tell me to use ENVI_OPEN_DATA_FILE to open this Landsat data, while I find the fid returned is the fid of the pan band (resolution is 15m), I hope to read the file with 6 bands. I am not sure how to read the Landsat data rightly with ENVI function. The another question is also very interesting , I use tmcal_doit in this way: envi_doit, 'tmcal_doit', $ fid=fid_gapfilled,pos = pos, dims=dims,$ bands_present=band_present, sat=sat, cal_type=1, date=date,sun_angle=sun_elevation,$ out_name=gapfilled_out_name, r_fid=r_fid2, gain=gainarr,bias=biasarr ENVI prompt me "Error, Expression must be a scalar or 1 element array in this context" while I write in this way envi_doit, 'tmcal_doit', $ fid=fid_gapfilled,pos = pos, dims=dims,$ bands_present=band_present, sat=sat, cal_type=0, date=date,sun_angle=sun_elevation,$ out_name=gapfilled_out_name, r_fid=r_fid2, gain=gainarr,bias=biasarr is no problem, the only change is cal_type=0 or 1. I am really pullzed. Thank you in advance.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    21 Mar 2011 10:17 AM
    You can typically only process one FID at a time so I would expect the result of a process within a FOR loop would return one FID. Then continue on processing each dataset within the loop and keep track of the returned FIDs. I am not sure what is expected of passing a variable that contains 3 FIDs. As for TM_CAL_DOIT, the best way to troubleshoot is to do several print statements before and within the loop. I can't tell from the code snippets you posted if the variables are valid. I was able to process a TM5 multi-band scene using the following code: PRO EXAMPLE_TMCAL_DOIT COMPILE_OPT IDL2 IDL2 envi_select, fid=fid envi_file_query, fid, dims=dims, nb=nb pos=lindgen(nb) bands_present = pos lmin = [-1.52, -2.84, -1.170, -1.510, -0.370, -0.150] lmax = [193., 365., 264., 221., 30.2, 16.5] , fid=fid, fid, dims=dims, nb=nbpos=lindgen(nb)bands_present = poslmin = [-, -, -, -, -, -] lmax = [, , , , , ] ; Calculate the gain from lmin/lmax. gain = fltarr(n_elements(lmin)) bias = lmin for i=0, n_elements(lmin)-1 do begin gain[i] = (lmax[i] - lmin[i]) / 255 endfor i=, (lmin)- gain[i] = (lmax[i] - lmin[i]) / date = [4,20,2008] out_name = 'testimg' sat = 1 envi_doit, 'tmcal_doit', $ fid=fid, pos=pos, dims=dims, $ bands_present=bands_present, $ sat=sat, cal_type=1, date=date, $ sun_angle=55.64, out_name=out_name, $ r_fid=r_fid, gain=gain, bias=bias , 'tmcal_doit', $fid=fid, pos=pos, dims=dims, $bands_present=bands_present, $sat=sat, cal_type=, date=date, $sun_angle=, out_name=out_name, $r_fid=r_fid, gain=gain, bias=bias END

    Deleted User



    New Member


    Posts:
    New Member


    --
    21 Mar 2011 08:24 PM
    Thanks for the reply. of course I can only process one FID at a time, while I use ENVI to open the MTL.txt, in the available band list it show 3 different files, the file with pan band is the first one, the second is the themal infrared two bands, the last one is the file with six bands. So when I use ENVI_FILE_OPEN, r_fid returned 3 element of fid is acceptable. for example , I have 2 ETM files to process, so I need to use For loop, the question is in the first running of this for loop , the r_fid returned 3 element, and I use the fid[2] to use the data with six bands while in the second running , r_fid returned only 1 element, I have no way to use the data with six bands. I can use ENVI_FILE_QUERY to the the band count of this fid, is only one band in it (means the pan band of ETM) I also use ENVI_OPEN_DATA_FILE, it returned only 1 element. As for TM_CAL_DOIT, I am very puzzled because, the paraments are the same, I have checked them carefully the only difference between the code I used is the cal_type=0 or 1 . when the cal_type=0, no problems and no error. while the cal_type=1, the error shows. I think maybe a bug in ENVI.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    22 Mar 2011 07:20 AM
    The code example I posted calibrates to reflectance without error. You may need to contact Technical Support directly to get more assistance and help figure out what is going on.

    Deleted User



    New Member


    Posts:
    New Member


    --
    12 Oct 2011 03:03 AM
    Plz help me how to add Landsat ETM+ Tiff frmate data at once without layer stacking?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    12 Oct 2011 10:34 AM
    You need ENVI 4.7 or 4.8. Then you can open the Landsat Geotiff with metadata file (_mtl.txt) using File ->Open External Format->Landsat->Geotiff with metadata.

    Deleted User



    New Member


    Posts:
    New Member


    --
    13 Oct 2011 12:25 AM
    Ok thanks for this help. Kindly tell how can i upgrade my ENVI 4.5 to 4.7? bcz i have no access to 4.7 & 4.8

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    13 Oct 2011 11:01 AM
    You can download ENVI 4.8 from our website under Downloads ->Product Downloads ->ENVI. However, it will require an updated license file which you may have to purchase if you do not already have a license for ENVI 4.8. You can contact your local sales representative to enquire about pricing. To find out who your local distributor may be, from our website, go to Company->Contact Us. Select the Country you are from and the ENVI product which should provide contact information for you.

    Deleted User



    New Member


    Posts:
    New Member


    --
    13 Oct 2011 11:13 AM
    Sure. Thankyou so much for your time, help and valuable suggestions. Will contact in case of any other querry. Thanks again
    You are not authorized to post a reply.