MODIS data download

132 views
Skip to first unread message

Tonian Robinson

unread,
Jan 12, 2022, 8:52:15 AM1/12/22
to MAINSAR
I'm attempting to download the necessary MODIS data for my survey area using the function aps_modis(0,0) however the files won't download. 

I downloaded and sourced the path to the get_modis.py file from: https://github.com/jgomezdans/get_modis

But it seems to have different parameters compared to those specified in the TRAIN script: aps_modis_Python.m

Any pointers on how to move forward will be helpful!

Tonian Robinson

unread,
Jan 26, 2022, 4:06:25 PM1/26/22
to MAINSAR

Ended up downloading the HDF files manually from ladshttps://ladsweb.modaps.eosdis.nasa.gov

and used gdal to convert them to grd:
! gdalwarp -overwrite HDF4_EOS:EOS_SWATH:"MOD05_L2.A2015072.1545.061.2017320023931.hdf":mod05:Cloud_Mask_QA -of netCDF MODIS_20150313.nc
! gdal_translate MODIS_20150313.nc -of GMT Modis_20150313.grd

***NOT sure if we are to use the water vapor or cloud_mask sub-datasets in the HDF but since the aps_modis_SAR.m script specifies the cloud mask I stuck with it for now.


But for aps_mods(3,3) I keep getting this error:
Index in position 2 exceeds array bounds (must not exceed 2).
Error in aps_modis_InSAR (line 211)
d_modis_no_interp(:,k) = xyz_output_nointerp(:,3)
Error in aps_modis (line 116)
aps_modis_InSAR


I reran all the aps_modis steps while going through the MatLab scripts.

Here's what I found:

  1. after running step aps_modis(2,2) the *_ZWD_gauss.xyz, *_ZWD_nointrep.xyz, and *_ZWD_surf.xyz were empty (0 bytes)
  • solution(1): make sure GMT is added to PATH or download it and to PATH

  • solution(2): edit the Calculate wet delay section of the aps_modis_SAR.m file, the GMT syntax has changed. therefore the command strings in the script should start with '! GMT' i.e. instead of 'grdfilter' its '! gmt grdfilter' , there are about 9 commands to be updated. I also added '-echo' to my MatLab system function e.g. [a,b]=system(grdfil1_cmd, '-echo') to get GMT outputs to the terminal

My xyz files are no longer empty.
I however do get this warning from GMT:
Calculating wet delay... Warning: 'No data' fill value set to -32768
surface [WARNING]: Your grid dimensions are mutually prime. Convergence is very unlikely.
surface [WARNING]: 4213 unusable points were supplied; these will be ignored.
surface [WARNING]: You should have pre-processed the data with block-mean, -median, or -mode.
surface [WARNING]: Check that previous processing steps write results with enough decimals.
surface [WARNING]: Possibly some data were half-way between nodes and subject to IEEE 754 rounding.


Also posted on the TRAIN GitHub: https://github.com/dbekaert/TRAIN/issues/9

Reply all
Reply to author
Forward
0 new messages