Skip to content

Commit

Permalink
Merge pull request #11 from trchudley/loadmosaic_windows_fix
Browse files Browse the repository at this point in the history
`load` module windows fix
  • Loading branch information
trchudley authored Jun 13, 2024
2 parents 2c18d45 + 5a559db commit 0e6749a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/appendix/version_updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Version | Date | Notes |
| ------- | ---- | ----- |
| 0.8.2 | June 2024 | Bug fix to address fail loading of mosaics on Windows systems |
| 0.8.1 | June 2024 | Minor modification to hillshade script to allow for MacGregor _et al._ (2024) flow-aware hillshade. Supplementary notebook available in GitHub `notebooks` directory. |
| 0.8.0 | May 2024 | Iceberg detection now corrects for sea surface; final additions to documentation before public conda/pip release.
| 0.7.0 | March 2024 | Minor bug fixes and more detailed docstrings to support readthedocs |
Expand Down
2 changes: 1 addition & 1 deletion src/pdemtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

from ._accessor import DemAccessor

__version__ = "0.8.1"
__version__ = "0.8.2"

__all__ = ["search", "DemAccessor"]
22 changes: 12 additions & 10 deletions src/pdemtools/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,25 @@ def from_id(

if preview == True:
browser_prefix = "https://polargeospatialcenter.github.io/stac-browser/#/external/pgc-opendata-dems.s3.us-west-2.amazonaws.com"
preview_fpath = os.path.join(
browser_prefix, dataset, "strips", version, "2m", geocell, f"{dem_id}.json"
preview_fpath = (
f"{browser_prefix}/{dataset}/strips/{version}/2m/{geocell}/{dem_id}.json"
)
return preview_fpath

# Construct DEM fpath
dem_fpath = os.path.join(
bucket, dataset, "strips", version, "2m", geocell, f"{dem_id}_dem.tif"
)
dem_fpath = f'{bucket}/{dataset}/"strips"/{version}/2m/{geocell}/{dem_id}_dem.tif'
# dem_fpath = os.path.join(
# bucket, dataset, "strips", version, "2m", geocell, f"{dem_id}_dem.tif"
# )

# Construct bitmask fpath, if required
if bitmask == True:
bitmask_fpath = os.path.join(
bucket, dataset, "strips", version, "2m", geocell, f"{dem_id}_bitmask.tif"
bitmask_fpath = (
f'{bucket}/{dataset}/"strips"/{version}/2m/{geocell}/{dem_id}_bitmask.tif'
)
# bitmask_fpath = os.path.join(
# bucket, dataset, "strips", version, "2m", geocell, f"{dem_id}_bitmask.tif"
# )
else:
bitmask_fpath = None

Expand Down Expand Up @@ -396,6 +400,4 @@ def _aws_link(
raise ValueError(f"Input `resolution` must be one of ['2m', '10m', '32m']")

# Return appropriate filepath.
return os.path.join(
prefix, dataset, "mosaics", version, resolution, row.supertile, fname
)
return f"{prefix}/{dataset}/mosaics/{version}/{resolution}/{row.supertile}/{fname}"

0 comments on commit 0e6749a

Please sign in to comment.