Question on MODIS Conversion Toolkit [message #70651] |
Mon, 26 April 2010 04:45  |
Harry Kim
Messages: 16 Registered: April 2010
|
Junior Member |
|
|
Hi, Everyone. I am back with MODIS Converision Toolkit (MCTK)
Question.
Are there anyone working on MODIS data?
I am working on various MODIS products for ecohydrological processes
in Korean penninsula. I tried to use MODIS Conversion Toolkit in
programming mode. This tool seems to be useful to process various
kinds of MODIS products.
AS some of you know this very well, we can do MCTK both in GUI mod and
in batch (programming) mod. I have to process thousands of file, and I
cannot do this in GUI mode.
Everytime I tried in programming mod, I got this error message.
"Map information contains an invaild pixel size. This file will not be
georeferenced."
Strangely, there was no problem in making images when I tried with the
same value in GUI mode.
This is what I have done so far. Please take a look, and let me know
what to do.
Hyun Woo
-------------------------------
PRO MCTK_MOD11
compile_opt idl2
modis_grid_file = 'D:\MODIS11\Data
\MYD11A1.005\MYD11A1.A2002189.h28v05.005.2007216150809.hdf'
output_location = 'D:\MODIS11\output'
output_rootname = 'MYD11_LST'
grid_name = 'MOD_Grid_Daily_1km_LST'
sd_names = ['LST_Day_1km']
out_method = 1
output_projection = envi_proj_create(/geographic)
;out_ps_x = 0.008365
;out_ps_y = 0.008365
interpolation_method = 6
convert_modis_data, in_file=modis_grid_file, $
out_path = output_location, out_root= output_rootname, $
/higher_product, /grid, gd_name=grid_name, sd_names=sd_names, $
out_method= out_method, out_proj=output_projection, $
out_ps_x = 0.008365, out_ps_y = 0.08365, num_x_pts=50,
num_y_pts=50, interp_method=interpolation_method ;, $
background = -999
end
----------------------------------------
|
|
|
Re: Question on MODIS Conversion Toolkit [message #70687 is a reply to message #70651] |
Thu, 29 April 2010 03:35   |
devin.white
Messages: 50 Registered: March 2007
|
Member |
|
|
I downloaded the same file you're using and ran it through a modified
version of the example grid conversion program that comes with the
MCTK user guide (below). All I changed was the file name, out path,
out root, and pixel sizes. It runs as expected. If you cannot get
this version to work for you and/or you require assistance with batch
processing a large number of files, I suggest contacting ITT VIS
Technical Support.
pro test_batch_modis_conversion_grid
compile_opt idl2
modis_grid_file = 'C:\MCTK
\MYD11A1.A2002189.h28v05.005.2007216150809.hdf'
;The specified output location MUST end in the appropriate path
;separator for your OS
output_location = 'C:\MCTK\'
output_rootname = 'MYD11A1_LST'
grid_name = 'MODIS_Grid_Daily_1km_LST'
sd_names = 'LST_Day_1km'
;Output method schema is:
;0 = Standard, 1 = Reprojected, 2 = Standard and reprojected
out_method = 1
output_projection = envi_proj_create(/geographic)
;Specify the output X and Y pixel sizes in double precision
floating
;point. Sizes must be in units relevant to selected output
projection
;(degrees in this example).
out_ps_x = 0.008365d
out_ps_y = 0.008365d
;The interp_method keyword uses the same numbering scheme as
;ENVI_REGISTER_DOIT's METHOD keyword
;Choosing Triangulation with Nearest Neighbor.
interpolation_method = 6
;Set reprojection background and any native fill values to -999
;Setting num_x_pts to 50 and num_y_pts to 50 results in 2500 GCPs.
;That should be more than enough....
convert_modis_data, in_file=modis_grid_file, $
out_path=output_location, out_root=output_rootname, $
/higher_product, /grid, gd_name=grid_name, sd_names=sd_names, $
out_method=out_method, out_proj=output_projection, $
out_ps_x=out_ps_x, out_ps_y=out_ps_y, num_x_pts=50, $
num_y_pts=50, interp_method=interpolation_method, $
background=-999, fill_replace_value=-999, $
r_fid_array=r_fid_array, r_fname_array=r_fname_array
end
On Apr 28, 9:29 pm, Harry Kim <kim4ecohy...@gmail.com> wrote:
> Devin,
>
> Sorry for the confusion. out_ps_y was already set to 0.008365. I made
> a mistake in re-typing my source code here.
>
> Based on your suggestion, I changed my code using /UTM projection.
>
> However, I got different error message this time saying that...
>
> "Unable to attach to specified grid. Check name against HDF file
> contents."
>
> I don't understand. The *.hdf file is in the location designated in
> the code.
>
> ---------------------------------
> PRO MCTK_MOD11
> compile_opt idl2
>
> modis_grid_file = 'D:\MYD11A1.A2002191.h28v05.005.2007216150810.hdf'
> output_location = 'D:\MODIS11\output'
> output_rootname = 'MYD11_TEST'
>
> grid_name = 'MOD_Grid_Daily_1km_LST'
> sd_names = ['LST_Day_1km']
>
> out_method = 1
>
> output_projection = envi_proj_create(/UTM) ;/geographic) ;, /
> datum=WGS-84)
>
> ;ps_x = 0.008365d
> ;ps_y = 0.008365d
>
> ps_x = 1000.0
> ps_y = 1000.0
>
> print, 'Now IDL is making an image!!!'
>
> interpolation_method = 6
>
> convert_modis_data, in_file=modis_grid_file, $
> out_path = output_location, out_root= output_rootname, $
> /higher_product, /grid, gd_name=grid_name, sd_names=sd_names, $
> out_method= out_method, out_proj=output_projection, $
> ;out_ps_x = 0.008365d, out_ps_y = 0.008365d, num_x_pts=50,
> num_y_pts=50, interp_method=interpolation_method ;, $
> out_ps_x=ps_x, out_ps_y=ps_y, num_x_pts=50, num_y_pts=50,
> interp_method=interpolation_method, $
> background = -999
>
> print, 'It is done!'
>
> end
|
|
|
Re: Question on MODIS Conversion Toolkit [message #70702 is a reply to message #70651] |
Wed, 28 April 2010 18:29   |
Harry Kim
Messages: 16 Registered: April 2010
|
Junior Member |
|
|
Devin,
Sorry for the confusion. out_ps_y was already set to 0.008365. I made
a mistake in re-typing my source code here.
Based on your suggestion, I changed my code using /UTM projection.
However, I got different error message this time saying that...
"Unable to attach to specified grid. Check name against HDF file
contents."
I don't understand. The *.hdf file is in the location designated in
the code.
---------------------------------
PRO MCTK_MOD11
compile_opt idl2
modis_grid_file = 'D:\MYD11A1.A2002191.h28v05.005.2007216150810.hdf'
output_location = 'D:\MODIS11\output'
output_rootname = 'MYD11_TEST'
grid_name = 'MOD_Grid_Daily_1km_LST'
sd_names = ['LST_Day_1km']
out_method = 1
output_projection = envi_proj_create(/UTM) ;/geographic) ;, /
datum=WGS-84)
;ps_x = 0.008365d
;ps_y = 0.008365d
ps_x = 1000.0
ps_y = 1000.0
print, 'Now IDL is making an image!!!'
interpolation_method = 6
convert_modis_data, in_file=modis_grid_file, $
out_path = output_location, out_root= output_rootname, $
/higher_product, /grid, gd_name=grid_name, sd_names=sd_names, $
out_method= out_method, out_proj=output_projection, $
;out_ps_x = 0.008365d, out_ps_y = 0.008365d, num_x_pts=50,
num_y_pts=50, interp_method=interpolation_method ;, $
out_ps_x=ps_x, out_ps_y=ps_y, num_x_pts=50, num_y_pts=50,
interp_method=interpolation_method, $
background = -999
print, 'It is done!'
end
|
|
|
|
|
Re: Question on MODIS Conversion Toolkit [message #90677 is a reply to message #70651] |
Tue, 24 March 2015 18:35  |
lib07
Messages: 1 Registered: March 2015
|
Junior Member |
|
|
Please check whether your input image format in grid or swath.....
here i think you are facing with resampling issue. I think if the image cannot be resample from swath to grid, so go ahead with original pixel size( it may be 5km not 1 km)), then convert it into grid format, then resample, or download grid format image from the www.ladsweb.nascom.nasa.gov
|
|
|