-
Notifications
You must be signed in to change notification settings - Fork 9
Updates 2025 #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Updates 2025 #91
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f51fd0a
truncate orbit reference epoch to seconds precision; update ephemeris
gshiroma 9abd98f
replace `np.string_` with `np.bytes_`
gshiroma 079e3db
fix the assignment of the `orbitType` in the metadata
gshiroma 41110f0
remove option to change the geogrid upsampling
gshiroma 5057b7c
update dependency requirements
gshiroma 3df8d67
add fill value for byte datasets; handle multiband rasters
gshiroma ec04095
fix logic to save the layover/shadow mask
gshiroma 2937604
improve unit tests
gshiroma b6627c7
bump software version to v1.0.4
gshiroma 7d142a8
Merge branch 'opera-adt:main' into updates_2025
gshiroma be34866
Merge branch 'opera-adt:main' into updates_2025
gshiroma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| REPO=opera | ||
| IMAGE=rtc | ||
| TAG=final_1.0.3 | ||
| TAG=final_1.0.4 | ||
|
|
||
| echo "IMAGE is $REPO/$IMAGE:$TAG" | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,7 +181,7 @@ def save_hdf5_file(hdf5_obj, output_hdf5_file, clip_max, | |
| del hdf5_obj[h5_ds] | ||
| pol_list_s2 = np.array(pol_list, dtype='S2') | ||
| dset = hdf5_obj.create_dataset(h5_ds, data=pol_list_s2) | ||
| dset.attrs['description'] = np.string_( | ||
| dset.attrs['description'] = np.bytes_( | ||
| 'List of processed polarization layers') | ||
|
|
||
| # save geogrid coordinates | ||
|
|
@@ -284,21 +284,21 @@ def create_hdf5_file(product_id, output_hdf5_file, orbit, burst, cfg, | |
| ''' | ||
|
|
||
| hdf5_obj = h5py.File(output_hdf5_file, 'w') | ||
| hdf5_obj.attrs['Conventions'] = np.string_("CF-1.8") | ||
| hdf5_obj.attrs["contact"] = np.string_("[email protected]") | ||
| hdf5_obj.attrs["institution"] = np.string_("NASA JPL") | ||
| hdf5_obj.attrs["project"] = np.string_("OPERA") | ||
| hdf5_obj.attrs["reference_document"] = np.string_( | ||
| hdf5_obj.attrs['Conventions'] = np.bytes_("CF-1.8") | ||
| hdf5_obj.attrs["contact"] = np.bytes_("[email protected]") | ||
| hdf5_obj.attrs["institution"] = np.bytes_("NASA JPL") | ||
| hdf5_obj.attrs["project"] = np.bytes_("OPERA") | ||
| hdf5_obj.attrs["reference_document"] = np.bytes_( | ||
| "Product Specification Document for the OPERA Radiometric" | ||
| " Terrain-Corrected SAR Backscatter from Sentinel-1," | ||
| " JPL D-108758, Rev. Working Version 1, Aug 31, 2023") | ||
|
|
||
| # product type | ||
| product_type = cfg.groups.primary_executable.product_type | ||
| if product_type == STATIC_LAYERS_PRODUCT_TYPE: | ||
| hdf5_obj.attrs["title"] = np.string_("OPERA RTC-S1-STATIC Product") | ||
| hdf5_obj.attrs["title"] = np.bytes_("OPERA RTC-S1-STATIC Product") | ||
| else: | ||
| hdf5_obj.attrs["title"] = np.string_("OPERA RTC-S1 Product") | ||
| hdf5_obj.attrs["title"] = np.bytes_("OPERA RTC-S1 Product") | ||
|
|
||
| populate_metadata_group(product_id, hdf5_obj, burst, cfg, | ||
| processing_datetime, is_mosaic) | ||
|
|
@@ -310,23 +310,44 @@ def create_hdf5_file(product_id, output_hdf5_file, orbit, burst, cfg, | |
|
|
||
|
|
||
| def save_orbit(orbit, orbit_group, orbit_file_path): | ||
|
|
||
| # ensure that the orbit reference epoch has not fractional part | ||
| # otherwise, trancate it to seconds precision | ||
| orbit_reference_epoch = orbit.reference_epoch | ||
| if orbit_reference_epoch.frac != 0: | ||
| logger.warning('the orbit reference epoch is not an' | ||
| ' integer number. Truncating it' | ||
| ' to seconds precision and' | ||
| ' updating the orbit ephemeris' | ||
| ' accordingly.') | ||
|
|
||
| epoch = isce3.core.DateTime(orbit_reference_epoch.year, | ||
| orbit_reference_epoch.month, | ||
| orbit_reference_epoch.day, | ||
| orbit_reference_epoch.hour, | ||
| orbit_reference_epoch.minute, | ||
| orbit_reference_epoch.second) | ||
|
|
||
| orbit.update_reference_epoch(epoch) | ||
|
|
||
| orbit.save_to_h5(orbit_group) | ||
|
|
||
| # Add description attributes. | ||
| orbit_group["time"].attrs["description"] = np.string_( | ||
| orbit_group["time"].attrs["description"] = np.bytes_( | ||
| "Time vector record. This" | ||
| " record contains the time corresponding to position, velocity," | ||
| " acceleration records") | ||
| orbit_group["position"].attrs["description"] = np.string_( | ||
| orbit_group["position"].attrs["description"] = np.bytes_( | ||
| "Position vector" | ||
| " record. This record contains the platform position data with" | ||
| " respect to WGS84 G1762 reference frame") | ||
| orbit_group["velocity"].attrs["description"] = np.string_( | ||
| orbit_group["velocity"].attrs["description"] = np.bytes_( | ||
| "Velocity vector" | ||
| " record. This record contains the platform velocity data with" | ||
| " respect to WGS84 G1762 reference frame") | ||
| orbit_group.create_dataset( | ||
| 'referenceEpoch', | ||
| data=np.string_(orbit.reference_epoch.isoformat())) | ||
| data=np.bytes_(orbit.reference_epoch.isoformat())) | ||
|
|
||
| # Orbit source/type | ||
| orbit_type = 'Undefined' | ||
|
|
@@ -349,9 +370,12 @@ def save_orbit(orbit, orbit_group, orbit_file_path): | |
| orbit_type_list.append(orbit_type_individual) | ||
| orbit_type = '; '.join(orbit_type_list) | ||
|
|
||
| d = orbit_group.require_dataset("orbitType", (), "S64", | ||
| data=np.string_(orbit_type)) | ||
| d.attrs["description"] = np.string_( | ||
| if 'orbitType' in orbit_group: | ||
| del orbit_group['orbitType'] | ||
| d = orbit_group.create_dataset("orbitType", | ||
| data=np.bytes_(orbit_type)) | ||
|
|
||
| d.attrs["description"] = np.bytes_( | ||
| "Type of orbit file used in processing") | ||
|
|
||
|
|
||
|
|
@@ -1286,11 +1310,11 @@ def populate_metadata_group(product_id: str, | |
| continue | ||
| if isinstance(data, str): | ||
| dset = h5py_obj.create_dataset( | ||
| path_dataset_in_h5, data=np.string_(data)) | ||
| path_dataset_in_h5, data=np.bytes_(data)) | ||
| else: | ||
| dset = h5py_obj.create_dataset(path_dataset_in_h5, data=data) | ||
|
|
||
| dset.attrs['description'] = np.string_(description) | ||
| dset.attrs['description'] = np.bytes_(description) | ||
|
|
||
|
|
||
| def save_hdf5_dataset(ds_filename, h5py_obj, root_path, | ||
|
|
@@ -1331,7 +1355,11 @@ def save_hdf5_dataset(ds_filename, h5py_obj, root_path, | |
| logger.warning(f'WARNING Cannot open raster file: {ds_filename}') | ||
| return | ||
|
|
||
| ds_name = layer_hdf5_dict[layer_name] | ||
| if isinstance(layer_name, str): | ||
| ds_name = layer_hdf5_dict[layer_name] | ||
| else: | ||
| ds_name = [layer_hdf5_dict[l] for l in layer_name] | ||
|
|
||
| if long_name is not None: | ||
| description = long_name | ||
| else: | ||
|
|
@@ -1367,25 +1395,27 @@ def save_hdf5_dataset(ds_filename, h5py_obj, root_path, | |
| dset = h5py_obj.create_dataset(h5_ds, data=data) | ||
| dset.dims[0].attach_scale(yds) | ||
| dset.dims[1].attach_scale(xds) | ||
| dset.attrs['grid_mapping'] = np.string_("projection") | ||
| dset.attrs['grid_mapping'] = np.bytes_("projection") | ||
|
|
||
| if standard_name is not None: | ||
| dset.attrs['standard_name'] = np.string_(standard_name) | ||
| dset.attrs['standard_name'] = np.bytes_(standard_name) | ||
|
|
||
| if long_name is not None: | ||
| dset.attrs['long_name'] = np.string_(long_name) | ||
| dset.attrs['long_name'] = np.bytes_(long_name) | ||
|
|
||
| dset.attrs['description'] = np.string_(description) | ||
| dset.attrs['description'] = np.bytes_(description) | ||
|
|
||
| if units is not None: | ||
| dset.attrs['units'] = np.string_(units) | ||
| dset.attrs['units'] = np.bytes_(units) | ||
|
|
||
| if fill_value is not None: | ||
| dset.attrs.create('_FillValue', data=fill_value) | ||
| elif 'cfloat' in gdal.GetDataTypeName(raster.datatype()).lower(): | ||
| dset.attrs.create('_FillValue', data=np.nan + 1j * np.nan) | ||
| elif 'float' in gdal.GetDataTypeName(raster.datatype()).lower(): | ||
| dset.attrs.create('_FillValue', data=np.nan) | ||
| elif 'byte' in gdal.GetDataTypeName(raster.datatype()).lower(): | ||
| dset.attrs.create('_FillValue', data=255) | ||
|
|
||
| if stats_vector is not None: | ||
| stats_obj = stats_vector[band] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| VERSION='1.0.3' | ||
| VERSION='1.0.4' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to specify the isce3 version. By the way, would you let me know what isce3 version has the updated and fixed function for RTC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The RTC fix was merged to ISCE3 in (v0.24.4). So, I we probably can set it to
isce3>=0.24.4. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer
isce3 == 0.24.4, in case that isce3 may have some changes, which is not compatible with the current RTC workflow. By the way, I've not worked on0.24.4so far, and only tested with0.24.3. Let me check if this version works for the RTC as well. Or have you already tested it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, @oberonia78 . Since this line sets the isce3 version for the Docker, I think it's fine. Will update it. Thanks! In regards to testing, I tested this PR against the ISCE3
developbranch, but I learned recently thatv0.24.4is being created from a different fork. So, I should retest it withv0.24.4. Thanks for checking.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi both, I've noticed the isce3 versions haven't been bumped in the envrionment.yaml or the lockfile.lock. From what I can see the docker image references the lockfile, so on my build with gshiroma:updates_2025 I am still seeing
isce3==0.15.0. Do these also need to be updated?Apologies if I have missed something.
Quick test:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @abradley60 ! @oberonia78 is working on that. He's been implementing these updates in PR #93. However, we're continuing the discussion offline, and he may end up creating two branches: one that supports the latest ISCE3 version, likely to remain the main branch, and another that stays frozen on a specific ISCE3 version to be used in production. The production branch may not include the RTC delay fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks @gshiroma, clear to me.