NCALM#
This notebook illustrates search, directly loading DEMs, and downloading DEMs and LPCs for local processing
Dataset |
Alias |
Type |
Start |
End |
Extent |
Source |
|---|---|---|---|---|---|---|
NCALM LiDAR |
ncalm |
LiDAR |
2003-05-15 |
US Territories |
import coincident
import geopandas as gpd
from shapely.geometry import box
/home/docs/checkouts/readthedocs.org/user_builds/coincident/checkouts/stable/src/coincident/io/download.py:25: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)
from tqdm.autonotebook import tqdm
Search#
We’ll search for data in Washington State
aoi = gpd.read_file(
"https://raw.githubusercontent.com/unitedstates/districts/refs/heads/gh-pages/states/WA/shape.geojson"
)
aoi.plot();
gf_ncalm = coincident.search.search(
dataset="ncalm", intersects=aoi, datetime=["2018-09-19"]
)
print(f"Found {len(gf_ncalm)} NOAA scenes")
gf_ncalm.head(3)
Found 1 NOAA scenes
| id | name | title | start_datetime | end_datetime | geometry | collection | |
|---|---|---|---|---|---|---|---|
| 0 | OTLAS.072019.6339.1 | WA18_Wall | High-Resolution Mapping of Goat Rock Volcano, WA | 2018-09-19 | 2018-09-20 | POLYGON ((-121.46701 46.48376, -121.45914 46.4... | NCALM |
Get Data#
Warning
The NCALM DEMs are not tiled, so reading in the data and downloading takes a longer time
Stream#
First we’ll show how to stream a gridded DEM directly into Xarray
buffer_size = 0.01
centroid = gf_ncalm.centroid[0]
mini_aoi = gpd.GeoDataFrame(
geometry=[
box(
centroid.x - buffer_size,
centroid.y - buffer_size,
centroid.x + buffer_size,
centroid.y + buffer_size,
)
],
crs="EPSG:4326",
)
m = gf_ncalm.explore(color="black")
mini_aoi.explore(m=m, color="magenta")
/tmp/ipykernel_615/4228574894.py:2: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
centroid = gf_ncalm.centroid[0]
Make this Notebook Trusted to load map: File -> Trust Notebook
da_ncalm_dtm = coincident.io.xarray.load_ncalm_dem(
aoi=mini_aoi, product="dtm", dataset_id=gf_ncalm["name"].item()
)
da_ncalm_dtm
<xarray.DataArray 'elevation' (y: 2254, x: 1579)> Size: 14MB
array([[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]],
shape=(2254, 1579), dtype=float32)
Coordinates:
* y (y) float64 18kB 5.152e+06 5.152e+06 ... 5.15e+06 5.15e+06
* x (x) float64 13kB 6.226e+05 6.226e+05 ... 6.242e+05 6.242e+05
spatial_ref int64 8B 0
Attributes:
AREA_OR_POINT: Area
scale_factor: 1.0
add_offset: 0.0da_ncalm_dtm.coarsen(x=5, y=5, boundary="trim").mean().plot.imshow();
Download#
Note
You will not see a download progress bar for downloading NCALM DEMs as opposed to USGS and NEON provider DEMs
DEM#
# Uncomment to download clipped_WALL_GEG_1M_dtm.tif
# local_output_dir = "/tmp/ncalm/"
# coincident.io.download.download_ncalm_dem(
# aoi=mini_aoi,
# dataset_id=gf_ncalm["name"].item(),
# product="dtm",
# output_dir=local_output_dir,
# )
LPC Tiles#
gf_ncalm_lpc_tiles = coincident.io.download.fetch_lpc_tiles(
aoi=mini_aoi, dataset_id=gf_ncalm.name.item(), provider="NCALM"
)
gf_ncalm_lpc_tiles.head()
| name | url | geometry | |
|---|---|---|---|
| 0 | WA18_Wall/622000_5150000.laz | https://opentopography.s3.sdsc.edu/pc-bulk/WA1... | POLYGON ((-121.39723 46.49234, -121.39697 46.5... |
| 1 | WA18_Wall/622000_5151000.laz | https://opentopography.s3.sdsc.edu/pc-bulk/WA1... | POLYGON ((-121.39697 46.50133, -121.3967 46.51... |
| 2 | WA18_Wall/622000_5152000.laz | https://opentopography.s3.sdsc.edu/pc-bulk/WA1... | POLYGON ((-121.3967 46.51033, -121.39644 46.51... |
| 3 | WA18_Wall/623000_5150000.laz | https://opentopography.s3.sdsc.edu/pc-bulk/WA1... | POLYGON ((-121.3842 46.49216, -121.38394 46.50... |
| 4 | WA18_Wall/623000_5151000.laz | https://opentopography.s3.sdsc.edu/pc-bulk/WA1... | POLYGON ((-121.38394 46.50115, -121.38367 46.5... |
m = gf_ncalm.explore(color="black")
gf_ncalm_lpc_tiles.explore(m=m, color="magenta")
mini_aoi.explore(m=m, color="black")
Make this Notebook Trusted to load map: File -> Trust Notebook