Commit cef922e2 authored by Alex Breuer's avatar Alex Breuer

Added elevation profile for 2D San Jacinto topography test case.

parent e1d7c7b2
[![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/)
To the extent possible under law, [Alexander Nikolas Breuer](http://dial3343.org) has waived all copyright and related or neighboring rights to the following work:
* `map.pdf`
* `poi.csv`
* `poi_lonlat.csv`
* `topo.nc`
* `topo_1d.csv`
* `topo_1d.geo`
This work is published from: United States.
# Meshes for the 2D San Jacinto benchmark
This directory contains the extracted 2D topo-file, the extracted surface profile and corresponding 2D meshes.
## Grid Projection and 2D cut
* Used grid:1/3rd arc-second Digital Elevation Models (DEMs) - USGS National Map 3DEP, https://www.sciencebase.gov/catalog/item/4f70aa9fe4b058caae3f8de5
Commands:
```
wget https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/ArcGrid/USGS_NED_13_n34w117_ArcGrid.zip
wget https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/ArcGrid/USGS_NED_13_n34w118_ArcGrid.zip
wget https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/ArcGrid/USGS_NED_13_n35w117_ArcGrid.zip
wget https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/13/ArcGrid/USGS_NED_13_n35w118_ArcGrid.zip
unzip USGS_NED_13_n34w117_ArcGrid.zip -d USGS_NED_13_n34w117_ArcGrid
unzip USGS_NED_13_n34w118_ArcGrid.zip -d USGS_NED_13_n34w118_ArcGrid
unzip USGS_NED_13_n35w117_ArcGrid.zip -d USGS_NED_13_n35w117_ArcGrid
unzip USGS_NED_13_n35w118_ArcGrid.zip -d USGS_NED_13_n35w118_ArcGrid
rm USGS_NED*.zip
mkdir grids
mv USGS_NED* grids
bash project_extract.sh 2>&1 | tee project_extract.sh.log
```
Remark: Only the final processed grid is shared.
# 1D Extraction
EDGE version:
```
commit 77895a4b528a2f9033c34c314096c62ff0d84b8f
Author: Alexander Nikolas Breuer <anbreuer@ucsd.edu>
Date: Thu Jul 12 14:31:30 2018 -0700
Added script for the extraction of elevation profiles from a DEM.
```
Command:
```
elevation_profile.py --dem topo.nc --left -17677.67 -17677.67 --right 17677.67 17677.67 --sponge 25000 --sampling 10 100 --depth -50000 --offset -50000 0 --output topo_1d.csv topo_1d.geo 2>&1 | tee elevation_profile.py.log
```
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
#!/bin/bash
##
# @file This file is part of EDGE.
#
# @author Alexander Breuer (anbreuer AT ucsd.edu)
#
# @section LICENSE
# Copyright (c) 2018, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @section DESCRIPTION
# Projects the data and extracts the region of interest
##
# points of interest (map plot)
poi=poi.csv
# region of interest cut from the mesh
region_cut=-50000/50000/-50000/50000
# sampling of the topo mesh (7.5m)
region_sampling=7.5/7.5
# projection center is the peak of San Jacinto
projection="tmerc/-116.679438/33.814712/0.9996"
grids=(grids/USGS_NED_13_n34w117_ArcGrid/grdn34w117_13/w001001.adf grids/USGS_NED_13_n34w118_ArcGrid/grdn34w118_13/w001001.adf grids/USGS_NED_13_n35w117_ArcGrid/grdn35w117_13/w001001.adf grids/USGS_NED_13_n35w118_ArcGrid/grdn35w118_13/w001001.adf)
# blend region
blend_region=-118.000509259/-115.999490741/32.9994907408/35.0005092593
# blend sampling
blend_sampling=9.25925925258e-05/9.25925925258e-05
# create work directory
tmp_dir=$(mktemp -d)
# blend the two grids together
gmt grdblend ${grids[*]} -R${blend_region} -I${blend_sampling} -G${tmp_dir}/blend.nc -V2
# project grid
gmt grdproject ${tmp_dir}/blend.nc -J${projection} -C -G${tmp_dir}/proj.nc -Fe -V2
# extract and resample mesh
gmt grdsample ${tmp_dir}/proj.nc -I${region_sampling} -R${region_cut} -Gtopo.nc -r -V2
# create point of interests
cat poi_lonlat.csv | cs2cs +proj=latlong +datum=WGS84 +to +proj=tmerc +units=m +axis=end +no_defs +ellps=GRS80 +k=0.9996 +lon_0=-116.679438 +lat_0=33.814712 -f %.12f > poi.csv
# generate a color table
gmt makecpt -Cglobe -T-10000/10000/100 > ${tmp_dir}/gmt_colors.cpt
# plot topography
gmt grdimage -JX6.5i -C${tmp_dir}/colors.cpt topo.nc -Ba -K -C${tmp_dir}/gmt_colors.cpt -V2 > ${tmp_dir}/map.ps
# add points of interests
gmt psxy ${poi} -Z -JX6.5i -R${region_cut} -Sd.25 -Gblack -O -K -V2 >> ${tmp_dir}/map.ps
gmt pstext ${poi} -Z -R${region_cut} -JX6.5i -F+f7+jL -D0.2/0c -O -K -V2 >> ${tmp_dir}/map.ps
# convert to pdf
ps2pdf ${tmp_dir}/map.ps map.pdf
# remove work directory
rm -r ${tmp_dir}
\ No newline at end of file
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment