From 60677d3553543e0978a6a7d683a44fd47c75685a Mon Sep 17 00:00:00 2001 From: jacquelynsmale Date: Thu, 9 Jan 2025 18:13:57 -0900 Subject: [PATCH] push progress while ASF search is done --- tools/RAiDER/cli/raider.py | 10 +++++++--- tools/RAiDER/cli/validators.py | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/RAiDER/cli/raider.py b/tools/RAiDER/cli/raider.py index 417e2782..e7e69813 100644 --- a/tools/RAiDER/cli/raider.py +++ b/tools/RAiDER/cli/raider.py @@ -619,7 +619,7 @@ def calcDelaysGUNW(iargs: Optional[list[str]] = None) -> Optional[xr.Dataset]: raise ValueError( 'GUNW product file could not be found at' f's3://{args.bucket}/{args.input_bucket_prefix}' ) - if args.weather_model == 'HRRR' and args.interpolate_time == 'azimuth_time_grid': + if (args.weather_model == 'HRRR' or args.weather_model == 'AUTO') and args.interpolate_time == 'azimuth_time_grid': gunw_id = args.file.name.replace('.nc', '') if not RAiDER.aria.prepFromGUNW.check_hrrr_dataset_availablity_for_s1_azimuth_time_interpolation(gunw_id): print( @@ -663,10 +663,14 @@ def calcDelaysGUNW(iargs: Optional[list[str]] = None) -> Optional[xr.Dataset]: # write delay cube (nc) to disk using config # return a list with the path to cube for each date - cube_filenames = calcDelays([str(path_cfg)]) + try: + cube_filenames = calcDelays([str(path_cfg)]) + except: + if args.weather_model == 'AUTO': + print('WARNING: error acquiring HRRR model. Nothing to do!') + return assert len(cube_filenames) == 2, 'Incorrect number of delay files written.' - # calculate the interferometric phase and write it out ds = RAiDER.aria.calcGUNW.tropo_gunw_slc( cube_filenames, diff --git a/tools/RAiDER/cli/validators.py b/tools/RAiDER/cli/validators.py index d94ee9ea..15bfcfd7 100755 --- a/tools/RAiDER/cli/validators.py +++ b/tools/RAiDER/cli/validators.py @@ -37,11 +37,11 @@ def parse_weather_model(weather_model_name: str, aoi: AOI) -> WeatherModel: weather_model_name = weather_model_name.upper().replace('-', '') - if weather_model_name == 'AUTO': - weather_model_name = 'HRRR' try: _, Model = get_wm_by_name(weather_model_name) except ModuleNotFoundError: + if weather_model_name == 'AUTO': + _, Model = get_wm_by_name('HRRR') raise NotImplementedError( f'Model {weather_model_name} is not yet fully implemented, please contribute!' )