Skip to content

Commit 1028fcc

Browse files
authored
Merge pull request #722 from dbekaert/dev
RAiDER v0.5.5
2 parents 914f19c + aba06c7 commit 1028fcc

20 files changed

+264
-418
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
mamba activate RAiDER
7373
7474
COV_OPTIONS=`python -c "import importlib;print(*(' --cov='+p for p in importlib.util.find_spec('RAiDER').submodule_search_locations))"`
75-
pytest -m "not long" test/ ${COV_OPTIONS} --cov-report=
75+
coverage run -m pytest -m "not long" test/ ${COV_OPTIONS} --cov-report=
7676
7777
- run:
7878
name: Report coverage
@@ -86,8 +86,8 @@ jobs:
8686
8787
python -m pip install coveralls
8888
python .circleci/fix_coverage_paths.py .coverage ${PWD}/tools/RAiDER/
89-
coverage report -mi
90-
coveralls
89+
coverage report -mi --show-missing --data-file=.coverage
90+
coveralls --verbose
9191
fi
9292
9393
workflows:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
77
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [0.5.5]
10+
### Changed
11+
* `RAiDER.s1_orbits` now uses the `s1_orbits` package to retrieve orbit files from AWS, rather than using `hyp3lib`
12+
to retrieve orbit files from ASF and CDSE.
13+
* RAiDER no longer requires a `dataspace.copernicus.eu` .netrc entry or the `ESA_USERNAME`/`ESA_PASSWORD` environment variables.
14+
15+
### Fixed
16+
* [721](https://github.com/dbekaert/RAiDER/pull/721) - Fixed bug mixing station_delay_mean and station_delay_median
17+
* [715](https://github.com/dbekaert/RAiDER/pull/715) - Fixed the coverage test Github action and a timing issue with raiderCombine
18+
* [719](https://github.com/dbekaert/RAiDER/pull/719) - Fixed the automatic switch to HRRR-AK based on bounding box when generic HRRR is specified as the weather model
19+
* [720](https://github.com/dbekaert/RAiDER/pull/720) - Bug-fix to properly pass expected `user_title` argument through raiderStats function.
20+
921
## [0.5.4]
1022
### Changed
1123
* [701](https://github.com/dbekaert/RAiDER/pull/701) - Fixed a few path typos and handle some edge cases, add unit tests, lint project

environment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ dependencies:
2121
- ecmwf-api-client
2222
- h5netcdf
2323
- h5py
24-
- hyp3lib>=3,<4
2524
- herbie-data<2025.2.1
2625
- isce3>=0.15.0
2726
- jsonschema==3.2.0 # this is for ASF DAAC ingest schema validation
@@ -39,7 +38,7 @@ dependencies:
3938
- rioxarray
4039
- s3fs
4140
- scipy>1.10.0
42-
- sentineleof>=0.9.5
41+
- s1_orbits
4342
- shapely
4443
- tqdm
4544
- xarray
Binary file not shown.
Binary file not shown.

test/test_GUNW.py

Lines changed: 81 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
from RAiDER.aria.prepFromGUNW import (
2323
check_hrrr_dataset_availablity_for_s1_azimuth_time_interpolation,
2424
check_weather_model_availability,_get_acq_time_from_gunw_id,
25-
get_slc_ids_from_gunw,get_acq_time_from_slc_id
25+
get_slc_ids_from_gunw,get_acq_time_from_slc_id,identify_which_hrrr
2626
)
2727
from RAiDER.cli.raider import calcDelaysGUNW
28+
from RAiDER.models.hrrr import HRRR, HRRRAK
2829
from RAiDER.models.customExceptions import (
2930
NoWeatherModelData, WrongNumberOfFiles,
3031
)
@@ -260,16 +261,6 @@ def test_azimuth_timing_interp_against_center_time_interp(weather_model_name: st
260261
# https://github.com/dbekaert/RAiDER/blob/
261262
# f77af9ce2d3875b00730603305c0e92d6c83adc2/tools/RAiDER/aria/prepFromGUNW.py#L151-L200
262263

263-
# For prepGUNW
264-
side_effect = [
265-
# center-time
266-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
267-
# azimuth-time
268-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
269-
]
270-
mocker.patch('eof.download.download_eofs',
271-
side_effect=side_effect)
272-
273264
# These outputs are not needed since the orbits are specified above
274265
mocker.patch('RAiDER.s1_azimuth_timing.get_slc_id_from_point_and_time',
275266
side_effect=[
@@ -281,11 +272,11 @@ def test_azimuth_timing_interp_against_center_time_interp(weather_model_name: st
281272
])
282273

283274
mocker.patch(
284-
'RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids_hyp3lib',
275+
'RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids',
285276
side_effect=[
286277
# For azimuth time
287-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
288-
[Path(orbit_dict_for_azimuth_time_test['secondary']), Path(orbit_dict_for_azimuth_time_test['secondary'])],
278+
[str(orbit_dict_for_azimuth_time_test['reference'])],
279+
[str(orbit_dict_for_azimuth_time_test['secondary']), str(orbit_dict_for_azimuth_time_test['secondary'])],
289280
]
290281
)
291282

@@ -312,12 +303,9 @@ def test_azimuth_timing_interp_against_center_time_interp(weather_model_name: st
312303
# Calls 4 times for azimuth time and 4 times for center time
313304
assert RAiDER.processWM.prepareWeatherModel.call_count == 8
314305
# Only calls once each ref and sec list of slcs
315-
assert RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids_hyp3lib.call_count == 2
306+
assert RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids.call_count == 2
316307
# Only calls for azimuth timing: once for ref and sec
317308
assert RAiDER.s1_azimuth_timing.get_slc_id_from_point_and_time.call_count == 2
318-
## When we return to sentineleof
319-
# Once for center-time and azimuth-time each
320-
# assert eof.download.download_eofs.call_count == 2
321309

322310
for ifg_type in ['reference', 'secondary']:
323311
for var in ['troposphereHydrostatic', 'troposphereWet']:
@@ -441,16 +429,6 @@ def test_provenance_metadata_for_tropo_group(weather_model_name: str,
441429
out_path = shutil.copy(gunw_azimuth_test, tmp_path / out)
442430

443431
if interp_method == 'azimuth_time_grid':
444-
# For prepGUNW
445-
side_effect = [
446-
# center-time
447-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
448-
# azimuth-time
449-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
450-
]
451-
mocker.patch('RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids_hyp3lib',
452-
side_effect=side_effect)
453-
454432
# These outputs are not needed since the orbits are specified above
455433
mocker.patch('RAiDER.s1_azimuth_timing.get_slc_id_from_point_and_time',
456434
side_effect=[
@@ -462,11 +440,11 @@ def test_provenance_metadata_for_tropo_group(weather_model_name: str,
462440
])
463441

464442
mocker.patch(
465-
'RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids_hyp3lib',
443+
'RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids',
466444
side_effect=[
467445
# For azimuth time
468-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
469-
[Path(orbit_dict_for_azimuth_time_test['secondary']), Path(orbit_dict_for_azimuth_time_test['secondary'])],
446+
[str(orbit_dict_for_azimuth_time_test['reference'])],
447+
[str(orbit_dict_for_azimuth_time_test['secondary']), str(orbit_dict_for_azimuth_time_test['secondary'])],
470448
]
471449
)
472450
weather_model_path_dict = (weather_model_dict_for_center_time_test
@@ -543,16 +521,6 @@ def test_GUNW_workflow_fails_if_a_download_fails(gunw_azimuth_test, orbit_dict_f
543521
# Maybe better mocks could be done - but this is sufficient or simply a factory for this test given
544522
# This is reused so many times.
545523

546-
# For prepGUNW
547-
side_effect = [
548-
# center-time
549-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
550-
# azimuth-time
551-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
552-
]
553-
mocker.patch('eof.download.download_eofs',
554-
side_effect=side_effect)
555-
556524
# These outputs are not needed since the orbits are specified above
557525
mocker.patch('RAiDER.s1_azimuth_timing.get_slc_id_from_point_and_time',
558526
side_effect=[
@@ -564,11 +532,11 @@ def test_GUNW_workflow_fails_if_a_download_fails(gunw_azimuth_test, orbit_dict_f
564532
])
565533

566534
mocker.patch(
567-
'RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids_hyp3lib',
535+
'RAiDER.s1_azimuth_timing.get_orbits_from_slc_ids',
568536
side_effect=[
569537
# For azimuth time
570-
[Path(orbit_dict_for_azimuth_time_test['reference'])],
571-
[Path(orbit_dict_for_azimuth_time_test['secondary']), Path(orbit_dict_for_azimuth_time_test['secondary'])],
538+
[str(orbit_dict_for_azimuth_time_test['reference'])],
539+
[str(orbit_dict_for_azimuth_time_test['secondary']), str(orbit_dict_for_azimuth_time_test['secondary'])],
572540
]
573541
)
574542

@@ -665,3 +633,72 @@ def test_get_acq_time_invalid_slc_id():
665633
invalid_slc_id = "test/gunw_azimuth_test_data/S1B_OPER_AUX_POEORB_OPOD_20210731T111940_V20210710T225942_20210712T005942.EOF"
666634
with pytest.raises(ValueError):
667635
get_acq_time_from_slc_id(invalid_slc_id)
636+
637+
638+
def test_identify_which_hrrr_1():
639+
"""Tests if function identifies the correct HRRR file"""
640+
gunw_id = Path("test/gunw_azimuth_test_data/S1-GUNW-A-R-064-tops-20210723_20210711-015000-00119W_00033N-PP-6267-v2_0_6.nc")
641+
result = identify_which_hrrr(gunw_id)
642+
assert result == "HRRR"
643+
644+
645+
def test_identify_which_hrrr_2():
646+
"""Tests if function identifies the correct HRRR file"""
647+
gunw_id = Path("test/gunw_test_data/S1-GUNW-D-R-059-tops-20230320_20220418-180300-00179W_00051N-PP-c92e-v2_0_6.nc")
648+
result = identify_which_hrrr(gunw_id)
649+
assert result == "HRRRAK"
650+
651+
652+
def test_cast_to_hrrrak_1():
653+
"""Tests if function casts the HRRR file to HRRRAK"""
654+
ak_bounds = [51.0, 71.0, -175., -130.0]
655+
conus_bounds = [34.0,35.0, -91, -90.0]
656+
model = HRRR()
657+
model.checkValidBounds(conus_bounds)
658+
model.checkValidBounds(ak_bounds)
659+
assert model._Name == "HRRR-AK"
660+
661+
662+
def test_cast_to_hrrrak_2():
663+
"""Tests if function casts the HRRR file to HRRRAK"""
664+
ak_bounds = [51.0, 71.0, -175., -130.0]
665+
model = HRRRAK()
666+
model.checkValidBounds(ak_bounds)
667+
assert model._Name == "HRRR-AK"
668+
669+
670+
def test_cast_to_hrrrak_2b():
671+
"""Tests if function casts the HRRR file to HRRRAK"""
672+
ak_bounds = [60.0, 65.0, -150., -120.0]
673+
model = HRRRAK()
674+
model.checkValidBounds(ak_bounds)
675+
assert model._Name == "HRRR-AK"
676+
677+
678+
def test_cast_to_hrrrak_3():
679+
"""Tests if function casts the HRRR file to HRRRAK"""
680+
conus_bounds = [34.0,35.0, -91, -90.0]
681+
model = HRRR()
682+
model.checkValidBounds(conus_bounds)
683+
assert model._Name == "HRRR"
684+
685+
686+
def test_cast_to_hrrrak_4():
687+
"""Tests if function casts the HRRR file to HRRRAK"""
688+
europe_bounds = [-1, 1, -1, 1]
689+
model = HRRR()
690+
with pytest.raises(ValueError):
691+
model.checkValidBounds(europe_bounds)
692+
693+
694+
def test_identify_which_hrrr_invalid():
695+
"""Tests if function raises error for an invalid gunw_id format"""
696+
invalid_gunw_id = "dummy.nc"
697+
with pytest.raises(NoWeatherModelData):
698+
identify_which_hrrr(invalid_gunw_id)
699+
700+
701+
def test_check_hrrr_dataset_availablity_for_s1_azimuth_time_interpolation_again():
702+
"""Tests if function raises error for an invalid gunw_id format"""
703+
gunw_id = "S1-GUNW-D-R-044-tops-20240418_20240406-171649-00163W_00069N-PP-af6b-v3_0_1.nc"
704+
assert check_hrrr_dataset_availablity_for_s1_azimuth_time_interpolation(gunw_id, 'hrrrak') is True

test/test_downloadGNSS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_get_ID_invalid():
8181

8282

8383
def test_download_UNR(tmp_path):
84-
expected_path = "http://geodesy.unr.edu/gps_timeseries/trop/MORZ/MORZ.2020.trop.zip"
84+
expected_path = "https://geodesy.unr.edu/gps_timeseries/trop/MORZ/MORZ.2020.trop.zip"
8585
statID = "MORZ"
8686
year = 2020
8787
with pushd(tmp_path):

0 commit comments

Comments
 (0)