X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Mar 2015 08:49 PM by  anon
problem with ENVI_GLT_DOIT
 6 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
25 Mar 2015 08:49 PM
    hi,i am experimenting problems writing a code to georeference HDF5 DATA. the r_fid of function ENVI_GLT_DOIT is always wrong with -1 value, which means the GLT build is failed. hdf5 data[FY3B_MWRID_GBAL_L1_20110201_0124_010KM_MS.zip] can be downloaded from http://pan.baidu.com/s/1pJyrGU3 Some one experimented this problem? I attach the code in the bottom.. and thanks for your help! Lillte Jing pro sample_glt_georef compile_opt strictarr ; Restore the core file and start ENVI in batch ENVI,/RESTORE_BASE_SAVE_FILES,/NO_STATUS_WINDOW ENVI_BATCH_INIT ; create input projection i_proj=ENVI_PROJ_CREATE(/geographic, datum="WGS-84") ; create output projection ;o_proj=ENVI_PROJ_CREATE(/UTM, zone=24, datum="WGS-84") fname ='FY3B_MWRID_GBAL_L1_20101201_0053_010KM_MS.HDF' outname='out.tif' gltname='glt' file_id1 = H5F_OPEN(fname) x_fid = H5D_OPEN(file_id1, 'Longitude') envi_file_query, x_fid, dims=dims ; Open up the dataspace associated with the Eskimo image. dataspace_id= H5D_GET_SPACE(x_fid) ; Retrieve the dimensions so we can set the window size. dimension= H5S_GET_SIMPLE_EXTENT_DIMS(dataspace_id) ENVI_FILE_QUERY, x_fid, ns=ns, nl=nl, nb=nb file_id2 = H5F_OPEN(fname) y_fid = H5D_OPEN(file_id2, 'Latitude') file_id3 = H5F_OPEN(fname) tb_fid = H5D_OPEN(file_id3, 'EARTH_OBSERVE_BT_10_to_89GHz') dim=[-1L,0,dimension[0]-1,0,dimension[1]-1] bandsnum=10 pos=lindgen(bandsnum) ;ENVI_GLT_DOIT ENVI_DOIT, 'ENVI_GLT_DOIT', DIMS=dim,I_PROJ= i_proj, O_PROJ=i_proj, out_name = gltname, $ R_FID=glt_fid, rotation=0, X_FID=x_fid, X_POS=0, Y_FID=y_fid, Y_POS=0 ENVI_FILE_QUERY, glt_fid, dims=glt_dims ; ENVI_GEOREF_FROM_GLT_DOIT ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', BACKGROUND=0, FID=tb_fid,GLT_DIMS=glt_dims, pos=pos, GLT_FID=glt_fid,$ out_name=outname, r_fid=out_fid ; ; print a 'finished' message to the command log ; Exit ENVI ENVI_BATCH_EXIT end

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    26 Mar 2015 08:12 AM
    Do you see the GLT process start if you run your process in ENVI+IDL? Can you add in some print statements to your code to determine if ENVI is reading the original data correctly? I would print out the input file FIDs to make sure they are returning valid values and then have print statements for all the input parameters to the GLT_DOIT.

    Deleted User



    New Member


    Posts:
    New Member


    --
    26 Mar 2015 09:17 PM
    Thank you for reminding. I followed your advice and the old version IDL8.0 doesn't return any warning or error but r_fid=-1. I update IDL to V8.3, and the GLT process doesn't work at all. The issue is 'envi_glt_doit:an error has occurred during processing. ERROR: expression must be a structure in the context: ENVI_FILES(ENVI_FILES_COMMON). The result may be invalid' What does that mean? I can't figure out 'ENVI_FILES_COMMON' problem at all. Some information of opened HDF may help: LON FLOAT=ARRAY[240,1725] tb_fid=83886091 x_fid=83886089 tb_fid=83886090 Thank you MariM, you make my day!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    27 Mar 2015 09:41 AM
    The 'ENVI_FILES(ENVI_FILES_COMMON' error typically occurs if there are custom user functions that are conflicting with ENVI. Can you check your save_add directory to see if there are user created scripts present and if so, remove them for now. Restart ENVI+IDL and try running the GLT batch code. Your FID values look very strange. Those are the returned FIDs from running the batch script from a fresh session of ENVI+IDL? If so, they are very large. FIDs will start with 1 and go up from there.

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 Mar 2015 12:21 AM
    The fid returned automatically by H5D_OPEN looks weird, but it doesn't stop other functions getting this strange fid and work well, like H5D_READ. And I mistakened the output file name and fixed it. But the r_fid=-1 issue is still alive. The code can run without any IDL break_error. The r_fid still results as -1 and the output file is empty with nothing. How can I find out the origin of this problem? Variables has been already checked, anything else that I can do? Thanks for your sincere aid. IDL console displayed as below % Compiled module: SAMPLE_GLT_GEOREF. LON FLOAT = Array[240, 1725] tb_fid= 83886115 x_fid= 83886113 y_fid= 83886114 glt_fid= -1 IDL>

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    29 Mar 2015 06:06 AM
    Sorry, I didn't notice at first but you will not get a valid ENVI FID from using IDL's H5D_OPEN. I would suggest using the ENVI::OpenRaster method to open the file with the appropriate keywords for HDF5. Then use RasterToFID to get a valid FID to run the GLT. http://www.exelisvis.com/docs/ENVI__O...

    Deleted User



    New Member


    Posts:
    New Member


    --
    31 Mar 2015 06:16 AM
    Thanks a lot, MariM! Your words work well!
    You are not authorized to post a reply.