I thought this would be simple, but things are not working as I had expected and I am confused. I hope someone can explain what I'm doing wrong.
I have many MODIS L2 files from which I want to create a series of maps with data from the same spatial subset. The files are HDF, but are not those that can be directly read by ENVI. Here is what I am doing:
Generate an input projection that represents the input file (/Geographic).
Generate an output projection for my map, projected using Lambert Conformal Conic and specified standard parallels, central meridian, center latitude, etc.
Read the HDF file.
Calibrate it (convert counts to geophysical units)
Create a Geographic Lookup Table (GLT) using the calibrated longitude and latitude bands from the HDF file and the input and output projections.
Georeference the data file using ENVI_GEOREF_FROM_GLT_DOIT
Write the georeferenced data an ENVI file
Open the georeferenced ENVI data file
Use ENVI_CONVERT_PROJECTION_COORDINATES to convert the lat/lon values of the limits of the subregion I want to map to the map coordinates for the Lambert projection (meters)
Use ENVI_CONVERT_FILE_COORDINATES to convert the map coordinates (meters) to file coordinates. This should give me the file coordinates of the input file that correspond to my output map.
Write the data corresponding to the subset (defined by the file coordinates) to a new ENVI file.
There are a bunch of housekeeping steps that I've left out. I don't think they are that important given the strange results I am getting.
Here are the strange results.
1. When opened in ENVI, the MAP INFO for the spatial subset file does not show the correct projection or pixel size. Rather than "Lambert Conformal Conic" it shows "pseudo geographic lat/lon". Everything else looks OK.
Tech support at ITT suggested that I include the INHERIT keyword when I write the subset file. I set the INHERT parameters after I georeference the input data.
2. Sure enough, when I open the subset image in ENVI, the projection show the correct name and pixel size, but the map UL is incorrect and when I load either the latitude or longitude band into the viewer and use the inquire cursor value function, I find that the LL given do not correspond to the pixel value but the pixel values do correspond to the map limits I've set asked for.
I've tried all sorts of combinations of using INHERIT, MAP_INFO, etc. without success. Surely this can't be so hard to do - I must be missing something basic. I need to do this in batch so suggestions involving interactive processing won't help, I'm afraid.
Thanks.
|