fdetsch / MODIS

Download and processing framework for MODIS imagery. The package provides automated access to the global online data archives LP DAAC, LAADS and NSIDC as well as processing capabilities such as file conversion, mosaicking, subsetting and time series.
Other
57 stars 27 forks source link

skip invalid files in runGdal #99

Closed itati01 closed 4 years ago

itati01 commented 4 years ago

This pull request fixes the issue #93. If files are empty or otherwise corrupt and checkIntegrity == True (default), they will be silently skipped to avoid an error message in getSds.

fdetsch commented 4 years ago

Sorry for the delay. Can you maybe reproduce why getHdf()'s integrity check, which is being run directly before the code you inserted, does not capture that? I believe capturing corrupted .hdf files in there would be a slightly more stringent approach.

itati01 commented 4 years ago

Just tested it again with tileH=18 and tileV=4.

The fact that there is a corrupt (empty) file after a failed download is causing the issue in runGdal. However, it might be more appropriate to address it in getHDF() or even in ModisFileDownloader(). Actually, I don't know which process created but not removed the empty temp file (curl? wget?). Interestingly, it remains only for the last date.

fdetsch commented 4 years ago

Alright, thanks for having another look into this and issuing a PR. Seems like your solution should be the safest way to capture this for now.