calling MRT Swath from IDL [message #87641] |
Thu, 20 February 2014 11:20  |
lhashemi
Messages: 9 Registered: February 2014
|
Junior Member |
|
|
Hi
Do you know how to call MRT Swath from IDL? I need it for reading , processing and writing a MOD02HKM (modis level 1b, 500 m).
Thanks
LH
|
|
|
|
|
|
Re: calling MRT Swath from IDL [message #87652 is a reply to message #87650] |
Thu, 20 February 2014 16:56   |
lhashemi
Messages: 9 Registered: February 2014
|
Junior Member |
|
|
> I don't understand what you mean. You say the MOD02KHM is an array of
>
> reflectance values. How do they become something else when GDAL puts
>
> them into a different file with a map projection?
>
>
>
> And, doesn't GDAL require arrays of latitude and longitude (MOD03 files)
>
> to do the conversion? I can't see how it could possibly work without
>
> these values.
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Gdal read the data correctly, however, the data are raw integer counts , I need to convert the data to floating-point corrected counts for my process. and I don't know how to do it? (this process needs an offset and scale, and I don't know where these data are located).
as I mentioned I got some IDL codes from NASA website for reading the data and converting them to floating-point corrected counts. however the result is an array for each band without any long/lat associated. I am looking for an idl code to re-project this arrays.
MOD02HKM (500 m) contains an array of long/lat (1000 m), I think it doesn't need MOD03 for re-projection (I'm not sure though). It should involve interpolation for generating long/lat for each pixel of data array or for a user defied grid.
I want to read, process and write MOD02HKM. I am looking either for an idl code to re-project the data (read by some other IDL codes) or for an idl code to convert the raw integer number to floating corrected values (so I can use gdal for re-projection or MRTSwath). Any help would highly appreciated.
Thanks
LH
|
|
|
Re: calling MRT Swath from IDL [message #87656 is a reply to message #87652] |
Thu, 20 February 2014 20:14   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
lhashemi@g.harvard.edu writes:
> Gdal read the data correctly, however, the data are raw integer counts , I need to convert the data to floating-point corrected counts for my process. and I don't know how to do it? (this process needs an offset and scale, and I don't know where these data are located).
>
> as I mentioned I got some IDL codes from NASA website for reading the data and converting them to floating-point corrected counts. however the result is an array for each band without any long/lat associated. I am looking for an idl code to re-project this arrays.
>
> MOD02HKM (500 m) contains an array of long/lat (1000 m), I think it doesn't need MOD03 for re-projection (I'm not sure though). It should involve interpolation for generating long/lat for each pixel of data array or for a user defied grid.
>
> I want to read, process and write MOD02HKM. I am looking either for an idl code to re-project the data (read by some other IDL codes) or for an idl code to convert the raw integer number to floating corrected values (so I can use gdal for re-projection or MRTSwath). Any help would highly appreciated.
I happen to have one of those files here, and when I open it with
ncdf_browser (which also reads HDF files), it appears the latitude,
longitude, bands, and offsets are all present in the file. If you just
pass the file name to GDAL, it probably gets everything it needs from
the file itself.
To "calibrate" the data, you just multiply it by the scale factor and
add the offset. All this information should be available to you in the
documentation available on the MODIS web page.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: calling MRT Swath from IDL [message #87700 is a reply to message #87656] |
Sun, 23 February 2014 19:07  |
devin.white
Messages: 50 Registered: March 2007
|
Member |
|
|
On Thursday, February 20, 2014 11:14:22 PM UTC-5, David Fanning wrote:
> lhashemi@g.harvard.edu writes:
>
>
>
>> Gdal read the data correctly, however, the data are raw integer counts , I need to convert the data to floating-point corrected counts for my process. and I don't know how to do it? (this process needs an offset and scale, and I don't know where these data are located).
>
>>
>
>> as I mentioned I got some IDL codes from NASA website for reading the data and converting them to floating-point corrected counts. however the result is an array for each band without any long/lat associated. I am looking for an idl code to re-project this arrays.
>
>>
>
>> MOD02HKM (500 m) contains an array of long/lat (1000 m), I think it doesn't need MOD03 for re-projection (I'm not sure though). It should involve interpolation for generating long/lat for each pixel of data array or for a user defied grid.
>
>>
>
>> I want to read, process and write MOD02HKM. I am looking either for an idl code to re-project the data (read by some other IDL codes) or for an idl code to convert the raw integer number to floating corrected values (so I can use gdal for re-projection or MRTSwath). Any help would highly appreciated.
>
>
>
> I happen to have one of those files here, and when I open it with
>
> ncdf_browser (which also reads HDF files), it appears the latitude,
>
> longitude, bands, and offsets are all present in the file. If you just
>
> pass the file name to GDAL, it probably gets everything it needs from
>
> the file itself.
>
>
>
> To "calibrate" the data, you just multiply it by the scale factor and
>
> add the offset. All this information should be available to you in the
>
> documentation available on the MODIS web page.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
You can also try the MODIS Conversion Toolkit (MCTK). It's written in IDL, leverages ENVI, and works with every known product. It used to be available in the Exelis VIS code library. When that went down a few months ago, I moved all of my plugins over to GitHub:
https://github.com/dawhite/ENVIPlugins
MCTK is the first entry on the list. The user guide that comes in the zip file will walk you through how to drive it.
|
|
|