Skip to content
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.9"]
python-version: ["3.13", "3.9"]
name: pixi tests
steps:
- uses: actions/checkout@v4
Expand All @@ -22,9 +22,9 @@ jobs:
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Run tests
uses: prefix-dev/setup-pixi@v0.9.2
uses: prefix-dev/setup-pixi@v0.10.1
with:
pixi-version: v0.59.0
pixi-version: v0.76.1
cache: true
- run: pixi run test
- name: Run Coverage
Expand All @@ -42,6 +42,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Lint
uses: psf/black@stable
uses: psf/black@24.10.0
with:
options: "--check --verbose"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ build
.pixi
*.egg-info

# ignore .env files
.env


# ignore the version file made by setuptools_scm
dem_handler/_version.py
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ get_cop30_dem_for_bounds(
>>>WARNING:dem_handler.dem.cop_glo30:Provided bounds have very large longitude extent. If the shape crosses the antimeridian, reformat the bounds as : (178, -66, -179, -60)
```

### REMA timeseries

Passing `rema_year` parameter when querying REMA DEMs will switch the algorithm to query the timeseries DEMs.
If `rema_year` is passed as a string in `YYYY-MM` format, monthly DEMs will be used, otherwise, annual DEMs will be queried and used.
TO use REMA timeseries, a config file needs to be provided, or the algorithm will use the default file names `rema_series_config.json` in the data folder.



Expand Down
6 changes: 5 additions & 1 deletion dem_handler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
DATA_DIR = Path(__file__).parent / Path("data")
REMA_GPKG_PATH = DATA_DIR / Path("REMA_Mosaic_Index_v2.gpkg")
COP30_GPKG_PATH = DATA_DIR / Path("copdem_tindex_filename.gpkg")
REMA_SERIES_CONFIG_PATH = DATA_DIR / Path("rema_series_config.json")

REMAResolutions = typing.Literal[2, 10, 32]
REMAResolutions = typing.Literal[2, 10, 30, 32]
COPResolutions = typing.Literal[30]
ValidDEMResolutions = typing.Literal[REMAResolutions, COPResolutions]

REMABoundCheckSkipResolutions = typing.Literal[30]

REMA_VALID_RESOLUTIONS = typing.get_args(REMAResolutions)
COP_VALID_RESOLUTIONS = typing.get_args(COPResolutions)
REMA_BOUND_CHECK_SKIP_RESOLUTIONS = typing.get_args(REMABoundCheckSkipResolutions)
32 changes: 32 additions & 0 deletions dem_handler/data/rema_series_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"resolution": {
"30.1": "v0.5.1",
"30": "v0.5",
"32": "v0.4",
"10": "v0.4",
"2": "v0.4"
},
"aoi_name": {
"v0.4": "thwaites",
"v0.5": null,
"v0.5.1": null
},
"v0.4": {
"endpoint": "umn1.osn.mghpcc.org",
"s3_bucket": "cse-pgc-test",
"remote_folder": "digital_earth_antarctica/v0.4/mosaics",
"indexing_file": null
},
"v0.5": {
"endpoint": "umn1.osn.mghpcc.org",
"s3_bucket": "cse-pgc-test",
"remote_folder": "digital_earth_antarctica/v0.5",
"indexing_file": "MultiTemporalREMAIndex.parquet"
},
"v0.5.1": {
"endpoint": "umn1.osn.mghpcc.org",
"s3_bucket": "cse-pgc-test",
"remote_folder": "digital_earth_antarctica/v0.5.1",
"indexing_file": "MultiTemporalREMAIndexAnnual.parquet"
}
}
Loading
Loading