06 Dec 2012 01:21 PM |
|
I have HDF images produced by a NASA software. HDFs do not contain map information, but there is a standard ENVI .hdr associated with each HDF.
HDFs are opened correctly with envi_open_file, but bands need to be selected manually, which is impossible in batch mode. I tried to use "envi_open_data_file,fname,/hdf_sd,hdfsd_dataset=pos", but header information was lost and the opened images did not have map projection.
I don't know how to add map information to any opened dataset. And I tried to use envi_setup_head to create a header for the original HDF files. There is no examples of HDF in the help document. I cannot feed the function with correct parameters, for example, pointer_info.
I am using envi_enter_data to display the images with correct projection, but with this method I need to make copies of data which makes the program slow.
|
|
|
|
MariM Veteran Member
Posts:2396  
10 Dec 2012 09:21 AM |
|
Do your HDF's have map info or not? You mention that they do not contain map info and then say they open with no map projection which would be expected. If you know what the map info should be then you need to build the map info structure using ENVI_MAP_INFO_CREATE and add this structure using MAP_INFO keyword to ENVI_SETUP_HEAD.
|
|
|
|
Deleted User New Member
Posts:  
13 Dec 2012 09:38 PM |
|
Thank you for your reply. Actually envi_setup_head, as appearing in the title, was my first attempt. But I really did not know how to set up the pointer_info keyword. After adding map_info, the projection was correct but all pixel values were weird.
I could not find any example of setting the pointer_info keyword, even when I google it. I will appreciate it if you can provide one.
|
|
|
|
MariM Veteran Member
Posts:2396  
14 Dec 2012 07:31 AM |
|
I don't think the issue would be with pointer_info which is just a structure indicating the number and specific HDF dataset you want to create the header for. I think the problem would be either in the data type, interleave or byte order of the dataset. You could check using the GUI to open the HDF dataset and see what these parameters are in the virtual header that is created and making sure the data set looks correct when displayed.
|
|
|
|
Deleted User New Member
Posts:  
14 Dec 2012 10:32 AM |
|
I still need to create a correct pointer_info structure for the multi-band HDF... Please let me know how... All other parameters are from envi_file_query of the image manually opened, should be OK but I will try more.
|
|
|
|
MariM Veteran Member
Posts:2396  
14 Dec 2012 11:07 AM |
|
pointer_info is just a structure pointing to the HDF SD dataset and dimensions of the dataset. For example:
pointer_info={data_set:'9', ndims:2}
This can be used to create a header for the 9th dataset in an ASTER 1A dataset, of which the dimensions of the dataset is '2'.
|
|
|
|