If a file is missing in preprocess_single return None and just skip this file.
Tasks
[ ] Check if each file needed to run preprocess_single exists or not
[ ] If its missing return None
[ ] Maybe log why it failed - '{FILENAME} was missing from {EXPECTED_LOCATION}'
Relevant Code
# fn is a list of 3 file names typically is ['ms_filename','mask_filename','pan/swir filename']
# the snippet below is from the landsat 5 code section
fn_ms = fn[0]
fn_mask = fn[1]
# HERE IS WHERE IT SHOULD BE CHECKED IF ALL FILES IN FN EXIST OR NOT
# read ms bands
data = gdal.Open(fn_ms, gdal.GA_ReadOnly)
# if fn_ms doesn't exist this code will return None
georef = np.array(data.GetGeoTransform())
If a file is missing in
preprocess_single
return None and just skip this file.Tasks
preprocess_single
exists or notRelevant Code
Exceptions Caused by this issue