Skip to content

Commit 14fc940

Browse files
Merge pull request #66 from forrestfwilliams/dem-url
Fix DEM URLs
2 parents ef06a81 + e802880 commit 14fc940

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,7 @@ tags
243243

244244
# Data
245245
src/multirtc/multimetric/*/
246+
247+
# pixi environments
248+
.pixi/*
249+
!.pixi/config.toml

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ 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.4]
10+
11+
### Fixed
12+
* Copernicus DEM for NISAR URLs to fix 404 errors.
13+
914
## [0.5.3]
1015

1116
### Changed

src/multirtc/dem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def get_dem_granule_url(lat: int, lon: int) -> str:
134134
lon_cardinal = 'W' if lon_tens < 0 else 'E'
135135

136136
prefix = f'{lat_cardinal}{np.abs(lat_tens):02d}/{lat_cardinal}{np.abs(lat_tens):02d}_{lon_cardinal}{np.abs(lon_tens):03d}'
137-
filename = f'DEM{lat_cardinal}{np.abs(lat):02d}_00_{lon_cardinal}{np.abs(lon):03d}_00_C01.tif'
137+
filename = f'DEM_{lat_cardinal}{np.abs(lat):02d}_00_{lon_cardinal}{np.abs(lon):03d}_00_C01.tif'
138138
file_url = f'{URL}/{prefix}/{filename}'
139139
return file_url
140140

tests/test_dem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def test_get_granule_url():
77
test_url = (
8-
'https://nisar.asf.earthdatacloud.nasa.gov/NISAR/DEM/v1.2/EPSG4326/S10/S10_W020/DEMS01_00_W001_00_C01.tif'
8+
'https://nisar.asf.earthdatacloud.nasa.gov/NISAR/DEM/v1.2/EPSG4326/S10/S10_W020/DEM_S01_00_W001_00_C01.tif'
99
)
1010
url = dem.get_dem_granule_url(-1, -1)
1111
assert url == test_url

0 commit comments

Comments
 (0)