Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCTK code batch file #23

Closed
solldokung opened this issue Sep 18, 2019 · 5 comments
Closed

MCTK code batch file #23

solldokung opened this issue Sep 18, 2019 · 5 comments

Comments

@solldokung
Copy link

Dear dawhite

When i run idl code like this,

;Level 1B example
pro test_batch_modis_conversion_level_1b
compile_opt idl2

modis_l1b_file = 'D:\OmegaDrive\Thesis\SARA algorithm\011117\MOD02HKM.A2017305.0355.061.2017305175655.hdf'

;The specified output location MUST end in the appropriate path
;separator for your OS
output_location = 'E:\SARA'

output_rootname = 'TOA'

;Calibration method schema is:
;0 = Radiance / Emissivity, 1 = Reflectance / Emissivity, 2 = Radiance / Brightness Temp
calib_method = 2

;Output method schema is:
;0 = Standard, 1 = Projected, 2 = Standard and Projected
out_method = 1

output_projection = envi_proj_create(/geographic)

;do not put the bridge creation/destruction code inside a loop
bridges = mctk_create_bridges()

;Choosing linear interpolation
interpolation_method = 1

convert_modis_data, in_file=modis_l1b_file, out_path=output_location, $
out_root=output_rootname, out_method=out_method, $
interp_method=interpolation_method, $
out_proj=output_projection, calib_method=calib_method, $
sd_pos=[1,3], /no_msg, background=0.0, r_fid_array=r_fid_array, $
r_fname_array=r_fname_array, bridges=bridges, msg=msg

mctk_destroy_bridges, bridges

end

the result from this code does not appear, it provides data (.dat) like this photo. How to solve?
image

@dawhite
Copy link
Owner

dawhite commented Sep 18, 2019

You did not follow the directions about the output location. It should look like this:

output_location = 'E:\SARA'

You should also add this right before the end of the program so you can see informative error messages:

print, msg

Please read the user guide thoroughly, including the API documentation, before attempting to modify the sample code at the back.

@solldokung
Copy link
Author

thank you sir

@solldokung
Copy link
Author

I follow the user guide. but after i run the code, it show like this. How to do that? thank you
image

@dawhite
Copy link
Owner

dawhite commented Sep 18, 2019

You're encountering that error because you didn't modify the SD_POS array to work with the L1B product you're trying to process. If you look on Page 15 of the user guide, where SD_POS is described, you'll see that the array for MOD02HKM can only contain [0], [1], or [0,1]. There are only two datasets available to process. The example code you modified is for MOD021KM, whose array can have values up to 3 since there are four datasets available.

@solldokung
Copy link
Author

Thank you sir, now i can run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants