diff --git a/CHANGELOG.md b/CHANGELOG.md index e669970..68b140d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/requirements-static.txt b/requirements-static.txt index 6d5c5e5..aa45271 100644 --- a/requirements-static.txt +++ b/requirements-static.txt @@ -1,4 +1,4 @@ -ruff==0.12.9 +ruff==0.12.11 mypy==1.17.1 lxml-stubs types-shapely diff --git a/src/hyp3_opera_rtc/prep_rtc.py b/src/hyp3_opera_rtc/prep_rtc.py index ccfcdd8..d3fd76b 100644 --- a/src/hyp3_opera_rtc/prep_rtc.py +++ b/src/hyp3_opera_rtc/prep_rtc.py @@ -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() @@ -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) diff --git a/tests/test_prep_rtc.py b/tests/test_prep_rtc.py index a1fe826..345d6ef 100644 --- a/tests/test_prep_rtc.py +++ b/tests/test_prep_rtc.py @@ -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')