From d1a4e55e62f4949c1b1defb845153bbd5b685822 Mon Sep 17 00:00:00 2001 From: Simran S Sangha Date: Tue, 5 Mar 2024 21:08:50 -0800 Subject: [PATCH 1/4] Add option to toggle off inversion Add option to toggle inversion in the config function. By default set to true, like for unwrapping. This allows for more flexibility when running especially large-scale processing. --- src/dolphin/workflows/_cli_config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dolphin/workflows/_cli_config.py b/src/dolphin/workflows/_cli_config.py index e7757d0c3..e0673c698 100644 --- a/src/dolphin/workflows/_cli_config.py +++ b/src/dolphin/workflows/_cli_config.py @@ -36,6 +36,7 @@ def create_config( ntiles: tuple[int, int] = (1, 1), downsample_factor: tuple[int, int] = (1, 1), no_unwrap: bool = False, + no_inversion: bool = False, n_parallel_unwrap: int = 1, unwrap_method: UnwrapMethod = UnwrapMethod.SNAPHU, troposphere_files: Optional[list[str]] = None, @@ -102,6 +103,9 @@ def create_config( "n_parallel_jobs": n_parallel_unwrap, "run_unwrap": not no_unwrap, }, + timeseries_options={ + "run_inversion": not no_inversion, + }, correction_options={ "troposphere_files": troposphere_files, "tropo_date_fmt": tropo_date_fmt, From de487928cca8e2c3a0c51a3fe87a1f7c82b66d81 Mon Sep 17 00:00:00 2001 From: Simran S Sangha Date: Tue, 5 Mar 2024 21:09:51 -0800 Subject: [PATCH 2/4] Make downstream updates to displacement.py --- src/dolphin/workflows/displacement.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dolphin/workflows/displacement.py b/src/dolphin/workflows/displacement.py index e4f71da8b..715669770 100755 --- a/src/dolphin/workflows/displacement.py +++ b/src/dolphin/workflows/displacement.py @@ -234,8 +234,7 @@ def run( # ############################################## ts_opts = cfg.timeseries_options - # Skip if we only have 1 unwrapped, or if we didn't ask for inversion/velocity - if len(unwrapped_paths) > 1 and (ts_opts.run_inversion or ts_opts.run_velocity): + if not ts_opts.run_inversion: inverted_phase_paths = run_timeseries( ts_opts=ts_opts, unwrapped_paths=unwrapped_paths, @@ -371,7 +370,6 @@ def run_timeseries( unw_file_list=unwrapped_paths, reference=reference, output_dir=output_path, - num_threads=num_threads, ) else: logger.info( From e30a3a33a74678f46fc68436cbc6db69fe348f1b Mon Sep 17 00:00:00 2001 From: Simran S Sangha Date: Thu, 7 Mar 2024 14:46:09 -0800 Subject: [PATCH 3/4] Revert outdated disp changes --- src/dolphin/workflows/displacement.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dolphin/workflows/displacement.py b/src/dolphin/workflows/displacement.py index 715669770..eef5a5474 100755 --- a/src/dolphin/workflows/displacement.py +++ b/src/dolphin/workflows/displacement.py @@ -234,7 +234,8 @@ def run( # ############################################## ts_opts = cfg.timeseries_options - if not ts_opts.run_inversion: + # Skip if we only have 1 unwrapped, or if we didn't ask for inversion/velocity + if len(unwrapped_paths) > 1 and (ts_opts.run_inversion or ts_opts.run_velocity): inverted_phase_paths = run_timeseries( ts_opts=ts_opts, unwrapped_paths=unwrapped_paths, From f972c00c68514854dda709f841e607aadecf28cc Mon Sep 17 00:00:00 2001 From: Simran S Sangha Date: Thu, 7 Mar 2024 14:47:56 -0800 Subject: [PATCH 4/4] Revert another vestigial change to displacement --- src/dolphin/workflows/displacement.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dolphin/workflows/displacement.py b/src/dolphin/workflows/displacement.py index eef5a5474..e4f71da8b 100755 --- a/src/dolphin/workflows/displacement.py +++ b/src/dolphin/workflows/displacement.py @@ -371,6 +371,7 @@ def run_timeseries( unw_file_list=unwrapped_paths, reference=reference, output_dir=output_path, + num_threads=num_threads, ) else: logger.info(