Skip to content

Commit

Permalink
🔀 Merge branch 'dependencies/intake_geopandas' (#190)
Browse files Browse the repository at this point in the history
Closes #190 Use intake-geopandas to load polygon data.
  • Loading branch information
weiji14 committed Nov 1, 2020
2 parents f0c8528 + 292edfc commit ff5e479
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 27 deletions.
8 changes: 3 additions & 5 deletions atlxi_lake.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"outputs": [],
"source": [
"# Read in Antarctic Drainage Basin Boundaries shapefile into a GeoDataFrame\n",
"ice_boundaries: gpd.GeoDataFrame = gpd.read_file(\n",
" filename=\"Quantarctica3/Glaciology/MEaSUREs Antarctic Boundaries/IceBoundaries_Antarctica_v2.shp\"\n",
"ice_boundaries: gpd.GeoDataFrame = (\n",
" deepicedrain.catalog.measures_antarctic_boundaries.read()\n",
")\n",
"drainage_basins: gpd.GeoDataFrame = ice_boundaries.query(expr=\"TYPE == 'GR'\")"
]
Expand Down Expand Up @@ -922,9 +922,7 @@
"outputs": [],
"source": [
"# Antarctic subglacial lake polygons with EPSG:3031 coordinates\n",
"antarctic_lakes: gpd.GeoDataFrame = gpd.read_file(\n",
" filename=\"antarctic_subglacial_lakes_3031.geojson\"\n",
")"
"antarctic_lakes: gpd.GeoDataFrame = deepicedrain.catalog.subglacial_lakes.read()"
]
},
{
Expand Down
8 changes: 3 additions & 5 deletions atlxi_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@

# %%
# Read in Antarctic Drainage Basin Boundaries shapefile into a GeoDataFrame
ice_boundaries: gpd.GeoDataFrame = gpd.read_file(
filename="Quantarctica3/Glaciology/MEaSUREs Antarctic Boundaries/IceBoundaries_Antarctica_v2.shp"
ice_boundaries: gpd.GeoDataFrame = (
deepicedrain.catalog.measures_antarctic_boundaries.read()
)
drainage_basins: gpd.GeoDataFrame = ice_boundaries.query(expr="TYPE == 'GR'")

Expand Down Expand Up @@ -347,9 +347,7 @@

# %%
# Antarctic subglacial lake polygons with EPSG:3031 coordinates
antarctic_lakes: gpd.GeoDataFrame = gpd.read_file(
filename="antarctic_subglacial_lakes_3031.geojson"
)
antarctic_lakes: gpd.GeoDataFrame = deepicedrain.catalog.subglacial_lakes.read()

# %%
# Choose one draining/filling lake
Expand Down
4 changes: 3 additions & 1 deletion deepicedrain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

Contents:

- :artificial_satellite: atlas_catalog.yaml - [intake](https://intake.readthedocs.io) data catalog for accessing ICESat-2 ATLAS datasets
- :artificial_satellite: atlas_catalog.yaml - [intake](https://intake.readthedocs.io) data catalog for accessing ICESat-2 ATLAS datasets and other Antarctic features
- icesat2atlasdownloader - Download Antarctic ICESat-2 ATLAS products from [NSIDC](https://nsidc.org/data/ICESat-2)
- icesat2atl06 - Reads in ICESat-2 ATL06 data into an xarray.Dataset
- icesat2dhdt - Preprocessed ICESat-2 height change over time (dhdt) data in a columnar format
- measures_antarctic_boundaries - MEaSUREs Antarctic Boundaries from Satellite Radar as a geopandas.GeoDataFrame
- subglacial_lakes - ICESat-2 detected Antarctic subglacial lake polygons as a geopandas.GeoDataFrame
- test_data - Sample ICESat-2 datasets for testing purposes

- :1234: deltamath.py - Mathematical functions for calculating delta changes of some physical unit
Expand Down
34 changes: 34 additions & 0 deletions deepicedrain/atlas_catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,40 @@ sources:
h_corr:
c: h_corr_{{cycle}}
cmap: gist_earth
measures_antarctic_boundaries:
description: 'MEaSUREs Antarctic Boundaries for IPY 2007-2009 from Satellite Radar, Version 2'
args:
storage_options:
simplecache:
cache_storage: Quantarctica3/Glaciology/MEaSUREs Antarctic Boundaries/
same_names: true
urlpath:
- simplecache::http://data.pgc.umn.edu/gis/packages/quantarctica/Quantarctica3/Glaciology/MEaSUREs%20Antarctic%20Boundaries/{{boundary_type}}_Antarctica_v2.dbf
- simplecache::http://data.pgc.umn.edu/gis/packages/quantarctica/Quantarctica3/Glaciology/MEaSUREs%20Antarctic%20Boundaries/{{boundary_type}}_Antarctica_v2.prj
- simplecache::http://data.pgc.umn.edu/gis/packages/quantarctica/Quantarctica3/Glaciology/MEaSUREs%20Antarctic%20Boundaries/{{boundary_type}}_Antarctica_v2.qix
- simplecache::http://data.pgc.umn.edu/gis/packages/quantarctica/Quantarctica3/Glaciology/MEaSUREs%20Antarctic%20Boundaries/{{boundary_type}}_Antarctica_v2.shp
- simplecache::http://data.pgc.umn.edu/gis/packages/quantarctica/Quantarctica3/Glaciology/MEaSUREs%20Antarctic%20Boundaries/{{boundary_type}}_Antarctica_v2.shx
use_fsspec: true
parameters:
boundary_type:
description: 'Antarctic Boundary type. Either Coastline, GroundingLine or IceBoundaries'
type: str
default: IceBoundaries
allowed: ["Coastline", "GroundingLine", "IceBoundaries"]
driver: intake_geopandas.geopandas.ShapefileSource
metadata: {}
subglacial_lakes:
description: 'Antarctic subglacial lake polygons detected from ICESat-2/ATLAS laser altimetry'
args:
urlpath: antarctic_subglacial_lakes_{{epsg}}.geojson
parameters:
epsg:
description: Coordinate Reference System as an EPSG code
type: int
default: 3031
allowed: [3031, 4326]
driver: intake_geopandas.geopandas.GeoJSONSource
metadata: {}
test_data:
description: 'Sample ICESat-2 datasets for testing purposes'
args:
Expand Down
2 changes: 2 additions & 0 deletions deepicedrain/tests/test_deepicedrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def test_deepicedrain_catalog():
"icesat2atlasdownloader",
"icesat2atl06",
"icesat2dhdt",
"measures_antarctic_boundaries",
"subglacial_lakes",
"test_data",
]
assert list(catalog) == catalog_entries
Expand Down
82 changes: 66 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ geopandas = "^0.8.1"
geoviews = "^1.8.1"
h5netcdf = "^0.8.1"
intake = {extras = ["dataframe", "server"], version = "^0.6.0"}
intake-geopandas = {git = "https://github.com/intake/intake_geopandas.git", rev = "e08c89bdd95216e9ff3f5bb6f8547799e7e7a463"}
intake-parquet = "^0.2.3"
intake-xarray = "^0.4.0"
jupyterlab = "^2.2.8"
Expand Down

0 comments on commit ff5e479

Please sign in to comment.