Skip to content

Commit 8283200

Browse files
committed
skip execution of download cells, skip noaa-coastal-lidar
1 parent 3e546ad commit 8283200

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

docs/datasets/NCALM.ipynb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"outputs": [],
8888
"source": [
8989
"buffer_size = 0.01\n",
90-
"centroid = gf_ncalm.centroid\n",
90+
"centroid = gf_ncalm.centroid[0]\n",
9191
"mini_aoi = gpd.GeoDataFrame(\n",
9292
" geometry=[\n",
9393
" box(\n",
@@ -111,7 +111,6 @@
111111
"metadata": {},
112112
"outputs": [],
113113
"source": [
114-
"%%time\n",
115114
"da_ncalm_dtm = coincident.io.xarray.load_ncalm_dem(\n",
116115
" aoi=mini_aoi, product=\"dtm\", dataset_id=gf_ncalm[\"name\"].item()\n",
117116
")"
@@ -158,16 +157,16 @@
158157
"metadata": {},
159158
"outputs": [],
160159
"source": [
161-
"%%time\n",
160+
"# Uncomment to download clipped_WALL_GEG_1M_dtm.tif\n",
162161
"\n",
163-
"local_output_dir = \"/tmp/ncalm/\"\n",
162+
"# local_output_dir = \"/tmp/ncalm/\"\n",
164163
"\n",
165-
"coincident.io.download.download_ncalm_dem(\n",
166-
" aoi=mini_aoi,\n",
167-
" dataset_id=gf_ncalm[\"name\"].item(),\n",
168-
" product=\"dtm\",\n",
169-
" output_dir=local_output_dir,\n",
170-
")"
164+
"# coincident.io.download.download_ncalm_dem(\n",
165+
"# aoi=mini_aoi,\n",
166+
"# dataset_id=gf_ncalm[\"name\"].item(),\n",
167+
"# product=\"dtm\",\n",
168+
"# output_dir=local_output_dir,\n",
169+
"# )"
171170
]
172171
},
173172
{
@@ -185,7 +184,6 @@
185184
"metadata": {},
186185
"outputs": [],
187186
"source": [
188-
"%%time\n",
189187
"gf_ncalm_lpc_tiles = coincident.io.download.fetch_lpc_tiles(\n",
190188
" aoi=mini_aoi, dataset_id=gf_ncalm.name.item(), provider=\"NCALM\"\n",
191189
")"

docs/datasets/noaa-coastal-lidar.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"source": [
6565
"# Plot the entire footprint for this scene and a subset region\n",
6666
"buffer_size = 0.02\n",
67-
"centroid = gf_noaa.centroid\n",
67+
"centroid = gf_noaa.geometry.centroid[0]\n",
6868
"mini_aoi = gpd.GeoDataFrame(\n",
6969
" geometry=[\n",
7070
" box(\n",

docs/examples/dem_and_lpc.ipynb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@
290290
{
291291
"cell_type": "code",
292292
"execution_count": null,
293-
"metadata": {},
293+
"metadata": {
294+
"tags": [
295+
"skip-execution"
296+
]
297+
},
294298
"outputs": [],
295299
"source": [
296300
"coincident.io.download.download_neon_dem(\n",
@@ -305,7 +309,11 @@
305309
{
306310
"cell_type": "code",
307311
"execution_count": null,
308-
"metadata": {},
312+
"metadata": {
313+
"tags": [
314+
"skip-execution"
315+
]
316+
},
309317
"outputs": [],
310318
"source": [
311319
"# USGS_1M_13_x71y440_CO_CentralEasternPlains_2020_D20.tif:  236MB\n",

src/coincident/io/xarray.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,10 @@ def _fetch_noaa_tile_geometry(
588588
url: str,
589589
) -> tuple[str, Polygon, rasterio.crs.CRS]:
590590
# Open the raster header from S3 using rasterio.Env for proper configuration.
591-
with rasterio.Env(), rasterio.open(url) as src:
591+
with (
592+
rasterio.Env(GDAL_DISABLE_READDIR_ON_OPEN="EMPTY_DIR"),
593+
rasterio.open(url) as src,
594+
):
592595
bounds = src.bounds
593596
tile_crs = src.crs
594597
# Create a shapely bounding box polygon from the raster bounds.
@@ -732,7 +735,6 @@ def load_gliht(
732735
-----
733736
- Only HTTPS GeoTIFF assets with the "data" role are considered.
734737
- NASA Earthdata authentication is handled via environment variables and cookies.
735-
- The function expects the item to have a `datetime` attribute.
736738
"""
737739

738740
asset_items = item.assets
@@ -762,7 +764,6 @@ def load_gliht(
762764
GDAL_HTTP_COOKIEFILE="/tmp/cookies.txt",
763765
GDAL_HTTP_COOKIEJAR="/tmp/cookies.txt",
764766
):
765-
# Unfortunately NASA STAC doesn't have proj extension, so we have to open one...
766767
da = rioxarray.open_rasterio(
767768
data_assets[asset_keys_to_load[0]]["href"],
768769
masked=mask,

0 commit comments

Comments
 (0)