Skip to content

Commit ec5248c

Browse files
gshiromagmgunter
authored andcommitted
Update runconfig fields from camel case to snake case (#911)
* update runconfig parameters from camel case to snake case * update runconfig parameters from camel case to snake case (2) * update runconfig parameters from camel case to snake case (3) * Update share/nisar/examples/alos_to_nisar_l0b.py Co-authored-by: Geoffrey M Gunter <[email protected]> * Update share/nisar/examples/alos2_to_nisar_l1.py Co-authored-by: Geoffrey M Gunter <[email protected]> Co-authored-by: Geoffrey M Gunter <[email protected]>
1 parent 2863c44 commit ec5248c

File tree

80 files changed

+1094
-1094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1094
-1094
lines changed

python/packages/nisar/workflows/bandpass_insar.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ def run(cfg: dict):
2020
run bandpass
2121
'''
2222
# pull parameters from cfg
23-
ref_hdf5 = cfg['InputFileGroup']['InputFilePath']
24-
sec_hdf5 = cfg['InputFileGroup']['SecondaryFilePath']
23+
ref_hdf5 = cfg['input_file_group']['input_file_path']
24+
sec_hdf5 = cfg['input_file_group']['secondary_file_path']
2525
freq_pols = cfg['processing']['input_subset']['list_of_frequencies']
2626
blocksize = cfg['processing']['bandpass']['lines_per_block']
2727
window_function = cfg['processing']['bandpass']['window_function']
2828
window_shape = cfg['processing']['bandpass']['window_shape']
2929
fft_size = cfg['processing']['bandpass']['range_fft_size']
30-
scratch_path = pathlib.Path(cfg['ProductPathGroup']['ScratchPath'])
30+
scratch_path = pathlib.Path(cfg['product_path_group']['scratch_path'])
3131

3232
# init parameters shared by frequency A and B
3333
ref_slc = SLC(hdf5file=ref_hdf5)
@@ -67,7 +67,7 @@ def run(cfg: dict):
6767
base_slc = sec_slc
6868

6969
# update reference SLC path
70-
cfg['InputFileGroup']['InputFilePath'] = ref_slc_output
70+
cfg['input_file_group']['input_file_path'] = ref_slc_output
7171
target_output = ref_slc_output
7272

7373
elif target == 'sec':
@@ -76,7 +76,7 @@ def run(cfg: dict):
7676
base_slc = ref_slc
7777

7878
# update secondary SLC path
79-
cfg['InputFileGroup']['SecondaryFilePath'] = sec_slc_output
79+
cfg['input_file_group']['secondary_file_path'] = sec_slc_output
8080
target_output = sec_slc_output
8181

8282
if os.path.exists(target_output):

python/packages/nisar/workflows/crossmul.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ def run(cfg: dict, output_hdf5: str = None, resample_type='coarse'):
2323
run crossmul
2424
'''
2525
# pull parameters from cfg
26-
ref_hdf5 = cfg['InputFileGroup']['InputFilePath']
27-
sec_hdf5 = cfg['InputFileGroup']['SecondaryFilePath']
26+
ref_hdf5 = cfg['input_file_group']['input_file_path']
27+
sec_hdf5 = cfg['input_file_group']['secondary_file_path']
2828
freq_pols = cfg['processing']['input_subset']['list_of_frequencies']
2929
flatten = cfg['processing']['crossmul']['flatten']
3030

3131
if flatten is not None:
3232
flatten_path = cfg['processing']['crossmul']['flatten']
3333

3434
if output_hdf5 is None:
35-
output_hdf5 = cfg['ProductPathGroup']['SASOutputFile']
35+
output_hdf5 = cfg['product_path_group']['sas_output_file']
3636

3737
# init parameters shared by frequency A and B
3838
ref_slc = SLC(hdf5file=ref_hdf5)

python/packages/nisar/workflows/crossmul_runconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def yaml_check(self, resample_type):
2121
'''
2222
error_channel = journal.error('CrossmulRunConfig.yaml_check')
2323

24-
scratch_path = self.cfg['ProductPathGroup']['ScratchPath']
25-
# if coregistered_slc_path not provided, use ScratchPath as source for coregistered SLCs
24+
scratch_path = self.cfg['product_path_group']['scratch_path']
25+
# if coregistered_slc_path not provided, use scratch_path as source for coregistered SLCs
2626
if 'coregistered_slc_path' not in self.cfg['processing']['crossmul']:
2727
self.cfg['processing']['crossmul']['coregistered_slc_path'] = scratch_path
2828

python/packages/nisar/workflows/dense_offsets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def run(cfg: dict):
2222
'''
2323

2424
# Pull parameters from cfg
25-
ref_hdf5 = cfg['InputFileGroup']['InputFilePath']
26-
sec_hdf5 = cfg['InputFileGroup']['SecondaryFilePath']
27-
scratch_path = pathlib.Path(cfg['ProductPathGroup']['ScratchPath'])
25+
ref_hdf5 = cfg['input_file_group']['input_file_path']
26+
sec_hdf5 = cfg['input_file_group']['secondary_file_path']
27+
scratch_path = pathlib.Path(cfg['product_path_group']['scratch_path'])
2828
freq_pols = cfg['processing']['input_subset']['list_of_frequencies']
2929
offset_params = cfg['processing']['dense_offsets']
3030

python/packages/nisar/workflows/dense_offsets_runconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def yaml_check(self):
2121
'''
2222

2323
error_channel = journal.error('DenseOffsetsRunConfig.yaml_check')
24-
scratch_path = self.cfg['ProductPathGroup']['ScratchPath']
24+
scratch_path = self.cfg['product_path_group']['scratch_path']
2525

2626
# If coregistered_slc_path is None, assume that we run dense_offsets
2727
# as part of insar.py. In this case, coregistered_slc_path comes

python/packages/nisar/workflows/focus.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_window(win: Struct, msg=''):
8888

8989

9090
def get_chirp(cfg: Struct, raw: Raw, frequency: str, tx: str):
91-
if cfg.DynamicAncillaryFileGroup.Waveform:
91+
if cfg.dynamic_ancillary_file_group.waveform:
9292
log.warning("Ignoring input waveform file. Using analytic chirp.")
9393
chirp = raw.getChirp(frequency, tx)
9494
log.info(f"Chirp length = {len(chirp)}")
@@ -110,9 +110,9 @@ def parse_rangecomp_mode(mode: str):
110110

111111
def get_orbit(cfg: Struct):
112112
log.info("Loading orbit")
113-
if cfg.DynamicAncillaryFileGroup.Orbit:
113+
if cfg.dynamic_ancillary_file_group.orbit:
114114
log.warning("Ignoring input orbit file. Using L0B orbits.")
115-
rawfiles = cfg.InputFileGroup.InputFilePath
115+
rawfiles = cfg.input_file_group.input_file_path
116116
if len(rawfiles) > 1:
117117
raise NotImplementedError("Can't concatenate orbit data.")
118118
raw = open_rrsd(rawfiles[0])
@@ -121,9 +121,9 @@ def get_orbit(cfg: Struct):
121121

122122
def get_attitude(cfg: Struct):
123123
log.info("Loading attitude")
124-
if cfg.DynamicAncillaryFileGroup.Pointing:
124+
if cfg.dynamic_ancillary_file_group.pointing:
125125
log.warning("Ignoring input pointing file. Using L0B attitude.")
126-
rawfiles = cfg.InputFileGroup.InputFilePath
126+
rawfiles = cfg.input_file_group.input_file_path
127127
if len(rawfiles) > 1:
128128
raise NotImplementedError("Can't concatenate attitude data.")
129129
raw = open_rrsd(rawfiles[0])
@@ -194,7 +194,7 @@ def get_dem(cfg: Struct):
194194
dem = isce3.geometry.DEMInterpolator(
195195
height=cfg.processing.dem.reference_height,
196196
method=cfg.processing.dem.interp_method)
197-
fn = cfg.DynamicAncillaryFileGroup.DEMFile
197+
fn = cfg.dynamic_ancillary_file_group.dem_file
198198
if fn:
199199
log.info(f"Loading DEM {fn}")
200200
dem.load_dem(fn)
@@ -286,7 +286,7 @@ def make_doppler(cfg: Struct, frequency='A'):
286286
dem = get_dem(cfg)
287287
opt = cfg.processing.doppler
288288
az = np.radians(opt.azimuth_boresight_deg)
289-
rawfiles = cfg.InputFileGroup.InputFilePath
289+
rawfiles = cfg.input_file_group.input_file_path
290290

291291
fc, lut = make_doppler_lut(rawfiles,
292292
az=az, orbit=orbit, attitude=attitude,
@@ -489,7 +489,7 @@ def get_range_deramp(grid: isce3.product.RadarGridParameters) -> np.ndarray:
489489
def focus(runconfig):
490490
# Strip off two leading namespaces.
491491
cfg = runconfig.runconfig.groups
492-
rawfiles = cfg.InputFileGroup.InputFilePath
492+
rawfiles = cfg.input_file_group.input_file_path
493493
if len(rawfiles) <= 0:
494494
raise IOError("need at least one raw data file")
495495
if len(rawfiles) > 1:
@@ -552,20 +552,20 @@ def focus(runconfig):
552552
polygon = isce3.geometry.get_geo_perimeter_wkt(ogrid["A"], orbit,
553553
zerodop, dem)
554554

555-
output_slc_path = os.path.abspath(cfg.ProductPathGroup.SASOutputFile)
555+
output_slc_path = os.path.abspath(cfg.product_path_group.sas_output_file)
556556

557557
output_dir = os.path.dirname(output_slc_path)
558558
os.makedirs(output_dir, exist_ok=True)
559559

560-
product = cfg.PrimaryExecutable.ProductType
560+
product = cfg.primary_executable.product_type
561561
log.info(f"Creating output {product} product {output_slc_path}")
562562
slc = SLC(output_slc_path, mode="w", product=product)
563563
slc.set_orbit(orbit) # TODO acceleration, orbitType
564564
if attitude:
565565
slc.set_attitude(attitude, orbit.reference_epoch)
566566
slc.copy_identification(raw, polygon=polygon,
567-
track=cfg.Geometry.RelativeOrbitNumber,
568-
frame=cfg.Geometry.FrameNumber,
567+
track=cfg.Geometry.relative_orbit_number,
568+
frame=cfg.Geometry.frame_number,
569569
start_time=ogrid["A"].sensing_datetime(0),
570570
end_time=ogrid["A"].sensing_datetime(ogrid["A"].length - 1))
571571

@@ -592,7 +592,7 @@ def focus(runconfig):
592592
**vars(cfg.processing.azcomp.geo2rdr))
593593

594594
# Scratch directory for intermediate outputs
595-
scratch_dir = os.path.abspath(cfg.ProductPathGroup.ScratchPath)
595+
scratch_dir = os.path.abspath(cfg.product_path_group.scratch_path)
596596
os.makedirs(scratch_dir, exist_ok=True)
597597

598598
# main processing loop
@@ -724,7 +724,7 @@ def main(argv):
724724
args = yaml_parser.parse()
725725
configure_logging()
726726
cfg = validate_config(load_config(args.run_config_path))
727-
echofile = cfg.runconfig.groups.ProductPathGroup.SASConfigFile
727+
echofile = cfg.runconfig.groups.product_path_group.sas_config_file
728728
if echofile:
729729
log.info(f"Logging configuration to file {echofile}.")
730730
dump_config(cfg, echofile)

python/packages/nisar/workflows/gcov.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ def run(cfg):
2727
'''
2828

2929
# pull parameters from cfg
30-
input_hdf5 = cfg['InputFileGroup']['InputFilePath']
31-
output_hdf5 = cfg['ProductPathGroup']['SASOutputFile']
30+
input_hdf5 = cfg['input_file_group']['input_file_path']
31+
output_hdf5 = cfg['product_path_group']['sas_output_file']
3232
freq_pols = cfg['processing']['input_subset']['list_of_frequencies']
3333
flag_fullcovariance = cfg['processing']['input_subset']['fullcovariance']
3434
flag_symmetrize_cross_pol_channels = \
3535
cfg['processing']['input_subset']['symmetrize_cross_pol_channels']
36-
scratch_path = cfg['ProductPathGroup']['ScratchPath']
36+
scratch_path = cfg['product_path_group']['scratch_path']
3737

3838
radar_grid_cubes_geogrid = cfg['processing']['radar_grid_cubes']['geogrid']
3939
radar_grid_cubes_heights = cfg['processing']['radar_grid_cubes']['heights']
4040

4141
# DEM parameters
42-
dem_file = cfg['DynamicAncillaryFileGroup']['DEMFile']
42+
dem_file = cfg['dynamic_ancillary_file_group']['dem_file']
4343
dem_margin = cfg['processing']['dem_margin']
4444
dem_interp_method_enum = cfg['processing']['dem_interpolation_method_enum']
4545

python/packages/nisar/workflows/gcov_runconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def load(self):
7676
Default margin as the length of 50 pixels
7777
(max of X and Y pixel spacing).
7878
'''
79-
dem_file = self.cfg['DynamicAncillaryFileGroup']['DEMFile']
79+
dem_file = self.cfg['dynamic_ancillary_file_group']['dem_file']
8080
dem_raster = isce3.io.Raster(dem_file)
8181
dem_margin = 50 * max([dem_raster.dx, dem_raster.dy])
8282
self.cfg['processing']['dem_margin'] = dem_margin

python/packages/nisar/workflows/geo2rdr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def run(cfg):
2121
'''
2222

2323
# Pull parameters from cfg dict
24-
sec_hdf5 = cfg['InputFileGroup']['SecondaryFilePath']
25-
dem_file = cfg['DynamicAncillaryFileGroup']['DEMFile']
26-
scratch_path = pathlib.Path(cfg['ProductPathGroup']['ScratchPath'])
24+
sec_hdf5 = cfg['input_file_group']['secondary_file_path']
25+
dem_file = cfg['dynamic_ancillary_file_group']['dem_file']
26+
scratch_path = pathlib.Path(cfg['product_path_group']['scratch_path'])
2727
freq_pols = cfg['processing']['input_subset']['list_of_frequencies']
2828
threshold = cfg['processing']['geo2rdr']['threshold']
2929
numiter = cfg['processing']['geo2rdr']['maxiter']

python/packages/nisar/workflows/geo2rdr_runconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def yaml_check(self):
1818
'''
1919
# Use scratch as topo_path if none given in YAML
2020
if 'topo_path' not in self.cfg['processing']['geo2rdr']:
21-
self.cfg['processing']['geo2rdr']['topo_path'] = self.cfg['ProductPathGroup']['ScratchPath']
21+
self.cfg['processing']['geo2rdr']['topo_path'] = self.cfg['product_path_group']['scratch_path']
2222

2323
# Check topo directory structure
2424
topo_path = self.cfg['processing']['geo2rdr']['topo_path']

0 commit comments

Comments
 (0)