Skip to content

s1_static_layers

main()

Create the CLI and run the static layers workflow

Source code in src/compass/s1_static_layers.py
77
78
79
80
81
82
83
84
85
86
def main():
    """Create the CLI and run the static layers workflow"""
    # load arguments from command line
    parser = YamlArgparse()

    # Get a runconfig dict from command line arguments
    cfg = GeoRunConfig.load_from_yaml(parser.run_config_path,
                                      workflow_name='s1_cslc_geo')

    run(cfg)

run(cfg)

Run static layers workflow (i.e., generate static layers, geocode them, create product HDF5) with user-defined args stored in dictionary runconfig cfg

Parameters:

Name Type Description Default
cfg GeoRunConfig

GeoRunConfig object with user runconfig options

required
Source code in src/compass/s1_static_layers.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def run(cfg: GeoRunConfig):
    '''
    Run static layers workflow (i.e., generate static layers,
    geocode them, create product HDF5) with user-defined
    args stored in dictionary runconfig *cfg*

    Parameters
    ---------
    cfg: GeoRunConfig
        GeoRunConfig object with user runconfig options
    '''

    module_name = get_module_name(__file__)
    info_channel = journal.info(f"{module_name}.run")
    info_channel.log(f"Starting {module_name} burst")

    # Start tracking processing time
    t_start = time.perf_counter()

    for burst_id, bursts in bursts_grouping_generator(cfg.bursts):
        burst = bursts[0]

        date_str = burst.sensing_start.strftime("%Y%m%d")

        info_channel.log(f'Starting geocoding of {burst_id} for {date_str}')

        # Generate required static layers
        rdr2geo_cfg = _make_rdr2geo_cfg(cfg.yaml_string)
        s1_rdr2geo.run(rdr2geo_cfg, burst, save_in_scratch=True)
        s1_geocode_metadata.run(cfg, burst, fetch_from_scratch=True)

    dt = get_time_delta_str(t_start)
    info_channel.log(f"{module_name} burst successfully ran in {dt} (hr:min:sec)")