{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Alinging raster DEM to sparse altimetry points \n", "#### Adapted from the [ASP Documentation](https://stereopipeline.readthedocs.io/en/latest/tools/pc_align.html#pc-align)\n", "##### For best results, first run the `example-dem_corigestration.ipynb` tutorial, and follow the notes there. This will make interpreting the contents of the current tutorial easier :) " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import requests\n", "import numpy as np\n", "import pandas as pd\n", "import os,sys,glob\n", "import matplotlib.pyplot as plt\n", "import geopandas as gpd\n", "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", "from distutils.spawn import find_executable\n", "import geopandas as gpd\n", "import dask\n", "import zipfile\n", "from pyproj import Proj, transform\n", "import subprocess\n", "from fetch_dem import opentopo_utils\n", "import asp_binder_utils as asp_utils\n", "import xyzservices\n", "import rioxarray\n", "import rasterio\n", "from shapely.geometry import box\n", "from sliderule import sliderule, icesat2\n", "import contextily as ctx\n", "\n", "import xyzservices" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Universal settings" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "terrain_map = xyzservices.providers.Esri.WorldImagery() #Used to render basemap\n", "#verbose = False # Will only print the bash commands and whether the process ran sucessfully or not\n", "verbose = True # will print all the logs printed by ASP\n", "alignment_algorithm = 'point-to-point' # suggested to use point-to-point if the terrain variability is low (more flat terrain cases) and when using altimetry points\n", "max_displacement = 40 #you might have to play with this to adapt to different datasets\n", "tsrs = 'EPSG:32611' # input projection\n", "tr = 30 #DEM resolution" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Study Site\n", "* Our study area for this tutorial located in Providence Mountains, California, USA.\n", "* The site has limited seasonal elevation change, and limited vegetation presence.\n", "* We provide the study area extent in the github repository through this geojson file (`providence_mountains_small.geojson`)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "