pro test_batch_modis_conversion_grid
compile_opt idl2
modis_grid_file = 'C:\MOD13A3.A2004061.h10v06.004.2004110184849.hdf'
;The specified output location MUST end in the appropriate path
;separator for your OS
output_location = 'C:\MCTK_Output\'
output_rootname = 'monthly_NDVI'
grid_name = 'MOD_Grid_monthly_1km_VI'
sd_names = ['1 km monthly NDVI','1 km monthly EVI']
;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.008370d
out_ps_y = 0.008370d
;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