prevent apply_oe from considering target elevations < 0 km)
@@ -190,6 +190,13 @@ def main():
mean_latitude, mean_longitude, mean_elevation_km, elevation_lut_grid = \
get_metadata_from_loc(paths.loc_working_path, lut_params)
+ if args.emulator_base is not None:
+ if np.any(elevation_lut_grid < 0):
+ to_rem = elevation_lut_grid[elevation_lut_grid < 0].copy()
+ elevation_lut_grid[ elevation_lut_grid< 0] = 0
+ elevation_lut_grid = np.unique(elevation_lut_grid)
+ logging.info("Scene contains target lut grid elements < 0 km, and uses 6s (via sRTMnet). 6s does not "
+ f"support targets below sea level in km units. Setting grid points {to_rem} to 0.")
# Need a 180 - here, as this is already in MODTRAN convention
mean_altitude_km = mean_elevation_km + np.cos(np.deg2rad(180 - mean_to_sensor_zenith)) * mean_path_km
