{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Demo\n", "\n", "### Use nldi_xstool function `get_ext_bathy_xs` to extend measured ADCP gage cross-section to on-land topography\n", "\n", "* As the current format of the bathymetry csv file is in flux, the function assumes the bathy file has lat lon positions\n", " and elevation. The user can specify the headings in the file, for example below, 'Lon_NAD83'. \n", "* It is assumed that the bathy file positions are in EPSG:4326, but by specifying the EPSG code for the bathy data, it should handle different input projections.\n", "* Returned is a Geopandas Dataframe, using standard geopandas functions the dataframe can be reprojected and save to a file of users choice. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "True\n" ] } ], "source": [ "%matplotlib inline\n", "from pathlib import Path\n", "\n", "import matplotlib.pyplot as plt\n", "import py3dep\n", "from shapely.geometry import LineString\n", "\n", "from nldi_xstool.ancillary import get_ext_bathy_xs, query_dems_bbox\n", "\n", "file = Path(\"../../data/09152500_2019-10-25_bathymetry.csv\")\n", "print(file.exists())" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | spatial_ref | \n", "elevation | \n", "geometry | \n", "code | \n", "station | \n", "
|---|---|---|---|---|---|
| 0 | \n", "epsg:4326 | \n", "1417.116815 | \n", "POINT (-108.45195 38.98363) | \n", "0 | \n", "0.000000 | \n", "
| 1 | \n", "epsg:4326 | \n", "1417.121930 | \n", "POINT (-108.45194 38.98363) | \n", "0 | \n", "0.999999 | \n", "
| 2 | \n", "epsg:4326 | \n", "1417.125674 | \n", "POINT (-108.45193 38.98363) | \n", "0 | \n", "1.999999 | \n", "
| 3 | \n", "epsg:4326 | \n", "1417.135304 | \n", "POINT (-108.45192 38.98362) | \n", "0 | \n", "2.999998 | \n", "
| 4 | \n", "epsg:4326 | \n", "1417.139553 | \n", "POINT (-108.45191 38.98362) | \n", "0 | \n", "3.999997 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 145 | \n", "epsg:4326 | \n", "1416.964678 | \n", "POINT (-108.45033 38.98331) | \n", "0 | \n", "143.599675 | \n", "
| 146 | \n", "epsg:4326 | \n", "1417.221317 | \n", "POINT (-108.45032 38.98331) | \n", "0 | \n", "144.599676 | \n", "
| 147 | \n", "epsg:4326 | \n", "1417.341967 | \n", "POINT (-108.45031 38.98331) | \n", "0 | \n", "145.599676 | \n", "
| 148 | \n", "epsg:4326 | \n", "1417.402990 | \n", "POINT (-108.4503 38.9833) | \n", "0 | \n", "146.599677 | \n", "
| 149 | \n", "epsg:4326 | \n", "1417.440459 | \n", "POINT (-108.45029 38.9833) | \n", "0 | \n", "147.599678 | \n", "
150 rows × 5 columns
\n", "