Skip to content

Commit

Permalink
Merge pull request #477 from dbekaert/dev
Browse files Browse the repository at this point in the history
Release v0.4.1
  • Loading branch information
jhkennedy authored Jan 23, 2023
2 parents 2c450e0 + 43e0577 commit 48c69bd
Show file tree
Hide file tree
Showing 49 changed files with 672 additions and 698 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ on:

jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.7.0
with:
conda_env_name: RAiDER
python_version: '3.10'

call-docker-ghcr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.7.0
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
release_branch: main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ on:

jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.7.0
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 3 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ jobs:
with:
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@v2
- uses: mamba-org/provision-with-micromamba@v14
with:
mamba-version: "*"
python-version: '3.10'
activate-environment: RAiDER
environment-file: environment.yml
extra-specs: |
python=3.10
- name: install RAiDER
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:

jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.7.0
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.7.0
with:
release_prefix: RAiDER
develop_branch: dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.7.0
with:
user: dbekaert
email: bekaertdavid@gmail.com
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ 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.4.1]

### New/Updated Features
+ Reorder target points for intersection
+ Use exact coordinates of DEM to interpolate heights to target lat/lons
+ Support DEM interpolation to station file
+ Implement end-to-end test for intersection of cube with lat/lon files
+ Implement end-to-end test for calculation at stations delay
+ Update AOI to store the output directory so DEM is written to right place
+ `calcDelaysGUNW` will optionally download a GUNW product from AWS S3, process it, and upload a new version of the GUNW product in-place with the tropospheric correction layers added so that RAiDER can be used in ARIA GUNW production via HyP3. **Importantly**, tropospheric correction of GUNW products is still being activitely developed; this workflow, as well as the correction itself, is subject to change.

### Fixed
+ Package data is more explicitly handled so that it is included in the conda-forge build; see [#467](https://github.com/dbekaert/RAiDER/pull/467)

## [0.4.0]

Adding of new GUNW support to RAiDER. This is an interface delivery allowing for subsequent integration into HYP3 (input/output parsing is not expected to change; computed data is not yet verified).
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.profile && \

RUN python -m pip install --no-cache-dir /RAiDER/

ENTRYPOINT ["/usr/bin/bash"]
CMD ["-l"]
ENTRYPOINT ["/RAiDER/tools/RAiDER/etc/entrypoint.sh"]
CMD ["--help"]
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ or the current development version:
docker pull ghcr.io/dbekaert/raider:test
```

To run the container and jump into a bash shell inside:
To run `raider.py` inside the container:
```
docker run -it --rm ghcr.io/dbekaert/raider:latest
```
Expand All @@ -68,6 +68,11 @@ To mount your current directory inside the container so that files will be writt
docker run -it -v ${PWD}:/home/raider/work --rm ghcr.io/dbekaert/raider:latest
cd work
```
To jump into a `bash` shell inside the container:
```
docker run -it --rm --entrypoint /bin/bash ghcr.io/dbekaert/raider:latest -l
```

For more docker run options, see: <https://docs.docker.com/engine/reference/run/>.


Expand Down Expand Up @@ -98,7 +103,7 @@ For development, we recommend installing directly from source.
```
git clone https://github.com/dbekaert/RAiDER.git
cd RAiDER
conda create -f environment.yml
conda env create -f environment.yml
conda activate RAiDER
python -m pip install -e .
```
Expand Down
2 changes: 1 addition & 1 deletion docs/WeatherModels.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ERA-5/ERA-I products require access to the ESA Copernicus servers. GMAO and MERR
------

## 2. NOAA weather models (HRRR)
High-resolution rapid refresh (HRRR) weather model data products are generated by __[NOAA](https://rapidrefresh.noaa.gov/hrrr/)__ for the coninental US (CONUS) but not archived beyond three days. However, a public __[archive](home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_FAQ.html)__ is available at the University of Utah. This archive does not require a license agreement. This model has the highest spatial resolution available in RAiDER, with a horizontal grid spacing of about 3 km, and is provided in a Lambert conformal conic projection.
High-resolution rapid refresh (HRRR) weather model data products are generated by __[NOAA](https://rapidrefresh.noaa.gov/hrrr/)__ for the coninental US (CONUS) but not archived beyond three days. However, a public __[archive](https://home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_FAQ.html)__ is available at the University of Utah. This archive does not require a license agreement. This model has the highest spatial resolution available in RAiDER, with a horizontal grid spacing of about 3 km, and is provided in a Lambert conformal conic projection.

------

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- python>=3.8
- pip
# For running
- boto3
- cdsapi
- cfgrib
- cmake
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ repository = "https://github.com/dbekaert/RAiDER"
"generateGACOSVRT.py" = "RAiDER.models.generateGACOSVRT:main"

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.packages.find]
where = ["tools"]

[tool.setuptools.package-data]
"*" = ["*.yml", "*.yaml"]

[tool.isort]
known_first_party = "RAiDER"
multi_line_output = 5
Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
long: mark a test as a long
1 change: 1 addition & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ def pushd(dir):
TEST_DIR = test_dir.absolute()
DATA_DIR = os.path.join(TEST_DIR, "data")
GEOM_DIR = os.path.join(TEST_DIR, 'test_geom')
WM = 'GMAO'
1 change: 1 addition & 0 deletions test/_entrypoints.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


def test_raider__main__2(script_runner):
ret = script_runner.run('generateGACOSVRT.py')
assert ret.success
Expand Down
118 changes: 0 additions & 118 deletions test/cli/_argument_parsers.py

This file was deleted.

24 changes: 14 additions & 10 deletions test/test_GUNW.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import glob
import os
import shutil
import numpy as np
import pytest
import shutil
import subprocess
import xarray as xr

import numpy as np
import rasterio as rio
import xarray as xr

from test import TEST_DIR

WM = 'GMAO'

def test_GUNW():
## eventually to be implemented
# home = os.path.expanduser('~')
# netrc = os.path.join(home, '.netrc')
#
#
# ## make netrc
# if not os.path.exists(netrc):
# name, passw = os.getenv('URSname'), os.getenv('URSpass')
# cmd = f'echo "machine urs.earthdata.nasa.gov login {name} password {passw}" > ~/.netrc'
# subprocess.run(cmd.split())
#
#
# cmd = f'chmod 600 {netrc}'
# subprocess.run(cmd.split())
#
#
SCENARIO_DIR = os.path.join(TEST_DIR, "GUNW")
os.makedirs(SCENARIO_DIR, exist_ok=True)
GUNW = 'S1-GUNW-D-R-071-tops-20200130_20200124-135156-34956N_32979N-PP-913f-v2_0_4.nc'
Expand All @@ -36,7 +37,7 @@ def test_GUNW():
# proc = subprocess.run(cmd.split(), stdout=subprocess.PIPE, universal_newlines=True)
# assert np.isclose(proc.returncode, 0)

cmd = f'raider.py ++process calcDelaysGUNW {updated_GUNW} -m GMAO -o {SCENARIO_DIR}'
cmd = f'raider.py ++process calcDelaysGUNW -f {updated_GUNW} -m {WM} -o {SCENARIO_DIR}'
proc = subprocess.run(cmd.split(), stdout=subprocess.PIPE, universal_newlines=True)
assert np.isclose(proc.returncode, 0)

Expand All @@ -45,7 +46,9 @@ def test_GUNW():
transform = (0.1, 0.0, -119.35, 0, -0.1, 35.05)
group = 'science/grids/corrections/external/troposphere'
for v in 'troposphereWet troposphereHydrostatic'.split():
ds = rio.open(f'netcdf:{updated_GUNW}:{group}/{v}')
with rio.open(f'netcdf:{updated_GUNW}:{group}/{v}') as ds:
ds.crs.to_epsg()
assert np.isclose(ds.crs.to_epsg(), epsg), 'CRS incorrect'
assert ds.transform.almost_equals(transform), 'Affine Transform incorrect'

Expand All @@ -56,9 +59,10 @@ def test_GUNW():

crs = rio.crs.CRS.from_wkt(ds['crs'].crs_wkt)
assert np.isclose(crs.to_epsg(), epsg), 'CRS incorrect'


# Clean up files
shutil.rmtree(SCENARIO_DIR)
os.remove('GUNW_20200130-20200124.yaml')
return
[os.remove(f) for f in glob.glob(f'{WM}*')]
return
Loading

0 comments on commit 48c69bd

Please sign in to comment.