Skip to content

Commit

Permalink
Merge pull request #264 from asfadmin/bug-opera-s1-calibration-error
Browse files Browse the repository at this point in the history
BUGFIX: OPERA-S1-CALIBRATION Dataset Product Search Error
  • Loading branch information
SpicyGarlicAlbacoreRoll authored Jan 26, 2024
2 parents 867c8e5 + e88e16f commit 1758651
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-->
------
## [v.7.0.0](https://github.com/asfadmin/Discovery-asf_search/compare/v6.7.3...v.7.0.0)
## [v7.0.1](https://github.com/asfadmin/Discovery-asf_search/compare/v7.0.0...v7.0.1)
### Fixed
- Fixed `OPERA-S1-CALIBRATION` dataset products raising error during search.

------
## [v7.0.0](https://github.com/asfadmin/Discovery-asf_search/compare/v6.7.3...v7.0.0)
### Added
- `ASFProduct` now has 13 sublcasses for different sub-products that correspond to datasets:
- `S1Product`, `S1BurstProduct`, `OPERAS1Product`, `ARIAS1GUNWProduct`, `ALOSProduct`, `RADARSATProduct`, `AIRSARProduct`, `ERSProduct`, `JERSProduct`, `UAVSARProduct`, `SIRCProduct`, `SEASATProduct`, `SMAPProduct`
Expand Down
9 changes: 7 additions & 2 deletions asf_search/search/search_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,17 @@ def as_ASFProduct(item: Dict, session: ASFSession) -> ASFProduct:
product_type_key = _get_product_type_key(item)

# if there's a direct entry in our dataset to product type dict
if (subclass := dataset_to_product_types.get(product_type_key)) is not None:
subclass = dataset_to_product_types.get(product_type_key)
if subclass is not None:
return subclass(item, session=session)

# or if the key matches one of the shortnames in any of our datasets
for dataset, collections in dataset_collections.items():
if collections.get(product_type_key) is not None:
return dataset_to_product_types.get(dataset)(item, session=session)
subclass = dataset_to_product_types.get(dataset)
if subclass is not None:
return subclass(item, session=session)
break # dataset exists, but is not in dataset_to_product_types yet

return ASFProduct(item, session=session)

Expand All @@ -283,6 +287,7 @@ def _get_product_type_key(item: Dict) -> str:
dataset_to_product_types = {
'SENTINEL-1': ASFProductType.S1Product,
'OPERA-S1': ASFProductType.OPERAS1Product,
'OPERA-S1-CALIBRATION': ASFProductType.OPERAS1Product,
'SLC-BURST': ASFProductType.S1BurstProduct,

'ALOS': ASFProductType.ALOSProduct,
Expand Down

0 comments on commit 1758651

Please sign in to comment.