diff --git a/python/packages/nisar/workflows/static.py b/python/packages/nisar/workflows/static.py index 5d66bbcdc..19869381c 100644 --- a/python/packages/nisar/workflows/static.py +++ b/python/packages/nisar/workflows/static.py @@ -110,20 +110,44 @@ def run_static_layers_workflow(config_file: os.PathLike | str) -> None: # parameters than the legacy `geo2rdr` routine that's used by most of the # workflow. Exposing both sets of parameters would introduce a lot of # additional bookkeeping for seemingly little benefit. - logger.info("Estimate maximum required radar grid spacing") radar_grid_params = processing_params["radar_grid"] look_side = radar_grid_params["look_side"] wavelength = radar_grid_params["wavelength"] - az_spacing, rg_spacing = \ - isce3.geometry.infer_radar_grid_spacing_from_geo_grid( - geo_grid=geo_grid, - dem=dem_interp, - orbit=orbit, - doppler=img_grid_doppler, - look_side=look_side, - wavelength=wavelength, - **radar_grid_params["spacing"], - ) + + radar_grid_spacing_params = radar_grid_params["spacing"] + az_spacing = radar_grid_spacing_params["az_spacing"] + rg_spacing = radar_grid_spacing_params["rg_spacing"] + pts_per_side = radar_grid_spacing_params["pts_per_side"] + + if az_spacing is not None and not (az_spacing > 0.0): + raise ValueError(f"Runconfig {az_spacing=}, must be > 0") + + if rg_spacing is not None and not (rg_spacing > 0.0): + raise ValueError(f"Runconfig {rg_spacing=}, must be > 0") + + logger.info("Estimate radar grid spacing") + if rg_spacing is not None: + logger.info(f' range spacing: {rg_spacing}') + if az_spacing is not None: + logger.info(f' azimuth time interval: {az_spacing}') + + if rg_spacing is None or az_spacing is None: + az_spacing_inferred, rg_spacing_inferred = \ + isce3.geometry.infer_radar_grid_spacing_from_geo_grid( + geo_grid=geo_grid, + dem=dem_interp, + orbit=orbit, + doppler=img_grid_doppler, + look_side=look_side, + wavelength=wavelength, + pts_per_side=pts_per_side + ) + if rg_spacing is None: + logger.info(f' inferred range spacing: {rg_spacing}') + rg_spacing = rg_spacing_inferred + if az_spacing is None: + logger.info(f' inferred azimuth time interval: {az_spacing}') + az_spacing = az_spacing_inferred # Compute a radar grid whose footprint on the ground encloses the geocoded # grid on which each output layer is defined. diff --git a/share/nisar/defaults/static.yaml b/share/nisar/defaults/static.yaml index 83077376f..456b64354 100644 --- a/share/nisar/defaults/static.yaml +++ b/share/nisar/defaults/static.yaml @@ -225,6 +225,16 @@ runconfig: # Defaults to 0.24. wavelength: 0.24 spacing: + # [OPTIONAL] Azimuth time interval, in seconds. Equivalent to the Pulse + # Repetition Interval (PRI). + # If not provided, it will be inferred from the specified geographic + # grid. If provided, must be a positive value. + az_spacing: + # [OPTIONAL] Slant-range spacing, in meters, of the radar grid. + # Must be a positive value. + # If not provided, it will be inferred from the specified geographic + # grid. If provided, must be a positive value. + rg_spacing: # [OPTIONAL] Side length of the NxN grid of samples used to estimate the # required radar grid pixel spacing necessary to avoid undersampling the # output geocoded grid. diff --git a/share/nisar/schemas/static.yaml b/share/nisar/schemas/static.yaml index 7d20a5670..d0110ac4f 100644 --- a/share/nisar/schemas/static.yaml +++ b/share/nisar/schemas/static.yaml @@ -94,6 +94,8 @@ radar_grid_options: bounding_box: include('radar_grid_bounding_box_options', required=False) radar_grid_spacing_options: + az_spacing: num(min=0.0, required=False) + rg_spacing: num(min=0.0, required=False) pts_per_side: int(min=2, required=False) radar_grid_bounding_box_options: