Skip to content

Commit

Permalink
update packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarshak committed Nov 21, 2023
1 parent 3233976 commit 4b8054e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions isce2_topsapp/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,19 @@ def record_params(*,
topsapp_params: dict) -> Path:

with h5py.File(netcdf_path, mode='a') as file:
file.attrs.update(**topsapp_params)
file.attrs.update(command_line_string=cmd_line_str)
file.attrs.update(aria_frame_id=topsapp_params['frame_id'])
file.attrs.update(topsapp_command_line_string=cmd_line_str)
file.attrs.update(isce2_topsapp_version=f'{isce2_topsapp.__version__}')
file['science/grids'].attrs.update(**topsapp_params)
return netcdf_path

def record_wkt_geometry(*,
netcdf_path: Path,
product_geometry_wkt: str
) -> Path:

with h5py.File(netcdf_path, mode='a') as file:
file.attrs.update(product_geometry_wkt=product_geometry_wkt)
return netcdf_path


Expand All @@ -313,6 +324,7 @@ def package_gunw_product(*,
extent: list,
topaspp_params: dict,
cmd_line_str: str,
product_geometry_wkt: str,
additional_2d_layers: list = None,
standard_product: bool = True,
additional_attributes: dict = None,
Expand Down Expand Up @@ -365,4 +377,6 @@ def package_gunw_product(*,
topsapp_params=topaspp_params,
cmd_line_str=cmd_line_str)
out_nc_file = record_stats(netcdf_path=out_nc_file)
out_nc_file = record_wkt_geometry(netcdf_path=out_nc_file,
product_geometry_wkt=product_geometry_wkt)
return out_nc_file

0 comments on commit 4b8054e

Please sign in to comment.