Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.9]

### Fixed
- Removed unproductive `prep_rtc.validate_slc` function. Fixes https://github.com/ASFHyP3/hyp3-OPERA-RTC/issues/102.

## [0.1.8]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion requirements-static.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ruff==0.12.9
ruff==0.12.11
mypy==1.17.1
lxml-stubs
types-shapely
Expand Down
16 changes: 0 additions & 16 deletions src/hyp3_opera_rtc/prep_rtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,6 @@ def parse_response_for_burst_params(response: dict) -> tuple[str, str]:
return source_slc, f't{opera_burst_id.lower()}'


def validate_slc(granule: str) -> str:
pol = granule.split('_')[4][2:4]
if pol in {'VH', 'HV'}:
raise ValueError(f'{granule} has polarization {pol}, must be VV or HH')

response = query_cmr(
(('short_name', 'SENTINEL-1*'), ('options[short_name][pattern]', 'true'), ('granule_ur', f'{granule}-SLC'))
)
granule_exists = bool(response['items'])
if not granule_exists:
raise ValueError(f'Granule does not exist: {granule}')

return granule


def query_cmr(params: tuple) -> dict:
response = requests.get(CMR_URL, params=params)
response.raise_for_status()
Expand Down Expand Up @@ -157,7 +142,6 @@ def prep_rtc(
if co_pol_granule.endswith('BURST'):
source_slc, opera_burst_id = get_burst_params(co_pol_granule)
else:
validate_slc(co_pol_granule)
source_slc, opera_burst_id = co_pol_granule, None

safe_path = download_file(get_download_url(source_slc), directory=str(input_dir), chunk_size=10485760)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_prep_rtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,5 @@ def test_get_cross_pol_name():


@pytest.mark.skip
def test_get_granule_params():
def test_get_burst_params():
prep_rtc.get_burst_params('S1_146160_IW1_20241029T095958_VV_592B-BURST')
prep_rtc.validate_slc('S1A_IW_SLC__1SDV_20250704T124517_20250704T124544_059934_0771EA_C208')