Restarting Notebooks for 13.0

intro16
Angelos Tzotsos 2019-08-02 12:08:02 +03:00
parent 155abc53c2
commit 8c1f42cd81
205 changed files with 0 additions and 43853 deletions

View File

@ -1,885 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Access to Geospatial data](../Access to Geospatial data)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 22.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">GDAL/OGR Quickstart</span></h1></b>\n",
"\n",
"The first Notebook is dedicated to the use of the Geospatial Data Abstraction Library (**GDAL**) from the bash command line. GDAL is a powerful translator library for raster and vector geospatial data formats. It presents a single raster abstract data model and vector abstract data model for all supported formats.\n",
"\n",
"This Notebook is derived from the original [GDAL-OGR quickstart](http://localhost/osgeolive/en/quickstart/gdal_quickstart.html) adapted to run interactively in an IPython notebook and is composed by two main parts **GDAL** (to handle raster data) and **OGR** (to work with vector data)\n",
"\n",
"<h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">GDAL</span></h1>\n",
"\n",
"* Explore your image data with [```gdalinfo```](#gdalinfo)\n",
"* Format translations, Rescaling, Resizing, Splitting with [```gdal_translate```](#gdal_translate)\n",
" * [```Format translations```](#Format-translation)\n",
" * [```Resizing```](#Resizing)\n",
" * [```Rescaling```](#Rescaling)\n",
" * [```Splitting```](#Splitting)\n",
"* Reproject with [```gdalwarp```](#Reprojecting)\n",
"* Raster tileindex with [```gdaltindex```](#gdaltindex)\n",
"* Image Mosaic with ```gdal_warp``` or [```gdal_merge.py```](#Mosaicking)\n",
"\n",
"<h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">OGR </span></h1>\n",
"* get information about your data with [```ogrinfo```](#ogrinfo)\n",
"* use [```ogr2ogr```](#ogr2ogr) to transform your data to other formats"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Get to know GDAL</span></h1></b> \n",
"\n",
"\n",
"You will find the demo data at ```/usr/local/share/data```. We want to have a look at the [naturalearth dataset](http://localhost/osgeolive/en/overview/naturalearth_overview.html) data in this quickstart. We want to work with a copy of the data. So the first step is to copy the data to your home directory."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.core.display import Image"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Set the PATH to the natural earth dataset used in this notebook**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"DATADIR='/home/user/data/natural_earth2'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"OUTPUTDIR='/home/user/jupyter/notebooks/GSoC-2015/OUTPUT/'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">gdalinfo</span></h1></b> \n",
"\n",
"<b><h2 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">get information about the raster data</span></h2></b> "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo --help-general"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo {DATADIR}/HYP_50M_SR_W.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"Note:\n",
"* Driver is “GTiff/GeoTIFF”\n",
"* Size is 10800x5400\n",
"* 3 Bands of type Byte.\n",
"* Coordinates\n",
"* Coordinate system is World Geodetic System 84"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Listing available Drivers</span></h1></b> "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First get to know your drivers. The ```--formats``` commandline switch of gdalinfo can be used to see a list of available format drivers."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"List all the available formats:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo --formats"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Each format reports if it is:\n",
"* read only (ro),\n",
"* read/write (rw) or\n",
"* read/write/update (rw+)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It is also possible to ask for specific formats details:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo --format GTiff"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">gdal_translate</span></h1></b> \n",
"\n",
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Format translation</span></h1></b> \n",
"\n",
"Translations are accomplished with the gdal_translate command. The default output format is GeoTIFF. The ```-of``` flag is used to select an output format and the ```-co``` flag is used to specify a creation option:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The web browser is not happy with tif files so to have a quick look at the image we convert it to a web friendly format (JPG) using ```gdal_translate``` (this requires few seconds)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -of JPEG -co QUALITY=10 {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/HYP_50M_SR_W.jpg"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Image Display</span></h1></b> "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'/HYP_50M_SR_W.jpg')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The -ot switch can be used to alter the output data type."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -ot Int16 {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/HYP_50M_SR_W_Int16.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use gdalinfo to verify data type."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo {DATADIR}/HYP_50M_SR_W.tif | grep Band"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo {OUTPUTDIR}/HYP_50M_SR_W_Int16.tif | grep Band"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Resizing</span></h1></b> \n",
"\n",
"The -outsize switch can be used to set the size of the output file."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -outsize 50% 50% {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/HYP_50M_SR_W_small.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use gdalinfo to verify the size."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo {DATADIR}/HYP_50M_SR_W.tif | grep Size"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo {OUTPUTDIR}/HYP_50M_SR_W_small.tif | grep Size"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Rescaling</span></h1></b> "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The -scale switch can be used to rescale the data range of a given image. Explicit control of the input and output ranges is also available. The gdalinfo ```-mm``` switch can be used to see pixel min/max values.\n",
"\n",
"The output will display a computed Min/Max value for each band in the raster imput (3 band in our case)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo -mm {OUTPUTDIR}/HYP_50M_SR_W_small.tif | grep Min/Max"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To rescale a specific band we can use the \"-scale_bn\" syntax where bn is a band number (e.g. \"-scale_2\" for the 2nd band of the output dataset), in the example below we will rescale the 3 bands of the HYP_50M_SR_W GeoTiff to be in the range 0-255 :"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -scale_1 62.000 255.000 0 255.000 \\\n",
" -scale_2 85.000 255.000 0 255.000 \\\n",
" -scale_3 79.000 255.000 0 255.000 \\\n",
" {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/HYP_50M_SR_W_scaled.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check the results with ```gdalinfo``` :"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo -mm {OUTPUTDIR}/HYP_50M_SR_W_scaled.tif | grep Min/Max"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's convert the scaled output to JPG for a quick display, notice the color rearrangement."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -of JPEG -co QUALITY=40 {OUTPUTDIR}/HYP_50M_SR_W_scaled.tif {OUTPUTDIR}/HYP_50M_SR_W_scaled.jpg"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'/HYP_50M_SR_W_scaled.jpg')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"compare with [original image](#Image-Display)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Splitting</span></h1></b> "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Lets split our image into two with ```-srcwin``` which makes a copy based on pixel/line location (xoff yoff xsize ysize). You also could use ```-projwin``` and define the corners in georeferenced coordinates (ulx uly lrx lry)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -srcwin 0 0 5400 5400 {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/west.tif\n",
"!gdal_translate -srcwin 5400 0 5400 5400 {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/east.tif"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -of JPEG -co QUALITY=40 {OUTPUTDIR}/east.tif {OUTPUTDIR}/east.jpg\n",
"!gdal_translate -of JPEG -co QUALITY=40 {OUTPUTDIR}/west.tif {OUTPUTDIR}/west.jpg"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">gdalwarp</span></h1></b> \n",
"\n",
"\n",
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Reprojecting</span></h1></b> \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For this process we assume that HYP_50M_SR_W.tif has been properly created with bounds. As we saw before with gdalinfo HYP_50M_SR_W has a proper coordinate system set. \n",
"\n",
"If the tif file we want work on doesn't have proper projection information (wich is the case in most *.tif* files when associated with a world file *.tfw*) it is possible to assign a coordinate system to the image with ```gdal_translate``` and the flag ```-a_srs``` e.g :\n",
"\n",
" gdal_translate -a_srs WGS84 HYP_50M_SR_W.tif HYP_50M_SR_W_4326.tif\n",
" \n",
" \n",
"Given a proper georeferenced raster file the ```gdalwarp``` command can be used to assign a new Spatial Reference System to it. Here we reproject the WGS84 geographic image to the Mercator projection:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalwarp -t_srs '+proj=merc +datum=WGS84' {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/mercator.tif"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -of JPEG -co QUALITY=40 {OUTPUTDIR}/mercator.tif {OUTPUTDIR}/mercator.png"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'/mercator.png')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we reproject to the Ortho projection."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalwarp -t_srs '+proj=ortho +datum=WGS84' {DATADIR}/HYP_50M_SR_W.tif {OUTPUTDIR}/ortho.tif 2>/dev/null"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -of JPEG -co QUALITY=40 {OUTPUTDIR}/ortho.tif {OUTPUTDIR}/ortho.png"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'/ortho.png')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">gdaltindex</span></h1></b> \n",
"\n",
"\n",
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Raster tileindex with gdaltindex</span></h1></b> \n",
"You can build a shapefile as a raster tileindex. For every image a polygon is generated with the bounds of the extent of the polygon and the path to the file."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdaltindex {OUTPUTDIR}/index_natural_earth.shp {OUTPUTDIR}/*st.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The command above just created a new ESRI Shape File (default vector format), we will see how to work on vector files later on in the **OGR** section."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Mosaicking</span></h1></b> \n",
"\n",
"```gdal_merge.py``` is a python script that can be used for simple mosaicking tasks. Mosaic the east.tif and west.tif into a single file:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_merge.py {OUTPUTDIR}/east.tif {OUTPUTDIR}/west.tif -o {OUTPUTDIR}/merged.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Convert to jpg to display in the notebook and you can see the original image recomposed"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdal_translate -of JPEG -co QUALITY=40 {OUTPUTDIR}/merged.tif {OUTPUTDIR}/merged.jpg"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'/merged.jpg')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The same task can be accomplished with gdalwarp. gdalwarp has a variety of advantages over gdal_merge, but can be slow to merge many files:\n",
"\n",
" gdalwarp east.tif west.tif warpmerged.tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Get to know OGR</span></h1></b> \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">ogrinfo</span></h1></b> \n",
"\n",
"Like we did with raster using ```gdalinfo```, is possible to retrieve descriptive information from a vector datasource using the command line too ```ogrinfo```.\n",
"Let's run ```ogrinfo``` on the previously generated shapefile ```index_natural_earth.shp```:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ogrinfo {OUTPUTDIR}/index_natural_earth.shp index_natural_earth"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get a summary about your data with ogrinfo together with -so."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ogrinfo -ro -so {DATADIR}/ne_10m_admin_0_countries.shp ne_10m_admin_0_countries"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you run ogrinfo without a parameter you will get a summary about your data and afterwards a section for every dataset. You can forward the result from ogrinfo to grep to filter and get only the attribute COUNTRY."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ogrinfo -ro {DATADIR}/ne_10m_admin_0_countries.shp ne_10m_admin_0_countries | grep 'admin '"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The shape file we just created can not be rendered directly in the notebook. Later in the python tutorial we'll learn how to use libraries like *shapely* to render directly vector data. \n",
"For now to display the results of our processing in the notebook we'll use the ```shp2img``` command line tool (provided by *[mapserver](http://localhost/osgeolive/en/overview/mapserver_overview.html)* ).\n",
"```shp2img``` require a *mapserver mapfile* as input to generate a rendered image.\n",
"Below we'll write a mapfile with 3 layers :\n",
"* west.tif\n",
"* east.tif\n",
"* index_natural_earth.shp\n",
"Note: the shapefile color has been classified based on the shapefile attribute ```location``` with a translarency to show the 2 raster images underneat."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"index_natural_earth=\"\"\"\n",
"MAP\n",
" EXTENT -180 -89.999999999982 179.999999999964 90\n",
" IMAGETYPE \"png\"\n",
" NAME \"simplepolygon\"\n",
" SIZE 600 600\n",
" STATUS ON\n",
" UNITS DD\n",
"\n",
" OUTPUTFORMAT\n",
" NAME \"png\"\n",
" MIMETYPE \"image/png\"\n",
" DRIVER \"AGG/PNG\"\n",
" EXTENSION \"png\"\n",
" IMAGEMODE RGB\n",
" TRANSPARENT TRUE\n",
" END # OUTPUTFORMAT\n",
"\n",
" PROJECTION\n",
" \"proj=longlat\"\n",
" \"datum=WGS84\"\n",
" \"no_defs\"\n",
" END # PROJECTION\n",
"\n",
" LAYER\n",
" DATA \"{OUTPUTDIR}/west.tif\"\n",
" EXTENT -180 -89.999999999982 -1.79596892913025e-11 90\n",
" METADATA\n",
" \"ows_title\"\t\"west\"\n",
" END # METADATA\n",
" NAME \"west\"\n",
" PROJECTION\n",
" \"proj=longlat\"\n",
" \"datum=WGS84\"\n",
" \"no_defs\"\n",
" END # PROJECTION\n",
" STATUS ON\n",
" TILEITEM \"location\"\n",
" TYPE RASTER\n",
" UNITS METERS\n",
" END # LAYER\n",
"\n",
" LAYER\n",
" DATA \"{OUTPUTDIR}/east.tif\"\n",
" EXTENT -1.79596892913025e-11 -89.999999999982 179.999999999964 90\n",
" METADATA\n",
" \"ows_title\"\t\"east\"\n",
" END # METADATA\n",
" NAME \"east\"\n",
" PROJECTION\n",
" \"proj=longlat\"\n",
" \"datum=WGS84\"\n",
" \"no_defs\"\n",
" END # PROJECTION\n",
" STATUS ON\n",
" TILEITEM \"location\"\n",
" TYPE RASTER\n",
" UNITS METERS\n",
" END # LAYER\n",
" \n",
" LAYER\n",
" DATA \"{OUTPUTDIR}/index_natural_earth.shp\"\n",
" EXTENT -180 -89.999999999982 179.999999999964 90\n",
" NAME \"index_natural_earth\"\n",
" PROJECTION\n",
" \"proj=longlat\"\n",
" \"datum=WGS84\"\n",
" \"no_defs\"\n",
" END # PROJECTION\n",
" STATUS ON\n",
" TILEITEM \"location\"\n",
" TYPE POLYGON\n",
" UNITS METERS\n",
" CLASS\n",
" NAME \"{OUTPUTDIR}/east.tif\"\n",
" EXPRESSION (\"[location]\" =\"{OUTPUTDIR}/east.tif\")\n",
" STYLE\n",
" OPACITY 50\n",
" COLOR 218 57 57\n",
" END # STYLE\n",
" STYLE\n",
" OUTLINECOLOR 0 0 0\n",
" WIDTH 0.26\n",
" END # STYLE\n",
" END # CLASS\n",
" CLASS\n",
" NAME \"{OUTPUTDIR}/west.tif\"\n",
" EXPRESSION (\"[location]\" =\"{OUTPUTDIR}/west.tif\")\n",
" STYLE\n",
" OPACITY 50\n",
" COLOR 18 211 14\n",
" END # STYLE\n",
" STYLE\n",
" OUTLINECOLOR 0 0 0\n",
" WIDTH 0.26\n",
" END # STYLE\n",
" END # CLASS\n",
" END # LAYER \n",
"END # MAP\n",
"\"\"\".format(OUTPUTDIR=OUTPUTDIR)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"mapfile=open('index_natural_earth.map','w')\n",
"mapfile.write(index_natural_earth)\n",
"mapfile.close()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!shp2img -m index_natural_earth.map -i PNG -o index_natural_earth.png"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image('index_natural_earth.png')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 18.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">Use ogr2ogr to convert data between file formats</span></h1></b> \n",
"\n",
"\n",
"Like with ```gdalinfo``` You can use ogr2ogr to converts simple features data between file formats. You can use formats to get the list of the supported formats with read/write information."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ogrinfo --formats"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Convert the countries to GeoJson."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<b><h1 style=\"margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.4px; font: 16.0px 'Lucida Sans'; color: #004d87; -webkit-text-stroke: #004d87; background-color: #ffffff\"><span class=\"s1\">ogr2ogr</span></h1></b>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!rm -rf {DATADIR}/countries.json\n",
"!ogr2ogr -f GeoJSON {OUTPUTDIR}/countries.json {DATADIR}/ne_10m_admin_0_countries.shp"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Notebooks---Access-to-Geospatial-data)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,232 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Access to Geospatial data](../Access to Geospatial data)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook is heavily based on the [Python GDAL/OGR Cookbook](https://pcjericks.github.io/py-gdalogr-cookbook/)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this first example we'll learn how to generate a proper OGR geometry of type \"Geometry Collection\" which allows us to store multiple types of geometry (point, line, polygon) in a single vector file (note: this is a great advantage compared with the \"standard but obsolete\" ESRI Shape File data format, which is limited to only one type of geometry). "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's re-use the example from the notebook in [Numerical Cartograph/The Geodesic Problem](../Numerical Cartography/The Geodesic Problem.ipynb), where using [geograhiclib]() we compute the shortest path (geodesic) from New York, (NY) to Delhi, (India):"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from geographiclib.geodesic import Geodesic\n",
"\n",
"lat1,lon1 = (40.7143528, -74.0059731) # New York, NY\n",
"lat2,lon2 = (1.359, 103.989) # Delhi, India\n",
"g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2)\n",
"g"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now compute a list of points along the geodesic curve with a fixed distance of 100000m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gc = [Geodesic.WGS84.Direct(lat1, lon1, g['azi1'], i) for i in range(0,int(g['s12']),100000)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's start with OGR! \n",
"\n",
"We will first create a geometry collection with:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from osgeo import ogr\n",
"geomcol = ogr.Geometry(ogr.wkbGeometryCollection)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"let's add 2 point features for the 2 location we used to compute the geodesic curve:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"point1 = ogr.Geometry(ogr.wkbPoint)\n",
"point1.AddPoint(lon1,lat1)\n",
"geomcol.AddGeometry(point1)\n",
"\n",
"point2 = ogr.Geometry(ogr.wkbPoint)\n",
"point2.AddPoint(lon2,lat2)\n",
"geomcol.AddGeometry(point2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's add to our GeometryCollection a new line feature:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"line = ogr.Geometry(ogr.wkbLineString)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And let's populate the newly generated line feature looping through the list of coordinates of our geodesic path."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"[line.AddPoint(i['lon2'],i['lat2']) for i in gc]\n",
"geomcol.AddGeometry(line)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And finally export the data as GeoJSON string and paste it online for easy visualization on github:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data = geomcol.ExportToJson()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To save on file the new dataset we will ```echo``` the ```geojson``` string to a file"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!echo '{data}' > /tmp/geojson.geojson"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The ```gist``` utility (not installed on the live) can be used to paste the content of a text file online as a *gist* for easy visualization on github"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#!gist -p /tmp/geojson.geojson"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from CesiumWidget import CesiumWidget"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cesiumExample = CesiumWidget(width=\"100%\",geojson=data, enable_lighting=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cesiumExample"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,56 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Access to Geospatial data](../Access to Geospatial data) - [Introduction ](../Access to Geospatial data/Introduction to Access to Geospatial data.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Access to Geospatial data\n",
"\n",
"In this set of notebook two of the most important open source software libraries are introduced:\n",
"\n",
"* [GDAL](http://localhost/osgeolive/en/overview/gdal_overview.html) (Geospatial Data Abstraction Library) \n",
"* [OSSIM](http://localhost/osgeolive/en/overview/ossim_overview.html) (Open Source Software Image Mapping). \n",
"\n",
"Both libraries are the state of the art in software for reading and translating geospatial data between several formats, and the contain tools to reproject, mosaic and subset geospatial dataset.\n",
"\n",
"The two libraries have a lot in common but differ in some particular features. **GDAL** presents a complete set of software utilities to work with both raster and vector data. It includes support for sql-like query processing, a very wide range of driver to access both raster and vector for all the most common data formats and a complete set of API accessible trough scripting languages such Python. **OSSIM** is more oriented to photogrammetry with its hi-performance hi-precision raster processing engine. It offers parallel processing support, an unique orthorectification system which enables the processing of satellite-sensor specific data products. \n",
"\n",
"In the notebooks below we'll explore the tools offered by the *command line utilities* for both software plus the Python scripting capabilities pf GDAL.\n",
"\n",
"* [GDAL-OGR Quickstart - bash](GDAL-OGR Quickstart.ipynb)\n",
"\n",
"* [OSSIM Quickstart](OSSIM Quickstart.ipynb)\n",
"\n",
"* [GDAL-OGR with Python](GDAL-OGR with Python.ipynb)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,963 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Access to Geospatial data](../Access to Geospatial data)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# OSSIM Command Line Applications\n",
"The following command line applications are distributed with OSSIM.\n",
"\n",
"## Core Programs\n",
"\n",
"* [```ossim-info```](#ossim-info) Used to run ossim utility function and to display metadata for imagery, maps, terrain, and vector data.\n",
" * [Utility functions](#Utility-functions)\n",
" * [radians from degrees](#radians-from-degrees)\n",
" * [degrees from radians](#degrees-from-radians)\n",
" * [meters from feet](#meters-from-feet)\n",
" * [meters to feet](#meters-to-feet)\n",
" * [Meters per degree](#Meters-per-degrees)\n",
" * [height](#height)\n",
" * [Projections](#Projections)\n",
" * [Datums](#Datums)\n",
" * [Explore raster data](#Explore-raster-data)\n",
" * [ground center](#ground-center)\n",
" * [image center](#image-center)\n",
" * [ground and image center](#ground-and-image-center)\n",
" * [general image information](#general-image-information)\n",
" * [meta data image information](#meta-data-image-information)\n",
" * [image projection information](#image-projection-information)\n",
" * [image rectangle](#image-rectangle)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Utilities to Create Support Files\n",
"\n",
"The following tools are used to create OSSIM support files:\n",
"\n",
"* [```ossim-img2rr```](#ossim-img2rr) Create reduced resolution data sets for an image.\n",
"* [```ossim-cmm```](#ossim-cmm) Determine the min/max pixel values of an image.\n",
"* [```ossim-create-histo```](#ossim-create-histo) Compute a histogram for an image.\n",
"* [```ossim-img2md```](#ossim-img2md) Create metadata files.\n",
"* [```ossim-tfw2ogeom```]() Create a geom file from a TIFF World File.\n",
"* [```ossim-extract-vertices```]() Compute the valid vertices (corners) of an image.\n",
"* [```ossim-preproc```]() Create reduced resolution data sets, histograms, and so on. The application does directory walking and is threaded at a file level.\n",
"* [```ossim-applanix2ogeom```]() Create a geom file for Applanix Images.\n",
"* [```ossim-create-cg```]() Create an ossim coarse grid.\n",
"* [```ossim-ecg2ocg```]() Convert an enhanced coarse grid to an ossim coarse grid.\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## OSSIM-Applications\n",
"\n",
" * [```ossim-band-merge```](#ossim-band-merge) Merge multiple images files into a single n-band dataset.\n",
" * [```ossim-chipper```](#ossim-chipper) Render elevation data (e.g. shaded relief).\n",
" * [```ossim-icp```](#ossim-icp) Convert an image from one format to another.\n",
" * [```ossim-igen```](#ossim-igen) Execute image chains specified in a spec file.\n",
" * [```ossim-orthoigen```](#ossim-orthoigen) Tool to orthorectify, mosaic, and convert raster data between different formats. It provides a number of operations including subsetting, resampling, histogram matching, and reprojection of data.\n",
" * [```ossim-rpf```](#ossim-rpf) Various utilities for managing RPF data."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Import IPython utility to display images**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.core.display import Image"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Set the PATH to the natural earth dataset used in this notebook**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"DATADIR='/home/user/data/landsat/'\n",
"OUTPUTDIR='/home/user/jupyter/notebooks/GSoC-2015/OUTPUT/'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# we'll use the north_carolina image dataset\n",
"!ls {DATADIR} | grep tif"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-info```\n",
"\n",
"[top](#Core-Programs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Utility functions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### radians from degrees\n",
"\n",
"```ossim-info --deg2rad <degrees>```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --deg2rad 20.54"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### degrees from radians\n",
" ```ossim-info --rad2deg <radians>```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --rad2deg 0.35849"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### meters from feet \n",
"- 0.3048 meters per foot\n",
"\n",
" ```ossim-info --ft2mtrs <feet>``` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --ft2mtrs 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- 0.3048006096 meters per foot\n",
" \n",
" ```ossim-info --ft2mtrs-us-survey <feet>``` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --ft2mtrs-us-survey 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### meters to feet\n",
"* 0.3048 meters per foot\n",
"\n",
" ```ossim-info --mtrs2ft <meters>```\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --mtrs2ft 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* 0.3048006096 meters per foot\n",
"\n",
" ```ossim-info --mtrs2ft-us-survey <meters>```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --mtrs2ft-us-survey 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### height\n",
"return the MSL and ellipoid height given a latitude longitude position\n",
"\n",
"```ossim-info --height <latitude-in-degrees> <longitude-in-degrees>``` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# note we pass the path to the ossim_preference file to tell where the geoid file is\n",
"!ossim-info --height 47.54 157.40 -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Meters per degrees\n",
"Gives meters per degree and meters per minute for a given latitude. \n",
"```ossim-info --mtrsPerDeg <latitude>```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --mtrsPerDeg 65.45"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Datums\n",
"Prints datum list.\n",
"```ossim-info --datums``` \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --datums"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Projections\n",
"Prints projections list\n",
"```ossim-info --projections``` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --projections"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Explore raster data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### ground center\n",
"\n",
" ```ossim-info --cg filename```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --cg {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### image center\n",
"\n",
" ```ossim-info --ci filename``` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info --ci {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### ground and image center\n",
"\n",
" ```ossim-info -c filename```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info -c {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### general image information\n",
" \n",
" ```ossim-info -i filename```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info -i {DATADIR}/clip10.tif -P /usr/local/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### meta data image information\n",
"\n",
" ossim-info -m filename"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info -m {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### image projection information\n",
"\n",
" ossim-info -p filename"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info -p {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### image rectangle\n",
"\n",
" ossim-info -r filename"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-info -r {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-img2rr```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-img2rr {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-img2rr {DATADIR}/clip20.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-img2rr {DATADIR}/clip30.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-cmm``` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-cmm {DATADIR}/clip10.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-cmm {DATADIR}/clip20.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-cmm {DATADIR}/clip30.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!cat {DATADIR}clip10.omd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-img2md```\n",
"\n",
"\n",
" Usage: ossim-img2md [options] <metadata_writer> <input_file> <output_file>\n",
" \n",
" \n",
" * Valid metadata writer types:\n",
" * envi_header\t\n",
" * ers_header\t\n",
" * ossim_fgdc\t\n",
" * ossim_geometry\t\n",
" * ossim_readme\t\n",
" * tiff_world_file\t\n",
" * jpeg_world_file\t"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-img2md -P /usr/share/ossim/ossim_preference tiff_world_file {DATADIR}/clip10.tif {DATADIR}/clip10.tfw"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!cat {DATADIR}/clip10.tfw"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-band-merge```\n",
"\n",
"```ossim-band-merge [-h][-o][-w tile_width] <output_type> <input_file1> <input_file2> ... <output_file>```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Example, create an RGB image from the single-band grayscale r,g,b images (Landsat 7)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-band-merge jpeg -P /usr/share/ossim/ossim_preference \\\n",
" {DATADIR}/clip30.tif \\\n",
" {DATADIR}/clip20.tif \\\n",
" {DATADIR}/clip10.tif \\\n",
" {OUTPUTDIR}/rgb.jpeg"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-cmm {OUTPUTDIR}/rgb.jpeg -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!cat {OUTPUTDIR}/rgb.omd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+\"rgb.jpeg\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-create-histo```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-create-histo {DATADIR}/clip30.tif \\\n",
"{DATADIR}/clip20.tif \\\n",
"{DATADIR}/clip10.tif"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-orthoigen --hist-auto-minmax {DATADIR}/clip30.tif {OUTPUTDIR}/clip30_histmm.tif -P /usr/share/ossim/ossim_preference\n",
"!ossim-orthoigen --hist-auto-minmax {DATADIR}/clip20.tif {OUTPUTDIR}/clip20_histmm.tif -P /usr/share/ossim/ossim_preference\n",
"!ossim-orthoigen --hist-auto-minmax {DATADIR}/clip10.tif {OUTPUTDIR}/clip10_histmm.tif -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-band-merge jpeg -P /usr/share/ossim/ossim_preference \\\n",
" {OUTPUTDIR}/clip30_histmm.tif \\\n",
" {OUTPUTDIR}/clip20_histmm.tif \\\n",
" {OUTPUTDIR}/clip10_histmm.tif \\\n",
" {OUTPUTDIR}/rgb_histmm.jpeg"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'rgb_histmm.jpeg')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-chipper```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!wget https://gist.githubusercontent.com/anonymous/c339de8d38357a4a71bf/raw/428e9f193d29b25735b57960372d029691511a17/a.rb"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-chipper --color 255 255 255 \\\n",
" --azimuth 270 \\\n",
" --elevation 45 \\\n",
" --exaggeration 2.0 \\\n",
" --op hillshade \\\n",
" --color-table a.rb \\\n",
" --input-dem {DATADIR}/srtm.tif \\\n",
" {OUTPUTDIR}/hillshade.jpg -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(OUTPUTDIR+'hillshade.jpg')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-icp```\n",
"\n",
"```ossim-icp [options] <output_type> <input_file> <output_file>```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# A complete list of ossim writers (driver) is given by:\n",
"!ossim-info --writers -P /usr/share/ossim/ossim_preference"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#convert a geotiff to a geopdf\n",
"!ossim-icp ossim_pdf rgb_histmm.jpeg rgb_histmm.pdf"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#view the results in a pdf viewer\n",
"!nohup evince rgb_histmm.pdf"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-igen```\n",
"\n",
"Execute image chains specified in a spec file.\n",
"\n",
"In the folowing example the spec file ```rgb.spec``` has been generated using [imagelinker](http://localhost/osgeolive/en/quickstart/ossim_quickstart.html) ```save spec only``` when saving a data product (this may be useful when batch processing a complex image chain, or when ossim is built with mpi support to redistribute the computation on more CPU's)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!ossim-igen /home/user/data/landsat/rgb.spec"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Image(\"/home/user/data/landsat/rgb_spec.jpg\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Core-Programs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-orthoigen```\n",
"\n",
"```todo```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ```ossim-rpf```\n",
"\n",
"```todo```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[top](#Notebooks---Access-to-Geospatial-data)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,173 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Geoprocessing with Vectors](../Geoprocessing with Vectors) - [Intro to Postgis](../Geoprocessing with Vectors/Intro to Postgis.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Postgis"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import psycopg2\n",
"paramstring = \"dbname='%s' user='%s' host='%s' password='%s'\" % ('natural_earth2','user','localhost','user')\n",
"conn = psycopg2.connect(paramstring)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"curs = conn.cursor()\n",
"curs.execute(\"\"\"SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'\"\"\")\n",
"for table in curs.fetchall():\n",
" print(table)\n",
"conn.commit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"curs = conn.cursor()\n",
"curs.execute(\"Select * FROM ne_10m_urban_areas\")\n",
"colnames = [desc[0] for desc in curs.description]\n",
"conn.commit()\n",
"colnames"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"curs = conn.cursor()\n",
"curs.execute(\"CREATE TABLE cities ( id int4 primary key, name varchar(50), the_geom geometry(POINT,4326));\")\n",
"conn.commit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"table='cities'\n",
"col=\"id, the_geom, name\"\n",
"x=10\n",
"y=10\n",
"name='test'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"querytmplate=\"INSERT INTO %(table)s (%(col)s) VALUES (1,ST_GeomFromText('POINT(%(x)f %(y)f)',4326),'%(name)s');\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"querytmplate = querytmplate % {'table':table, 'col':col, 'x':x, 'y':x, 'name':name}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"curs = conn.cursor()\n",
"curs.execute(querytmplate)\n",
"conn.commit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"curs = conn.cursor()\n",
"curs.execute(\"SELECT * FROM cities\")\n",
"data = curs.fetchall()\n",
"conn.commit()\n",
"print(data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"curs = conn.cursor()\n",
"curs.execute(\"SELECT name, ST_AsText(the_geom) FROM cities\")\n",
"data = curs.fetchall()\n",
"conn.commit()\n",
"print(data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data[0][1]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,39 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Geoprocessing with Vectors](../Geoprocessing with Vectors) - [Introduction ](../Geoprocessing with Vectors/Introduction to Geoprocessing with Vector.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* [Intro to Postgis](Intro to Postgis.ipynb)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,137 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Introduction to GRASS GIS](../Introduction to GRASS GIS) - [GRASS working environment](../Introduction to GRASS GIS/GRASS working environment.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On the OSGeoLive, the Jupyter notebook is started by a bash script which has instructions to export the GRASS environment variables. In this way the GRASS functionalities are accessible from within the notebooks using the system command magic which consists in adding an exclamation mark as prefix to a bash command, e.g.: ```!bash-command``` "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Import GRASS script python library:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import grass.script as grass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Direct access to GRASS commands using shell syntax:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## [g.gisenv](http://localhost/grass/g.gisenv.html)\n",
"\n",
"When a user runs GRASS, certain variables are set specifying the GRASS database, location, mapset, peripheral device drivers, etc., being used in the current GRASS session. These variable name settings are recognized as long as the user is running a GRASS session. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!g.gisenv"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## [g.mapset](http://localhost/grass/g.mapset.html)\n",
"\n",
"**g.mapset** is used to create new or change the current mapset."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Generate a new GRASS LOCATION Specifying the projection parameters using the proj-4 string syntax using [g.proj](http://localhost/grass/g.proj.html). The informations used as input to ```g.proj``` are retrieved from the gdalinfo output.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!gdalinfo /usr/local/share/data/north_carolina/rast_geotiff/basin_50K.tif"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"proj4 = '+proj=lcc +lat_1=36.1667 +lat_2=34.333 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.2572221010042 +to_meter=1'\n",
"#this will return an error if the location alreay exist (just ignore it) <-- fix me\n",
"try:\n",
" grass.run_command('g.proj', proj4=proj4, location='nc')\n",
"except:\n",
" print 'grass location nc already exist'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!g.mapset location=nc mapset=PERMANENT"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!g.proj -p"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,45 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Introduction to GRASS GIS](../Introduction to GRASS GIS) - [Introduction ](../Introduction to GRASS GIS/Introduction to GRASS GIS.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction to GRASS GIS\n",
"\n",
"* [GRASS working environment](GRASS working environment.ipynb)\n",
"* [Map display](Map display.ipynb)\n",
"\n",
"\n",
"# [python-grass-addons](python-grass-addons/00 Introduction.ipynb)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,155 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Introduction to GRASS GIS](../Introduction to GRASS GIS) - [Map display](../Introduction to GRASS GIS/Map display.ipynb)</center></h1>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%run grassutil.ipy"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"DATADIR='/home/user/data/north_carolina/rast_geotiff/'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!g.mapset location=nc mapset=PERMANENT"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!g.proj -p"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!r.in.gdal input={DATADIR}/elevation.tif output=elevation -e --o"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"makeImage(basemap='elevation', inputlayer='elevation', maptype='raster', \n",
" vsize=10, maptitle='elevation', region=region2dict(rast='elevation'), legend=False, outputimagename='test.png')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!r.in.gdal input={DATADIR}/basin_50K.tif output=basin_50K -e --o"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"makeImage(basemap='basin_50K', inputlayer='basin_50K', maptype='raster', \n",
" vsize=10, maptitle='Basins', region=region2dict(rast='basin_50K'), legend=False, outputimagename='test.png')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!r.blend first=elevation second=basin_50K output=basin_relief percent=30 --overwrite --quiet"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"makeImage(basemap='basin_50K', inputlayer='basin_relief', maptype='rgb', \n",
" vsize=10, maptitle='Basins', region=region2dict(rast='basin_50K'), legend=False, outputimagename='test.png')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!m.nviz.image elevation_map=elevation output=elevation position=0.5,0.5 \\\n",
" perspective=100 height=800 color_map=basin_50K \\\n",
" resolution_fine=1 resolution_coarse=1 format=tif --q"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!convert elevation.tif elevation.png\n",
"Image(\"elevation.png\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,127 +0,0 @@
from IPython.core.display import Image
def getLayerList(type='rast', mapset=None, verbose=None):
if mapset:
mapset = [mapset]
if not mapset:
mapset = !g.mapsets -l
mapset = mapset[1].split()
if verbose:
print type, 'layers available in mapset : ', mapset[0]
layerlist = []
for m in mapset:
llist = !g.list {type}
return llist
def list2dict(inputlist, sep="=", inverse=False):
if inverse:
dictionary = dict([(i.split(sep)[1],i.split(sep)[0]) for i in inputlist])
else :
dictionary = dict([(i.split(sep)[0],i.split(sep)[1]) for i in inputlist])
return dictionary
def vlayerInfo(map,layer=1):
hist = !v.info map={map} layer={layer} -h
map_history = {'COMMAND' : hist[0].split(':')[1],
'GISDBASE' : hist[1].split(':')[1],
'LOCATION' : hist[2].split(' ')[1],
'MAPSET' : hist[2].split(' ')[3],
'USER' : hist[2].split(' ')[5],
'DATE' : hist[2].split(' ')[7:]}
map_table = !v.info map={map} layer={layer} -c
map_table = list2dict(map_table[1:], sep='|', inverse=True)
map_region = !v.info map={map} layer={layer} -g
map_region = list2dict(map_region)
#map_title = !v.info map={map} layer={layer} -m
#try:
# map_title = map_title[0].split("=")[1].replace("(",'').replace(")",'').strip()
#except:
# 'no title found'
map_topology = !v.info map={map} layer={layer} -t
map_topology = list2dict(map_topology)
info = {'table' : map_table,
'region' : map_region,
'history' : map_history,
'topology' : map_topology,
} #'title' : map_title
return info
def rlayerInfo(map, mapset='PERMANENT'):
print 'mapset parameter not specified, using mapset PERMANENT as default'
raster_info = !r.info map={map}@{mapset} -g
print raster_info
raster_info = list2dict(raster_info)
map_range = !r.info map={map}@{mapset} -r
map_range=list2dict(map_range)
raster_info['range'] = map_range
map_history = !r.info map={map}@{mapset} -h
raster_info['history'] = '\n'.join(map_history)
return raster_info
def region2dict(rast=None, vect=None):
if rast:
region = !g.region rast={rast} -p
if vect:
region = !g.region vect={vect} -p
else :
region = !g.region -p
regiondict = {}
for i in region:
info = i.split(': ')
try:
regiondict[info[0]] = info[1].strip()
except:
print 'done'
return regiondict
def makeImage(basemap='', inputlayer='', maptype='raster', lcolor='grey', vcolor='grey', vsize=1, icon='basic/diamond',
maptitle='', region=None, grid=True, gridsize=1000, title=True, title_at=(45,95), legend=True, legend_at=(22,65,8,10), outputimagename=None):
if not outputimagename:
outputimagename=basemap
if not region:
try:
array_info = rlayerInfo(basemap)
n=array_info['north']
s=array_info['south']
w=array_info['west']
e=array_info['east']
except:
region=region2dict()
print 'no region boundary provided and unable to retrieve map layer region, using default region settings'
else:
#region=region2dict()
n=region['north']
s=region['south']
w=region['west']
e=region['east']
!rm -rf {outputimagename}.png
!g.region n={n} s={s} w={w} e={e} -a --q
#!g.region -p
!d.mon start=cairo --q output={outputimagename}.png
if maptype=='raster':
!g.region rast={inputlayer} n={n} s={s} w={w} e={e} -a --q
!d.rast map={inputlayer} --q
if legend:
!d.legend at={legend_at[0]},{legend_at[1]},{legend_at[2]},{legend_at[3]} raster={inputlayer} --q
if maptype=='vector':
!g.region vect={inputlayer} n={n} s={s} w={w} e={e} -a #p
!d.vect map={inputlayer} color={vcolor} size={vsize} icon={icon} --q
if maptype=='overlay':
for i in inputlayer['raster']:
!d.rast map={i} --q
for i in inputlayer['vector']:
!d.vect map={i} color={vcolor} size={vsize} icon={icon} --q
if maptype=='rgb':
!g.region rast={basemap} n={n} s={s} w={w} e={e} -a --q
#!d.rast map={inputlayer} --q
!d.rgb r={inputlayer}.r g={inputlayer}.g b={inputlayer}.b --q
if grid:
!d.grid size={gridsize} color=blue --q
if title:
!d.text at={title_at[0]},{title_at[1]} text={maptitle} color=red --q
!d.mon stop=cairo --q
return Image(outputimagename+'.png')

View File

@ -1,104 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction\n",
"\n",
"This set of digital notebooks was created to explore several open source solutions for geospatial data analysis, with the aim of bridging together the several software libraries already installed on OSGeo live to perform complex *geo-data-science workflows*. It was originally started as a Google Summer of Code (GSoC) project in 2015.\n",
"\n",
"The notebooks are developed in the [Jupyter notebook server](https://jupyter.org/) environment, which is heavily based on the [IPython](http://ipython.org/) project. They are written in different languages (bash, Python, R) and are organized in a series of \"topic-oriented\" geospatial notebooks.\n",
"\n",
"For a complete description of each project installed on OSGeo-Live refer to the [OSGeo-Live documentation](http://localhost/osgeolive/en/index.html). This work will focus on different aspects:\n",
" * The usage of several scientific Python libraries like [numpy](http://www.numpy.org/), [scipy](http://www.scipy.org/), [pandas](http://pandas.pydata.org/), [matplotlib](http://matplotlib.org/)\n",
" * The usage of GFOSS (Geographic Free and Open Source Software) projects like [GRASS](https://grass.osgeo.org/), [GDAL](http://www.gdal.org/), [OSSIM](https://trac.osgeo.org/ossim/), [mapserver](http://mapserver.org/) \n",
" * And finally introducing more specialized software like [R](https://www.r-project.org/) for geostatistic analyses and [postgis](http://postgis.net/) as geospatial relational database.\n",
"\n",
"\n",
"The geospatial notebook here developed will make use of the sample dataset pre-installed on OSGeo-Live:\n",
"\n",
"* [Natural Earth](http://localhost/osgeolive/en/overview/naturalearth_overview.html)\n",
"\n",
"* [OSGeo North Carolina, USA Educational dataset](http://localhost/osgeolive/en/overview/nc_dataset_overview.html)\n",
"\n",
"* [OpenStreetMap](http://localhost/osgeolive/en/overview/osm_dataset_overview.html)\n",
"\n",
"* [NetCDF Data Set](http://localhost/osgeolive/en/overview/netcdf_dataset_overview.html)\n",
"\n",
"The geospatial notebook here are composed of 6 different sections with the aim of introducing some of the several geospatial libraries installed on OSGeo-Live. The geospatial notebooks will walk the user from simple usage of command line tools such GDAL, PROJ and OSSIM to basic SQL query on how to access database information to more complex geoprocessing including raw data parsing, numerical processing and the use of complete GIS platfom like GRASS GIS.\n",
"\n",
"\n",
"# Topic Layout\n",
"\n",
"**[Access to Geospatial data](Access to Geospatial data/Introduction to Access to Geospatial data.ipynb)**\n",
"\n",
" * [GDAL-OGR Quickstart - bash](Access to Geospatial data/GDAL-OGR Quickstart.ipynb)\n",
"\n",
" * [GDAL-OGR with Python](Access to Geospatial data/GDAL-OGR with Python.ipynb)\n",
"\n",
" * [OSSIM Quickstart](Access to Geospatial data/OSSIM Quickstart.ipynb)\n",
"\n",
"**[An Introduction to Numerical Cartography](Numerical Cartography/An intro to Numerical Cartography.ipynb)**\n",
"\n",
" * [Map Projections](Numerical Cartography/Map Projections.ipynb)\n",
"\n",
" * [Spatial and Coordinate Reference System](Numerical Cartography/Spatial and Coordinate Reference System.ipynb)\n",
"\n",
" * [The Geodesic Problem](Numerical Cartography/The Geodesic Problem.ipynb)\n",
"\n",
" * [Working with coordinates](Numerical Cartography/Working with coordinates.ipynb)\n",
"\n",
" * [geometric-transformations](Numerical Cartography/geometric-transformation.ipynb)\n",
"\n",
"\n",
"**[Geoprocessing with Vectors](Geoprocessing with Vectors/Introduction to Geoprocessing with Vector.ipynb)**\n",
"\n",
" \n",
" * [Intro to Postgis](Geoprocessing with Vectors/Intro to Postgis.ipynb)\n",
" \n",
"**[Introduction to GRASS GIS](Introduction to GRASS GIS/Introduction to GRASS GIS.ipynb)**\n",
"\n",
" * [GRASS working environment](Introduction to GRASS GIS/GRASS working environment.ipynb)\n",
" \n",
" * [Map display](Introduction to GRASS GIS/Map display.ipynb)\n",
"\n",
"**[Simple web-gis products](Simple web-gis products/Introduction to Simple web-gis products.ipynb)**\n",
"\n",
" * [CESIUM](Simple web-gis products/CESIUM/cesium-introduction.ipynb)\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,61 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Numerical Cartography](../numerical cartography)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# An introduction to Numerical Cartography"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* [Spatial and Coordinate Reference System](Spatial and Coordinate Reference System.ipynb)\n",
"* [Working with coordinates](Working with coordinates.ipynb)\n",
"* [The Geodesic Problem](The Geodesic Problem.ipynb)\n",
"* [Map Projections](Map Projections.ipynb)\n",
"* [Geometric transformation](geometric-transformation.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### References\n",
"\n",
"* [pyproj](https://jswhit.github.io/pyproj/)\n",
"* [Map Projections-A Working Manual](http://pubs.er.usgs.gov/publication/pp1395)\n",
"* [geographiclib](http://geographiclib.sourceforge.net/)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,266 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting test.csv\n"
]
}
],
"source": [
"%%file test.csv\n",
"30.263888889,45.563456\n",
"23.457654,34.433425"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Latitude</th>\n",
" <th>Longitude</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>30.263889</td>\n",
" <td>45.563456</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>23.457654</td>\n",
" <td>34.433425</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
]
},
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
"input = pd.read_csv('test.csv', names=['Latitude', 'Longitude'])\n",
"input"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [],
"source": [
"def d2s(df,key='Latitude'):\n",
" '''convert from decimal degrees to sessagesimal degrees\n",
" take as input a pandas dataframe and a column name'''\n",
" g = df[key].values.astype(int)\n",
" p = ((( df[key].values) - df[key].values.astype(int))*60).astype(int)\n",
" s = (((df[key].values - df[key].values.astype(int)) * 60. ) - p ) * 60.\n",
" param = key\n",
" ses = pd.DataFrame(np.array([g,p,s]).T, columns=['Degree','Minute','Second'] , dtype=float)\n",
" return ses\n",
"\n",
"def s2d(df,key=['Degree','Minute','Second']):\n",
" '''convert from sessagesimal degrees to decimal degrees\n",
" take as input a pandas dataframe and a list of column names'''\n",
" deg=df[key[0]].values+(df[key[1]].values/60.+df[key[2]].values/3600.)\n",
" return deg"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
"Lat = d2s(df=input,key='Latitude')\n",
"Lon = d2s(df=input,key='Longitude')"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Degree</th>\n",
" <th>Minute</th>\n",
" <th>Second</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>30</td>\n",
" <td>15</td>\n",
" <td>50.0000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>23</td>\n",
" <td>27</td>\n",
" <td>27.5544</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
]
},
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
"Lat"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Degree</th>\n",
" <th>Minute</th>\n",
" <th>Second</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>45</td>\n",
" <td>33</td>\n",
" <td>48.4416</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>34</td>\n",
" <td>26</td>\n",
" <td>0.3300</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
]
},
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
"Lon"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 30.26388889, 23.457654 ])"
]
},
"execution_count": 45,
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
"s2d(Lat)"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 45.563456, 34.433425])"
]
},
"execution_count": 46,
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
"s2d(Lon)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,70 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Numerical Cartography](../numerical cartography)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Map Projections\n",
"\n",
"A map projection is a systematic representation of all or part of the surface of a round body, especially the Earth, on a plane and cannot be done without inducing distortions.\n",
"\n",
"There are several ways to project a curved surface on a plane and each way, projection, has its own particular characteristic. Depending on the purpose of the map a map maker, the cartographer, must choose the characteristic which is to be shown accurately at the expense of others, or a compromise of several characteristics.\n",
"\n",
"\n",
"The characteristics normally considered in choosing a map projection are as follows:\n",
"\n",
"* **Area** - (eg. equal-area map) on such maps the area is preserved (areas of the same size on the map represent an area f equivalent size on the earth) Shapes, angles, and scale must be distorted in most parts of such a map. Equal-area map is also called *equivalent*, *homolographic*, or *homalographic*\n",
"* **Shape** - (eg. conformal map) on those maps the relative local angles about every point on the map are shown correctly. Because local angles are correct, meridians intersect parallels at right ($90^\\circ$) angles on a conformal projection.\n",
"* **Scale** (eg. equidistant projections) No map projection shows scale correctly throughout the map, but there are usually one or more lines on the map along which the scale remains true. An equidistant projection shows true scale between one or two points and every other point on the map, or along every meridian.\n",
"* **Direction** - While conformal maps give the relative local directions correctly at any given point, there is one frequently used group of map projections, called azimuthal (or zenithal), on which the directions or azimuths of all points on the map are shown correctly with respect to the center. Some projection of this kind can be *equal-area* others can be *conformal* or *equidistant* \n",
"* **Special characteristic** - Several map projections provide special characteristics that no other projection provides. eg. On the *Mercator projection*, the lines of constant direction (rhumb lines) are shown as straight lines. On the *Gnomonic projection*, all great circle paths are shown as straight lines. On the *Stereographic*, all small circles, as well as great circles, are shown as circles on the map. \n",
"\n",
"Source: [Map Projections](http://pubs.usgs.gov/pp/1395/report.pdf)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There are several tools that can handle map projections right an easy and powerful tool to explore map projections is the cartopy python library. For several examples see the relative example [notebooks](../../Projects/CARTOPY/)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"[top](#Notebooks---Numerical-Cartography)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,106 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Numerical Cartography](../numerical cartography)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Spatial and Coordinate Reference System\n",
"\n",
"A **spatial reference system** (SRS) or **coordinate reference system** (CRS) is a [coordinate-based](https://en.wikipedia.org/wiki/Coordinate_system) local, regional or global system used to locate geographical entities. A spatial reference system defines a specific [map projection](https://en.wikipedia.org/wiki/Map_projection), as well as transformations between different spatial reference systems. Spatial reference systems are defined by the [OGC](https://en.wikipedia.org/wiki/Open_Geospatial_Consortium)'s [Simple feature access](https://en.wikipedia.org/wiki/Simple_feature_access) using [well-known text](https://en.wikipedia.org/wiki/Well-known_text), and support has been implemented by several [standards-based](https://en.wikipedia.org/wiki/Technical_standard) [geographic information systems](https://en.wikipedia.org/wiki/Geographic_information_system). Spatial reference systems can be referred to using an [SRID](https://en.wikipedia.org/wiki/SRID) integer, including EPSG codes defined by the [International Association of Oil and Gas Producers](https://en.wikipedia.org/wiki/International_Association_of_Oil_and_Gas_Producers).\n",
"\n",
"**source:** \n",
"\n",
"**[Wikipedia: Spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system)**\n",
"\n",
"**[Wikipedia: Geographic coordinate system](https://en.wikipedia.org/wiki/Geographic_coordinate_system)**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Coordinate Reference System (CRS):\n",
"A position refers to the spatial location of an entity and it is determined by its spatial coordinates relative to a spatial reference system (SRS).\n",
"The most common choices of coordinates are ** *Geographic coordinates* ** and ** *UTM coordinates* **.\n",
"\n",
"\n",
"### Geographic latitude and longitude:\n",
" \n",
" A geographic coordinate system is a coordinate system that enables every location on the Earth to be specified by a set of numbers or letters.A common choice of coordinates is latitude, longitude, and elevation.\n",
" \n",
" * **Latitude** (angle between the equatorial plane and the straight line that passes through that point and through, or close to, the center of the Earth)\n",
" * **Longitude** (the angle east or west from a reference meridian to another meridian that passes through that position). \n",
"\n",
"The combination of these two components specifies the position of any location on the surface of the Earth, without consideration of altitude or depth. \n",
"\n",
"<img src=\"../images/ECEF.svg\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Universal Transverse Mercator (UTM) coordinate system:\n",
"\n",
" The UTM coordinate system uses a metric-based cartesian grid laid out on a conformally projected surface. The UTM system is not a single map projection but a series of sixty, each covering 6-degree bands of longitude.\n",
" \n",
" \n",
"<img src=\"../images/utmzone.svg\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Geodetic Coordinates:\n",
" \n",
" To completely specify a location of a topographical feature on, in, or above the Earth, one has to also specify the vertical distance from the center of the Earth, or from the surface of the Earth.\n",
" \n",
" In order to be unambiguous about the direction of \"vertical\" and the \"surface\" above which they are measuring, map-makers choose a reference ellipsoid with a given origin and orientation that best fits their need for the area they are mapping. They then choose the most appropriate mapping of the spherical coordinate system onto that ellipsoid, called a terrestrial reference system or geodetic datum. Datums may be global, meaning that they represent the whole earth, or they may be local, meaning that they represent a best-fit ellipsoid to only a portion of the earth.\n",
" \n",
" The choice of which layer to use for defining height is arbitrary. Common height baselines include:\n",
" * The surface of the datum ellipsoid, resulting in an ellipsoidal height\n",
" * The mean sea level as described by the gravity geoid, yielding the orthometric height\n",
" * A vertical datum, yielding a dynamic height relative to a known reference height.\n",
"Along with the latitude $\\phi$ and longitude $\\lambda$, the height $h$ provides the three-dimensional *geodetic coordinates* or *geographic coordinates* for a location."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"[top](#Notebooks---Numerical-Cartography)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,362 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Numerical Cartography](../numerical cartography)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The Geodesic Problem"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"##Distances and angles \n",
"\n",
"The distances between two points can be axpressesd as the shortest path between the points themselves. For a plane such distance will coincide with a straight line and is expressed by the eucidean distance (eq. 1).\n",
"\n",
"<center><it>euclidean distance</it></center>\n",
"<br>\n",
"$$\n",
"d = \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2} \\quad (1) \n",
"$$\n",
"\n",
"On the earth surface the distances between 2 points can't be expressed as a straight line and a more relatively complex geometry has to be adopted. In the simplest case we can approssimate the shape of the earth to a sphere and perform distance calculations on the basis of a spherical trigonometry (ignoring ellipsoidal effects). "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Distance on a sphere\n",
"[source](https://www.math.ksu.edu/~dbski/writings/haversine.pdf)\n",
"\n",
"Given 2 Points $P_1(\\theta_1,\\phi_1)$ and $P_2(\\theta_2,\\phi_2)$ on the Earths Surface in polar coordinates, which coincide with $P_1(x_1,y_1,z_1)$ and $P_2(x_2,y_2,z_2)$ in cartesian coordinates. The distance $d$ on the surface of a sphere is computed in two stages:\n",
"* Compute the euclidean distance as a straight line\n",
"* Convert the measurments to spherical coordinates\n",
"\n",
"The conversion from polar coordinates $(\\theta, \\phi)$ to cartesian $(X,Y,Z)$ is given by the relation:\n",
"\n",
"$$\n",
"X = R \\cdot \\cos(\\theta) \\cdot \\cos(\\phi) \\\\\n",
"Y = R \\cdot \\cos(\\theta) \\cdot \\sin(\\phi) \\\\\n",
"Z = R \\cdot sin(\\theta) \n",
"$$\n",
"\n",
"and the three-dimensional euclidean distance $d$ is given by:\n",
"\n",
"$$\n",
"d = \\sqrt{(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2} \n",
"$$\n",
"\n",
"\n",
"\n",
"Converting the cartesian coordinates to spherical coordinates, the distance $d$ on a sphere is found by:\n",
"\n",
"$$\n",
"d^2 = 2 - 2 \\cos(\\theta_1) \\cdot cos(\\theta_2) \\cdot cos(\\phi_1 - \\phi_2) - 2\\sin(\\theta_1) \\cdot sin(\\theta_2)\n",
"$$\n",
"\n",
"\n",
"Now from figure 1 we have that:\n",
"\n",
"$$\n",
"\\sin{\\frac{\\alpha}{2}} = \\frac{d}{2R}\n",
"$$\n",
"\n",
"which gives:\n",
"\n",
"$$\n",
"\\sin(\\alpha) = \\frac{d}{R} \\cdot \\sqrt{1-(\\frac{d}{2R})^2} = \\frac{d}{2R^2} \\cdot \\sqrt{4R^2-d^2}\n",
"$$\n",
"\n",
"and in therms of $d$ and $R$ the distance $D$ is given by:\n",
"\n",
"$$\n",
"D = R \\alpha = R \\sin^{-1}{(\\frac{d}{2R^2}\\cdot \\sqrt{4R^2-d^2})}\n",
"$$\n",
"\n",
"<img src=\"../images/sc1.svg\" width=\"80%\">\n",
"<center>Figure 1</center>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Distance on curved surface\n",
"\n",
"The shortest path between two points on a curved surface is colled *geodesic* which in case of a spheroid is also colled *Great Circle*.\n",
"Considering two points: $P_1(\\lambda_1,\\phi_1), P_2(\\lambda_2,\\phi_2)$, The great circle distance $d$ between $P_1$ and $P_2$ is given by eq.2: \n",
"\n",
"$$\n",
"d = 2 \\cdot \\arcsin(\\sqrt{\\sin{(\\frac{\\phi_1-\\phi_2}{2})}^2 + \\cos(\\phi_1) \\cdot \\cos(\\phi_2) \\cdot (\\sin{\\frac{\\lambda_1-\\lambda_2}{2}})^2} \\quad (2)\n",
"$$\n",
"\n",
"This approach is good enough for most purposes but for more accurate results, the computation needs to be performed on an ellipsoid of revolution. \n",
"\n",
"The shortes distance between two points on the ellipse surface is also known as *Geodesics on an ellipsoid* and can be computed by the algorithms given in [*Algorithms for geodesics* Karney (2013)](http://link.springer.com/article/10.1007%2Fs00190-012-0578-z) which is implemented in the [geographiclib](http://geographiclib.sourceforge.net/) software, internally adopted by the proj library.\n",
"\n",
"\n",
"---\n",
"\n",
"## The direct and Inverse Geodesic Problems on a Ellipsoid of revolution\n",
"\n",
"\n",
"The problems in geodesy are usually reduced to two main cases: the direct problem, given a starting point and an initial heading, find the position after traveling a certain distance along the geodesic; and the inverse problem, given two points on the ellipsoid find the connecting geodesic and hence the shortest distance between them. Because the flattening of the Earth is small, the geodesic distance between two points on the Earth is well approximated by the great-circle distance using the mean Earth radius - the relative error is less than 1%. However, the course of the geodesic can differ dramatically from that of the great circle. As an extreme example, consider two points on the equator with a longitude difference of $179^\\circ59'$; while the connecting great circle follows the equator, the shortest geodesics pass within 180 km of either pole (the flattening makes two symmetric paths passing close to the poles shorter than the route along the equator).\n",
"\n",
" It is possible to reduce the various geodesic problems into one of two types. Consider two points: $A$ at latitude $\\phi_1$ and longitude $\\lambda_1$ and $B$ at latitude $\\phi_2$ and longitude $\\lambda_2$ (see Fig. 3). The connecting geodesic (from $A$ to $B$) is $AB$, of length $s_{12}$, which has azimuths $\\alpha_1$ and $\\alpha_2$ at the two endpoints. \n",
"\n",
" The two geodesic problems usually considered are:\n",
"\n",
" * the **direct geodesic problem** or first geodesic problem, determine $\\phi_{2}$, $\\lambda_{12}$, and $\\alpha_2$, given $\\phi_1$, $\\alpha_1$ and $s_{12}$; \n",
"\n",
" * the **inverse geodesic problem** or second geodesic problem, determine $s_{12}$, $\\alpha_1$ and $\\alpha_2$ given $\\phi_1$, $\\phi_2$, and $\\lambda_{12}$. \n",
"\n",
"\n",
"<img src=\"../images/Geodesic_problem_on_an_ellipsoid.svg\" width=\"50%\">\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"FIG. 2 The ellipsoidal triangle $NAB$. $N$ is the north pole, $NA$ and\n",
"$NB$ are *meridians*, and $AB$ is a *geodesic* of length $s_{12}$. The longitude\n",
"of $B$ relative to $A$ is $\\lambda_{12}$; the latitudes of $A$ and $B$ are $\\phi_1$ and\n",
"$\\phi_2$. $EFH$ is the *equator* with $E$ also lying on the extension of the\n",
"geodesic $AB$; and $\\alpha_0$, $\\alpha_1$, and $\\alpha_2$ are the azimuths of the geodesic\n",
"at $E$, $A$, and $B$. \n",
"\n",
"[source](https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"### The inverse geodesic problem\n",
"\n",
"**Example:**\n",
"\n",
"Calculate the distance between two points, as well as the local heading:\n",
"\n",
"* First we import the class [```Geod```](http://jswhit.github.io/pyproj/pyproj.Geod-class.html) then we define a reference ellipsoid where ```ellps='WGS84'``` selects WGS84 reference ellipsoid. ```help(Geod.__new__)``` gives a list of possible ellipsoids."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from pyproj import Geod\n",
"g = Geod(ellps='WGS84')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Set two location for which we want compute the measurments, in this example $P_1$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"lat1,lon1 = (40.7143528, -74.0059731) # New York, NY\n",
"lat2,lon2 = (1.359, 103.989) # Delhi, India\n",
"az12,az21,dist = g.inv(lon1,lat1,lon2,lat2)\n",
"az12,az21,dist"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# using geograhiclib:\n",
"# Compute path from 1 to 2\n",
"from geographiclib.geodesic import Geodesic\n",
"g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2)\n",
"g"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note: \n",
"* pyproj takes as input longitude first then latitude\n",
"* the output of geographiclib and pyproj for the backward azimuth are complementary of 180^{\\circ}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The direct geodesic problem:\n",
"\n",
"**Example:**\n",
"\n",
"Compute the midpoint on the path from 1 to 2 starting at 1"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"h = Geodesic.WGS84.Direct(lat1, lon1, g['azi1'], g['s12']/2)\n",
"print(h['lat2'], h['lon2']);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Geodetic curve\n",
"\n",
"**Example:**\n",
"\n",
"Compute a list of points along the $geodesic \\ curve$ with a fixed distance of $100000m$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"gc = [Geodesic.WGS84.Direct(lat1, lon1, g['azi1'], i) for i in range(0,int(g['s12']),100000)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Extract *Latitude* and *Longitude* from and add the destination point which is missed in the previous list"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"lat = [i['lat2'] for i in gc]\n",
"lat.append(lat2)\n",
"lon = [i['lon2'] for i in gc]\n",
"lon.append(lon2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can plot the resulting geodesic with:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"plt.plot(lon,lat,'-');"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"### Surface's area on the ellipsoid\n",
"The Geodesic class in geographiclib can be also used to compute the area on an ellipsoidal surface, see example:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Computing the area of a geodesic polygon\n",
"def p(lat,lon): return {'lat': lat, 'lon': lon}\n",
"Geodesic.WGS84.Area([p(0, 0), p(0, 90), p(90, 0)])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"[top](#Notebooks---Numerical-Cartography)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,446 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Numerical Cartography](../numerical cartography)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Working with Coordinates\n",
"\n",
"* [Coordinate notation](#Coordinate-notation)\n",
"* [Coordinate conversion](#Coordinate-conversion)\n",
"* [Datum transformation](#Datum-transformation)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Coordinate notation\n",
"To express the values for the geographic longitude and latitude there are different notations, the most used are:\n",
" * **degimal degrees** (eg: $30.263888889^{\\circ}$)\n",
" * **sessagesimal degrees** (eg: $ 30^{\\circ} 15^{'} 50^{\"}$)\n",
"\n",
"A simple example to convert back and forward those 2 different notations is shown below:\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's use the IPython magic funcion ```%%file``` to make a simple comma separated value (CSV) file'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%file test.csv\n",
"30.263888889,45.563456\n",
"23.457654,34.433425"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"now read the CSV using [pandas](), we'll create a [pandas.dataframe]() using the [pandas.read_csv]() method:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"input = pd.read_csv('test.csv', names=['Latitude', 'Longitude'])\n",
"input"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Simple code to convert between the two notations:\n",
"\n",
"* d2s: convert from decimal degrees to sessagesimal degrees\n",
"* s2d: convert from sessagesimal degrees to decimal degrees"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"def d2s(df,key='Latitude'):\n",
" '''convert from decimal degrees to sessagesimal degrees\n",
" take as input a pandas dataframe and a column name'''\n",
" g = df[key].values.astype(int)\n",
" p = ((( df[key].values) - df[key].values.astype(int))*60).astype(int)\n",
" s = (((df[key].values - df[key].values.astype(int)) * 60. ) - p ) * 60.\n",
" param = key\n",
" ses = pd.DataFrame(np.array([g,p,s]).T, columns=['Degree','Minute','Second'] , dtype=float)\n",
" return ses\n",
"\n",
"def s2d(df,key=['Degree','Minute','Second']):\n",
" '''convert from sessagesimal degrees to decimal degrees\n",
" take as input a pandas dataframe and a list of column names'''\n",
" deg=df[key[0]].values+(df[key[1]].values/60.+df[key[2]].values/3600.)\n",
" return deg"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# convert from decimal degrees to sessagesimal degree"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"Lat = d2s(df=input,key='Latitude')\n",
"Lon = d2s(df=input,key='Longitude')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"Lat"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"Lon"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# convert from sessagesimal degree to decimal degree"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"s2d(Lat)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"s2d(Lon)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Coordinate conversion\n",
"\n",
"Common task when working with points is to convert their coordinates from Latitude and Longitude to UTM and viceversa. \n",
"Common example is the position reported by a GPS receiver which usually report the position latitude and longitude expressed in decimal degrees and referred to the WGS84 ellipsoid. In this case we have a two way conversion:\n",
" * from Geographic to UTM\n",
" * from UTM to Geographic\n",
"Note: this is an exact conversion, it is not a transformation of coordinates. The point is located on the same ellipsoid *WGS84* and the conversion between the two different notation does not involve any approssimation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Example:**\n",
"\n",
"We want find the UTM coordinates for the point. For the purpose of this excercize we will use the [pyproj](http://jswhit.github.io/pyproj/) module (python wrapper of the widely used Cartographic Projections Library: [PROJ](https://github.com/OSGeo/proj.4/wiki).\n",
"\n",
"\n",
"$$P(longitude,latitude) :\\quad -70.9393^{\\circ}, 43.1356^{\\circ}$$\n",
"\n",
"The UTM coordinate system is divided in 60 different zones, each zone has its own definition and can be easly identified by an unic ID using its [EPSG code](). \n",
"Our point P falls in the state of New Hampshire (US) which is included in the 19th fuse of the UTM system.\n",
"To find out which EPSG code is assigned to the UTM zone 19th on the WGS84 ellipsoid, we can use services like [EPSG.io](http://epsg.io/) which are based on the [EPSG API](http://www.ogp.org.uk/pubs/373-07-3.pdf) and look for: \n",
"\n",
"```WGS 84 / UTM zone 19N```\n",
"\n",
"\n",
"Which will return : \n",
"\n",
"[```EPSG:32619```](http://epsg.io/32619)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Longitude Latitude WGS84 -> UTM 19N / WGS 84"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"#import the pyproj library\n",
"import pyproj\n",
"\n",
"# set point P coordinates: \n",
"P = (-70.93931369842528, 43.13567095719326)\n",
"\n",
"# define projection UTM 19 N: \n",
"# UTM zone 19, WGS84 ellipse, WGS84 datum, defined by epsg code 32619\n",
"p1 = pyproj.Proj(init='epsg:32619')\n",
"\n",
"#Find UTM coordinates for the point P(-70.93931369842528,43.13567095719326)\n",
"x1, y1 = p1(P[0],P[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x1, y1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"You can easly verify the results of the conversion using the [epsg.io map widget](http://epsg.io/32619/map) on and look for:\n",
"\n",
"```Jere A. Chase Ocean Engineering Laboratory\n",
"24 Colovos Road, Durham, NH 03824, United States```\n",
"\n",
"which will show the coordinated of the point $P$ in longitude and lattude on the upper right and in UTM on the center bottom.\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Datum transformation \n",
"(Change in reference system)\n",
"\n",
"\n",
"A reference system is a set of rules and measurments to establish the spatio-temporal position of a point location, regardless off the coordinate system. This system of rules and measurments must lock the degrees of freedom left free from the relative measurments. A coordinate system can be referenced to celestial bodies (quasi-inertial-reference-frame) or the more practical systems referenced to the earth. In the case of earth referenced system a SRS is defined by:\n",
"\n",
"* A Reference Surface (Ellipsoid)\n",
"* Its Localization, where the ellipsoid can be earth-centered (WGS84) or oriented locally (eg. Gauss Boaga Roma 1940)\n",
"\n",
"A change in reference system can not be confused with coordinate transformation, which are pure mathematical transformations. Those problems can be separted in :\n",
"\n",
"* Coordinate Transformation\n",
"* Change in Reference System (or DATUM change)\n",
"\n",
"\n",
"\n",
"A Change in reference System is a tranformation which involve the estimation of a set of transformation parameteres. there are different methods which can be used to estimate those parameters besed on a set of reference points which coodinates are know in different reference systems. The proj library can be used to perform DATUM changes, see examples below: "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Example** \n",
"\n",
"* UTM 19N / WGS 84 -> UTM 19N NAD 83 "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# define projection 1: \n",
"# UTM zone 19, WGS84 ellipse, WGS84 datum, defined by epsg code 32619\n",
"p1 = pyproj.Proj(init='epsg:32619')\n",
"\n",
"# define projection 2: UTM zone 19, GRS 1980 ellipse, NAD83 datum\n",
"p2 = pyproj.Proj(init='epsg:26919')\n",
"\n",
"# transform the UTM coordinates for the point P to projection 2 coordinates.\n",
"x2, y2 = pyproj.transform(p1,p2,x1,y1)\n",
"\n",
"x2, y2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* UTM 19N / WGS 84 -> UTM 19N NAD 27 "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# define projection: UTM zone 19, Clarke 1866, NAD27 datum\n",
"p3 = pyproj.Proj(init='epsg:26719')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# transform the UTM coordinates for the point P to projection 3 coordinates.\n",
"x3, y3 = pyproj.transform(p1,p3,x1,y1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x3, y3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note: \n",
"\n",
"The earth is in constant movment (Plate tectonics theory). Geodesist costantly redefine the specification of ellipsoid used as reference for the various CRS. The initial definition of NAD83(1986) was intended to match GRS80 and WGS84. In this example we are considering the *original* CRS means the WGS84 with ellipsoid epoc:1984 and the NAD 83 as defined in the 1986.\n",
"\n",
"This explain how close are the coordinates for the two CRS *UTM 19 N / WGS 84* and *UTM 19 N / NAD 83* which for the epoc of their definition are almost identical.\n",
"To perform a more accurate transformation it is possible to specify the projection parameters esplicitly using the proj format string.\n",
"read more: [WGS84 and NAD83](http://www.ngs.noaa.gov/CORS/Articles/WGS84NAD83.pdf), [North American Datum](https://en.wikipedia.org/wiki/North_American_Datum)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"The problem of parameter estimation is developed on a dedicated in the [geometric transformations notebook](geometric-transformation.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"[top](#Notebooks---Numerical-Cartography)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,39 +0,0 @@
3.422912163342935964e+05 4.777708363479495049e+06
3.422782157168605481e+05 4.777719609494659118e+06
3.423545907314916840e+05 4.777686690010458231e+06
3.423293789643431664e+05 4.777752671567500569e+06
3.423605667458042153e+05 4.777749803438861854e+06
3.423286234383938718e+05 4.777758233755520545e+06
3.422921102028324385e+05 4.777680539965643547e+06
3.423084001501134480e+05 4.777715347229405306e+06
3.423141297988953302e+05 4.777710206223327667e+06
3.423631288104497944e+05 4.777739211742747575e+06
3.423616771706063300e+05 4.777675336521958001e+06
3.423315747092103702e+05 4.777755557462602854e+06
3.422986577041121200e+05 4.777754426113739610e+06
3.423087721074186848e+05 4.777774424985138699e+06
3.423593398088301765e+05 4.777767298533591442e+06
3.423437207195073715e+05 4.777764740105740726e+06
3.423125203038558247e+05 4.777751368158218451e+06
3.423177895305947168e+05 4.777772078216431662e+06
3.423729655577609083e+05 4.777677045514377765e+06
3.422924716844965005e+05 4.777738123743905686e+06
3.422815934639840270e+05 4.777755441929566674e+06
3.422968649299088283e+05 4.777758021469592117e+06
3.422918521171669126e+05 4.777702369702809490e+06
3.423218499302327400e+05 4.777743188259245828e+06
3.423527956861563143e+05 4.777736645840060897e+06
3.423220390922487131e+05 4.777729765366605483e+06
3.423022520358908805e+05 4.777723227641544305e+06
3.422942833648278611e+05 4.777741083191342652e+06
3.423732935167739633e+05 4.777691814718367532e+06
3.423593043748752680e+05 4.777678822556014173e+06
3.423142335312287323e+05 4.777678084696033970e+06
3.423599475150681101e+05 4.777717610747885890e+06
3.423014475538718398e+05 4.777724469547622837e+06
3.423273803285624017e+05 4.777757717194980942e+06
3.423182861247092369e+05 4.777676338737960905e+06
3.422849519077860750e+05 4.777772453777041286e+06
3.423330844255984994e+05 4.777678391670132056e+06
3.423035510877568740e+05 4.777731407477849163e+06
3.423500956392732915e+05 4.777714946433324367e+06
1 3.422912163342935964e+05 4.777708363479495049e+06
2 3.422782157168605481e+05 4.777719609494659118e+06
3 3.423545907314916840e+05 4.777686690010458231e+06
4 3.423293789643431664e+05 4.777752671567500569e+06
5 3.423605667458042153e+05 4.777749803438861854e+06
6 3.423286234383938718e+05 4.777758233755520545e+06
7 3.422921102028324385e+05 4.777680539965643547e+06
8 3.423084001501134480e+05 4.777715347229405306e+06
9 3.423141297988953302e+05 4.777710206223327667e+06
10 3.423631288104497944e+05 4.777739211742747575e+06
11 3.423616771706063300e+05 4.777675336521958001e+06
12 3.423315747092103702e+05 4.777755557462602854e+06
13 3.422986577041121200e+05 4.777754426113739610e+06
14 3.423087721074186848e+05 4.777774424985138699e+06
15 3.423593398088301765e+05 4.777767298533591442e+06
16 3.423437207195073715e+05 4.777764740105740726e+06
17 3.423125203038558247e+05 4.777751368158218451e+06
18 3.423177895305947168e+05 4.777772078216431662e+06
19 3.423729655577609083e+05 4.777677045514377765e+06
20 3.422924716844965005e+05 4.777738123743905686e+06
21 3.422815934639840270e+05 4.777755441929566674e+06
22 3.422968649299088283e+05 4.777758021469592117e+06
23 3.422918521171669126e+05 4.777702369702809490e+06
24 3.423218499302327400e+05 4.777743188259245828e+06
25 3.423527956861563143e+05 4.777736645840060897e+06
26 3.423220390922487131e+05 4.777729765366605483e+06
27 3.423022520358908805e+05 4.777723227641544305e+06
28 3.422942833648278611e+05 4.777741083191342652e+06
29 3.423732935167739633e+05 4.777691814718367532e+06
30 3.423593043748752680e+05 4.777678822556014173e+06
31 3.423142335312287323e+05 4.777678084696033970e+06
32 3.423599475150681101e+05 4.777717610747885890e+06
33 3.423014475538718398e+05 4.777724469547622837e+06
34 3.423273803285624017e+05 4.777757717194980942e+06
35 3.423182861247092369e+05 4.777676338737960905e+06
36 3.422849519077860750e+05 4.777772453777041286e+06
37 3.423330844255984994e+05 4.777678391670132056e+06
38 3.423035510877568740e+05 4.777731407477849163e+06
39 3.423500956392732915e+05 4.777714946433324367e+06

View File

@ -1,11 +0,0 @@
1.978389466757818127e+03 2.600103997766116208e+03 -4.447909021953819320e+01 -4.447909021953819320e+01 6.766456579720241393e+01
7.908463271558746328e+02 6.547737260882857299e+03 -2.812199009949108586e+01 -2.812199009949108586e+01 8.566553325602271229e+01
1.452273564734256013e+02 2.612379133614808325e+03 1.205103134480305016e+01 1.205103134480305016e+01 5.251291736409465472e+01
2.332904357842272702e+01 2.911646671143583442e-01 -4.830014863167889416e+00 -4.830014863167889416e+00 4.860062576298487258e+00
1.655297537144174669e+02 1.101109361948072092e+03 -1.286583668924868107e+01 -1.286583668924868107e+01 3.558987377980553646e+01
1.688578507270145792e+03 1.343781978106754309e+02 -4.109231688856380060e+01 -4.109231688856380060e+01 4.269609707081926331e+01
5.094404974419163409e+03 1.940555514275953101e+03 -7.137510052125435323e+01 -7.137510052125435323e+01 8.387467131795580144e+01
1.100444998912308847e+03 3.110385581711209468e+01 -3.317295583622762933e+01 -3.317295583622762933e+01 3.363850256372035830e+01
2.859683432441775039e+02 8.538166380402031791e+03 -1.691059854777995497e+01 -1.691059854777995497e+01 9.393686562604806056e+01
7.437398783190085396e+02 5.837298511210867673e+02 2.727159471536288038e+01 2.727159471536288038e+01 3.643445799569543908e+01
2.357307268079355822e+02 4.794710396427706655e+03 1.535352489846991375e+01 1.535352489846991375e+01 7.092560273438388663e+01

View File

@ -1,39 +0,0 @@
2.064013399979405804e+06 2.527568450695585925e+06
2.064015310498731676e+06 2.527572168211209588e+06
2.064010876084983582e+06 2.527561745495231356e+06
2.064023628127294593e+06 2.527584168362472672e+06
2.064023983221007977e+06 2.527583554294669069e+06
2.064024744515819708e+06 2.527586075012133457e+06
2.064007728347476106e+06 2.527558878598755691e+06
2.064015349598729052e+06 2.527571061907502357e+06
2.064014469787606271e+06 2.527569359929558821e+06
2.064021891317288158e+06 2.527579937059946358e+06
2.064008764908507699e+06 2.527557920129151549e+06
2.064024285557228373e+06 2.527585188622335903e+06
2.064023059137996053e+06 2.527584404519833159e+06
2.064027460846573114e+06 2.527591413643736858e+06
2.064027529399807565e+06 2.527589565171923023e+06
2.064026533360063331e+06 2.527588496824185830e+06
2.064022851717550075e+06 2.527583517425369937e+06
2.064027252682636492e+06 2.527590713435207959e+06
2.064009456105090212e+06 2.527558644021213520e+06
2.064019533246013336e+06 2.527578715610704385e+06
2.064022751574630383e+06 2.527584549914621282e+06
2.064023741349519696e+06 2.527585621334312949e+06
2.064012191580488347e+06 2.527566393971564714e+06
2.064021458280684892e+06 2.527580811941999011e+06
2.064021053492104402e+06 2.527578929485790431e+06
2.064018714790886734e+06 2.527576191163214855e+06
2.064016777838508133e+06 2.527573702364616096e+06
2.064020194127746858e+06 2.527579756597421132e+06
2.064012490948160645e+06 2.527563734666728415e+06
2.064009407182266237e+06 2.527559092328585219e+06
2.064007893990268232e+06 2.527558298070536926e+06
2.064017370974752121e+06 2.527572459231906570e+06
2.064017007889525034e+06 2.527574120455473196e+06
2.064024601150088012e+06 2.527585882203771267e+06
2.064007658859205898e+06 2.527557745302364696e+06
2.064026337341638748e+06 2.527590449303772300e+06
2.064008526526518865e+06 2.527558629697103053e+06
2.064018492442323128e+06 2.527576535187516827e+06
2.064016527540989453e+06 2.527571423532922287e+06

View File

@ -1,39 +0,0 @@
3.422929459818373434e+05 4.777758547049066052e+06
3.422799453223920427e+05 4.777769793108726852e+06
3.423563205879068119e+05 4.777736873489562422e+06
3.423311087447133032e+05 4.777802855301403441e+06
3.423622966299222899e+05 4.777799987157991156e+06
3.423303532169256941e+05 4.777808417510733940e+06
3.422938398499406176e+05 4.777730723428966478e+06
3.423101298558725393e+05 4.777765530823504552e+06
3.423158595231474028e+05 4.777760389797111973e+06
3.423648587018180988e+05 4.777789395421157591e+06
3.423634070492797182e+05 4.777725519956881180e+06
3.423333044972642092e+05 4.777805741207243875e+06
3.423003873821545858e+05 4.777804609858110547e+06
3.423105018216792960e+05 4.777824608804556541e+06
3.423610696910028928e+05 4.777817482319610193e+06
3.423454505492313183e+05 4.777814923883918673e+06
3.423142500277939253e+05 4.777801551889221184e+06
3.423195192746657995e+05 4.777822262025788426e+06
3.423746954743234091e+05 4.777727228954433464e+06
3.422942013398876297e+05 4.777788307426848449e+06
3.422833230851933477e+05 4.777805625679909252e+06
3.422985946024091681e+05 4.777808205227898434e+06
3.422935817660962930e+05 4.777752553249437362e+06
3.423235796843066346e+05 4.777793371957898140e+06
3.423545255427188240e+05 4.777786829509952106e+06
3.423237688453044975e+05 4.777779949014030397e+06
3.423039817220967961e+05 4.777773411266461015e+06
3.422960130266298074e+05 4.777791266885352321e+06
3.423750234362460906e+05 4.777741998214723542e+06
3.423610342460570391e+05 4.777729006004527211e+06
3.423159632518796716e+05 4.777728268147272058e+06
3.423616773931632051e+05 4.777767794344286434e+06
3.423031772375451983e+05 4.777774653177375905e+06
3.423291101028814446e+05 4.777807900948377326e+06
3.423200158586726175e+05 4.777726522182039917e+06
3.422866815422959626e+05 4.777822637591866776e+06
3.423348142092088237e+05 4.777728575120223686e+06
3.423052807793040993e+05 4.777781591133809648e+06
3.423518254841567832e+05 4.777765130020772107e+06
1 3.422929459818373434e+05 4.777758547049066052e+06
2 3.422799453223920427e+05 4.777769793108726852e+06
3 3.423563205879068119e+05 4.777736873489562422e+06
4 3.423311087447133032e+05 4.777802855301403441e+06
5 3.423622966299222899e+05 4.777799987157991156e+06
6 3.423303532169256941e+05 4.777808417510733940e+06
7 3.422938398499406176e+05 4.777730723428966478e+06
8 3.423101298558725393e+05 4.777765530823504552e+06
9 3.423158595231474028e+05 4.777760389797111973e+06
10 3.423648587018180988e+05 4.777789395421157591e+06
11 3.423634070492797182e+05 4.777725519956881180e+06
12 3.423333044972642092e+05 4.777805741207243875e+06
13 3.423003873821545858e+05 4.777804609858110547e+06
14 3.423105018216792960e+05 4.777824608804556541e+06
15 3.423610696910028928e+05 4.777817482319610193e+06
16 3.423454505492313183e+05 4.777814923883918673e+06
17 3.423142500277939253e+05 4.777801551889221184e+06
18 3.423195192746657995e+05 4.777822262025788426e+06
19 3.423746954743234091e+05 4.777727228954433464e+06
20 3.422942013398876297e+05 4.777788307426848449e+06
21 3.422833230851933477e+05 4.777805625679909252e+06
22 3.422985946024091681e+05 4.777808205227898434e+06
23 3.422935817660962930e+05 4.777752553249437362e+06
24 3.423235796843066346e+05 4.777793371957898140e+06
25 3.423545255427188240e+05 4.777786829509952106e+06
26 3.423237688453044975e+05 4.777779949014030397e+06
27 3.423039817220967961e+05 4.777773411266461015e+06
28 3.422960130266298074e+05 4.777791266885352321e+06
29 3.423750234362460906e+05 4.777741998214723542e+06
30 3.423610342460570391e+05 4.777729006004527211e+06
31 3.423159632518796716e+05 4.777728268147272058e+06
32 3.423616773931632051e+05 4.777767794344286434e+06
33 3.423031772375451983e+05 4.777774653177375905e+06
34 3.423291101028814446e+05 4.777807900948377326e+06
35 3.423200158586726175e+05 4.777726522182039917e+06
36 3.422866815422959626e+05 4.777822637591866776e+06
37 3.423348142092088237e+05 4.777728575120223686e+06
38 3.423052807793040993e+05 4.777781591133809648e+06
39 3.423518254841567832e+05 4.777765130020772107e+06

View File

@ -1,11 +0,0 @@
1.827514849090759071e+03 6.522909899333442230e-01 -4.274944267579121515e+01 -8.076453367248177528e-01 4.275707122898728585e+01
6.965579631850191618e+02 9.446080000573367670e+02 -2.639238456799648702e+01 -3.073447575699537992e+01 4.051130660991269394e+01
1.899128674518138382e+02 8.611084237739897729e-01 1.378088775993091986e+01 -9.279592791572213173e-01 1.381209527463475872e+01
9.611453911780213133e+00 2.572856273883934591e+03 -3.100234493031166494e+00 5.072333066631108522e+01 5.081798626269753072e+01
1.240094396674397075e+02 2.890255406721320242e+02 -1.113595257117412984e+01 1.700075117964297533e+01 2.032326204967036531e+01
1.549409425885939982e+03 3.816263830190159297e+03 -3.936253835674142465e+01 6.177591626346111298e+01 7.325075601026995287e+01
4.850489181112841834e+03 3.759807026621512449e+01 -6.964545341307530180e+01 6.131726532243192196e+00 6.991485715768185116e+01
9.886779754133335700e+02 1.989740824223240679e+03 -3.144325007713632658e+01 4.460651100706309080e+01 5.457489165941215248e+01
2.304589443820674148e+02 1.782412315270601539e+03 -1.518087429570732638e+01 -4.221862521767616272e+01 4.486503381980971028e+01
8.410861950611457587e+02 6.772057166826442653e+02 2.900148608366725966e+01 2.602317652944475412e+01 3.896526545198672409e+01
2.918426775989730686e+02 3.632993220449951082e+02 1.708340357185807079e+01 -1.906041243113577366e+01 2.559574182640480089e+01

View File

@ -1,39 +0,0 @@
2.316988718236539047e+06 2.316989923617559485e+06
2.316991206521165557e+06 2.316992411904087756e+06
2.316984585177985020e+06 2.316985790554276668e+06
2.317000066662767436e+06 2.317001272048795130e+06
2.316999913858471438e+06 2.317001119243239053e+06
2.317001395422035828e+06 2.317002600808846299e+06
2.316982021601219662e+06 2.316983226978405379e+06
2.316990699979538098e+06 2.316991905361037236e+06
2.316989558803481981e+06 2.316990764184118249e+06
2.316997403017701115e+06 2.316998608400946949e+06
2.316981968791500200e+06 2.316983174166040029e+06
2.317000800807242282e+06 2.317002006193603855e+06
2.316999958939703647e+06 2.317001164326825179e+06
2.317004958271767944e+06 2.317006163661346771e+06
2.317004113154164050e+06 2.317005318541361485e+06
2.317003225969550200e+06 2.317004431356831454e+06
2.316999460837029852e+06 2.317000666223347187e+06
2.317004547994936816e+06 2.317005753383943345e+06
2.316982576205298305e+06 2.316983781579758041e+06
2.316995919256105088e+06 2.316997124641166069e+06
2.316999909075448755e+06 2.317001114463183563e+06
2.317000795296176337e+06 2.317002000683840364e+06
2.316987283297451679e+06 2.316988488677633926e+06
2.316997648780915421e+06 2.316998854165853467e+06
2.316996605400731321e+06 2.316997810783913359e+06
2.316994413927414920e+06 2.316995619310509413e+06
2.316992494775680359e+06 2.316993700158429798e+06
2.316996664501544088e+06 2.316997869886959903e+06
2.316986144759580493e+06 2.316987350136053748e+06
2.316982768735363614e+06 2.316983974110446405e+06
2.316981811670428608e+06 2.316983017046663444e+06
2.316992137031177524e+06 2.316993342411553953e+06
2.316992780467033852e+06 2.316993985849976074e+06
2.317001249320425559e+06 2.317002454707198776e+06
2.316981460526475683e+06 2.316982665902358480e+06
2.317004071049200371e+06 2.317005276439171284e+06
2.316982211556021124e+06 2.316983416931774002e+06
2.316994490520538297e+06 2.316995695904371329e+06
2.316991323994982522e+06 2.316992529375268146e+06

View File

@ -1,39 +0,0 @@
342291.05311720056 4777740.363479495 6371005.4184823455
342278.0525059667 4777751.609494659 6371000.550520975
342354.4274841794 4777718.690010458 6371002.766752425
342329.2157290528 4777784.671567501 6371004.462662099
342360.40349564236 4777781.803438862 6371004.26562463
342328.46020346374 4777790.233755521 6371002.675618865
342291.94698531314 4777712.539965644 6371001.032911824
342308.2369248265 4777747.347229405 6371001.303604851
342313.9665708763 4777742.206223328 6371009.724931769
342362.9655590662 4777771.211742748 6371000.423834801
342361.51391991496 4777707.336521958 6371005.347219641
342331.41147287295 4777787.557462603 6371005.661907915
342298.49448347074 4777786.42611374 6371005.715945015
342308.6088819544 4777806.424985139 6371000.123961099
342359.17655925336 4777799.298533591 6371005.528996964
342343.5574773783 4777796.740105741 6371003.93870471
342312.35707660427 4777783.368158218 6371003.696283833
342317.62630083057 4777804.078216432 6371005.768622835
342372.80230168684 4777709.045514378 6371000.675273723
342292.30846680485 4777770.123743906 6371007.363129526
342281.4302514795 4777787.441929567 6371008.91544675
342296.70171012235 4777790.021469592 6371009.537946073
342291.6888997707 4777734.3697028095 6371009.633000482
342321.6866985325 4777775.188259246 6371000.731247326
342352.63243969996 4777768.645840061 6371000.981828988
342321.87586045824 4777761.7653666055 6371000.672535302
342302.0888135356 4777755.227641544 6371006.185327406
342294.12014627235 4777773.083191343 6371002.7325193
342373.1302605435 4777723.8147183675 6371007.242484645
342359.14112531533 4777710.822556014 6371009.1910049375
342314.07030316023 4777710.084696034 6371006.937534979
342359.7842652015 4777749.610747886 6371001.56097916
342301.2843319002 4777756.469547623 6371008.458509415
342327.21709422505 4777789.717194981 6371003.3524289075
342318.1228947083 4777708.338737961 6371001.168572855
342284.78869368014 4777804.453777041 6371005.632761033
342332.9211885412 4777710.391670132 6371009.397662129
342303.3878647822 4777763.407477849 6371009.832818288
342349.9323941044 4777746.946433324 6371000.875813973
1 342291.05311720056 4777740.363479495 6371005.4184823455
2 342278.0525059667 4777751.609494659 6371000.550520975
3 342354.4274841794 4777718.690010458 6371002.766752425
4 342329.2157290528 4777784.671567501 6371004.462662099
5 342360.40349564236 4777781.803438862 6371004.26562463
6 342328.46020346374 4777790.233755521 6371002.675618865
7 342291.94698531314 4777712.539965644 6371001.032911824
8 342308.2369248265 4777747.347229405 6371001.303604851
9 342313.9665708763 4777742.206223328 6371009.724931769
10 342362.9655590662 4777771.211742748 6371000.423834801
11 342361.51391991496 4777707.336521958 6371005.347219641
12 342331.41147287295 4777787.557462603 6371005.661907915
13 342298.49448347074 4777786.42611374 6371005.715945015
14 342308.6088819544 4777806.424985139 6371000.123961099
15 342359.17655925336 4777799.298533591 6371005.528996964
16 342343.5574773783 4777796.740105741 6371003.93870471
17 342312.35707660427 4777783.368158218 6371003.696283833
18 342317.62630083057 4777804.078216432 6371005.768622835
19 342372.80230168684 4777709.045514378 6371000.675273723
20 342292.30846680485 4777770.123743906 6371007.363129526
21 342281.4302514795 4777787.441929567 6371008.91544675
22 342296.70171012235 4777790.021469592 6371009.537946073
23 342291.6888997707 4777734.3697028095 6371009.633000482
24 342321.6866985325 4777775.188259246 6371000.731247326
25 342352.63243969996 4777768.645840061 6371000.981828988
26 342321.87586045824 4777761.7653666055 6371000.672535302
27 342302.0888135356 4777755.227641544 6371006.185327406
28 342294.12014627235 4777773.083191343 6371002.7325193
29 342373.1302605435 4777723.8147183675 6371007.242484645
30 342359.14112531533 4777710.822556014 6371009.1910049375
31 342314.07030316023 4777710.084696034 6371006.937534979
32 342359.7842652015 4777749.610747886 6371001.56097916
33 342301.2843319002 4777756.469547623 6371008.458509415
34 342327.21709422505 4777789.717194981 6371003.3524289075
35 342318.1228947083 4777708.338737961 6371001.168572855
36 342284.78869368014 4777804.453777041 6371005.632761033
37 342332.9211885412 4777710.391670132 6371009.397662129
38 342303.3878647822 4777763.407477849 6371009.832818288
39 342349.9323941044 4777746.946433324 6371000.875813973

View File

@ -1,50 +0,0 @@
342335.69542451313 4777759.354694403 6371000.083465349
342306.33770696004 4777800.527584484 6371000.843596581
342342.5397001469 4777737.801448842 6371008.514729953
342334.20897920633 4777752.131970737 6371002.572837907
342373.43258249346 4777782.9864068115 6371006.264778466
342369.71575528244 4777746.6415944705 6371006.306293758
342363.4853033537 4777724.591702434 6371004.960059014
342341.5731059497 4777720.9243124975 6371009.182836227
342331.0403974431 4777802.60842233 6371008.517891462
342335.85721573443 4777763.372244628 6371004.037062062
342346.32364570786 4777744.580369312 6371002.389314775
342291.05311720056 4777740.363479495 6371005.4184823455
342278.0525059667 4777751.609494659 6371000.550520975
342354.4274841794 4777718.690010458 6371002.766752425
342329.2157290528 4777784.671567501 6371004.462662099
342360.40349564236 4777781.803438862 6371004.26562463
342328.46020346374 4777790.233755521 6371002.675618865
342291.94698531314 4777712.539965644 6371001.032911824
342308.2369248265 4777747.347229405 6371001.303604851
342313.9665708763 4777742.206223328 6371009.724931769
342362.9655590662 4777771.211742748 6371000.423834801
342361.51391991496 4777707.336521958 6371005.347219641
342331.41147287295 4777787.557462603 6371005.661907915
342298.49448347074 4777786.42611374 6371005.715945015
342308.6088819544 4777806.424985139 6371000.123961099
342359.17655925336 4777799.298533591 6371005.528996964
342343.5574773783 4777796.740105741 6371003.93870471
342312.35707660427 4777783.368158218 6371003.696283833
342317.62630083057 4777804.078216432 6371005.768622835
342372.80230168684 4777709.045514378 6371000.675273723
342292.30846680485 4777770.123743906 6371007.363129526
342281.4302514795 4777787.441929567 6371008.91544675
342296.70171012235 4777790.021469592 6371009.537946073
342291.6888997707 4777734.3697028095 6371009.633000482
342321.6866985325 4777775.188259246 6371000.731247326
342352.63243969996 4777768.645840061 6371000.981828988
342321.87586045824 4777761.7653666055 6371000.672535302
342302.0888135356 4777755.227641544 6371006.185327406
342294.12014627235 4777773.083191343 6371002.7325193
342373.1302605435 4777723.8147183675 6371007.242484645
342359.14112531533 4777710.822556014 6371009.1910049375
342314.07030316023 4777710.084696034 6371006.937534979
342359.7842652015 4777749.610747886 6371001.56097916
342301.2843319002 4777756.469547623 6371008.458509415
342327.21709422505 4777789.717194981 6371003.3524289075
342318.1228947083 4777708.338737961 6371001.168572855
342284.78869368014 4777804.453777041 6371005.632761033
342332.9211885412 4777710.391670132 6371009.397662129
342303.3878647822 4777763.407477849 6371009.832818288
342349.9323941044 4777746.946433324 6371000.875813973
1 342335.69542451313 4777759.354694403 6371000.083465349
2 342306.33770696004 4777800.527584484 6371000.843596581
3 342342.5397001469 4777737.801448842 6371008.514729953
4 342334.20897920633 4777752.131970737 6371002.572837907
5 342373.43258249346 4777782.9864068115 6371006.264778466
6 342369.71575528244 4777746.6415944705 6371006.306293758
7 342363.4853033537 4777724.591702434 6371004.960059014
8 342341.5731059497 4777720.9243124975 6371009.182836227
9 342331.0403974431 4777802.60842233 6371008.517891462
10 342335.85721573443 4777763.372244628 6371004.037062062
11 342346.32364570786 4777744.580369312 6371002.389314775
12 342291.05311720056 4777740.363479495 6371005.4184823455
13 342278.0525059667 4777751.609494659 6371000.550520975
14 342354.4274841794 4777718.690010458 6371002.766752425
15 342329.2157290528 4777784.671567501 6371004.462662099
16 342360.40349564236 4777781.803438862 6371004.26562463
17 342328.46020346374 4777790.233755521 6371002.675618865
18 342291.94698531314 4777712.539965644 6371001.032911824
19 342308.2369248265 4777747.347229405 6371001.303604851
20 342313.9665708763 4777742.206223328 6371009.724931769
21 342362.9655590662 4777771.211742748 6371000.423834801
22 342361.51391991496 4777707.336521958 6371005.347219641
23 342331.41147287295 4777787.557462603 6371005.661907915
24 342298.49448347074 4777786.42611374 6371005.715945015
25 342308.6088819544 4777806.424985139 6371000.123961099
26 342359.17655925336 4777799.298533591 6371005.528996964
27 342343.5574773783 4777796.740105741 6371003.93870471
28 342312.35707660427 4777783.368158218 6371003.696283833
29 342317.62630083057 4777804.078216432 6371005.768622835
30 342372.80230168684 4777709.045514378 6371000.675273723
31 342292.30846680485 4777770.123743906 6371007.363129526
32 342281.4302514795 4777787.441929567 6371008.91544675
33 342296.70171012235 4777790.021469592 6371009.537946073
34 342291.6888997707 4777734.3697028095 6371009.633000482
35 342321.6866985325 4777775.188259246 6371000.731247326
36 342352.63243969996 4777768.645840061 6371000.981828988
37 342321.87586045824 4777761.7653666055 6371000.672535302
38 342302.0888135356 4777755.227641544 6371006.185327406
39 342294.12014627235 4777773.083191343 6371002.7325193
40 342373.1302605435 4777723.8147183675 6371007.242484645
41 342359.14112531533 4777710.822556014 6371009.1910049375
42 342314.07030316023 4777710.084696034 6371006.937534979
43 342359.7842652015 4777749.610747886 6371001.56097916
44 342301.2843319002 4777756.469547623 6371008.458509415
45 342327.21709422505 4777789.717194981 6371003.3524289075
46 342318.1228947083 4777708.338737961 6371001.168572855
47 342284.78869368014 4777804.453777041 6371005.632761033
48 342332.9211885412 4777710.391670132 6371009.397662129
49 342303.3878647822 4777763.407477849 6371009.832818288
50 342349.9323941044 4777746.946433324 6371000.875813973

View File

@ -1,11 +0,0 @@
342335.69542451313 4777759.354694403 6371000.083465349
342306.33770696004 4777800.527584484 6371000.843596581
342342.5397001469 4777737.801448842 6371008.514729953
342334.20897920633 4777752.131970737 6371002.572837907
342373.43258249346 4777782.9864068115 6371006.264778466
342369.71575528244 4777746.6415944705 6371006.306293758
342363.4853033537 4777724.591702434 6371004.960059014
342341.5731059497 4777720.9243124975 6371009.182836227
342331.0403974431 4777802.60842233 6371008.517891462
342335.85721573443 4777763.372244628 6371004.037062062
342346.32364570786 4777744.580369312 6371002.389314775
1 342335.69542451313 4777759.354694403 6371000.083465349
2 342306.33770696004 4777800.527584484 6371000.843596581
3 342342.5397001469 4777737.801448842 6371008.514729953
4 342334.20897920633 4777752.131970737 6371002.572837907
5 342373.43258249346 4777782.9864068115 6371006.264778466
6 342369.71575528244 4777746.6415944705 6371006.306293758
7 342363.4853033537 4777724.591702434 6371004.960059014
8 342341.5731059497 4777720.9243124975 6371009.182836227
9 342331.0403974431 4777802.60842233 6371008.517891462
10 342335.85721573443 4777763.372244628 6371004.037062062
11 342346.32364570786 4777744.580369312 6371002.389314775

View File

@ -1,50 +0,0 @@
342298.4392095031 4777535.312657121 6371000.083465349
342269.082130349 4777576.485561934 6371000.843596581
342305.2831913092 4777513.759439655 6371008.514729953
342296.952683646 4777528.08995878 6371002.572837907
342336.17647527845 4777558.944148431 6371006.264778466
342332.45922486135 4777522.599447569 6371006.306293758
342326.228535028 4777500.549639925 6371004.960059014
342304.316397012 4777496.882351936 6371009.182836227
342293.7847290429 4777578.5662904335 6371008.517891462
342298.60104868026 4777539.330196058 6371004.037062062
342309.0672011515 4777520.538326303 6371002.389314775
342253.7968834556 4777516.321680264 6371005.4184823455
342240.7964702017 4777527.567720403 6371000.550520975
342317.1706872105 4777494.648001663 6371002.766752425
342291.95985177247 4777560.629490633 6371004.462662099
342323.14743581135 4777557.761238398 6371004.26562463
342291.20439721673 4777566.191667143 6371002.675618865
342254.69040994335 4777488.498236224 6371001.032911824
342270.98069432774 4777523.3053393895 6371001.303604851
342276.71025088 4777518.16432278 6371009.724931769
342325.709358635 4777547.169559445 6371000.423834801
342324.2569516527 4777483.294513279 6371005.347219641
342294.1556201874 4777563.515368882 6371005.661907915
342261.23877302057 4777562.384161432 6371005.715945015
342271.35336609813 4777582.382937461 6371000.123961099
342321.92071742064 4777575.256292141 6371005.528996964
342306.30167851207 4777572.69793671 6371003.93870471
342275.10126339283 4777559.326155692 6371003.696283833
342280.3707137995 4777580.036137045 6371005.768622835
342335.54530063784 4777485.003453642 6371000.675273723
342255.05258798134 4777546.081860709 6371007.363129526
342244.17463419295 4777563.400046333 6371008.91544675
342259.446051763 4777565.979515321 6371009.537946073
342254.43259033293 4777510.327916752 6371009.633000482
342284.43074191967 4777551.146239087 6371000.731247326
342315.37625711213 4777544.603706996 6371000.981828988
342284.6197401703 4777537.723381105 6371000.672535302
342264.8327077343 4777531.185756574 6371006.185327406
342256.86429475044 4777549.041292701 6371002.7325193
342335.8734370751 4777499.772617297 6371007.242484645
342321.88421058276 4777486.78054813 6371009.1910049375
342276.8135931413 4777486.042879929 6371006.937534979
342322.52781785943 4777525.5686349515 6371001.56097916
342264.02824497095 4777532.427662756 6371008.458509415
342289.9612876035 4777565.675113195 6371003.3524289075
342280.86614430416 4777484.296909401 6371001.168572855
342247.5332667612 4777580.411834706 6371005.632761033
342295.66439287947 4777486.349773819 6371009.397662129
342266.1318520167 4777539.3655657945 6371009.832818288
342312.67596113903 4777522.904368883 6371000.875813973
1 342298.4392095031 4777535.312657121 6371000.083465349
2 342269.082130349 4777576.485561934 6371000.843596581
3 342305.2831913092 4777513.759439655 6371008.514729953
4 342296.952683646 4777528.08995878 6371002.572837907
5 342336.17647527845 4777558.944148431 6371006.264778466
6 342332.45922486135 4777522.599447569 6371006.306293758
7 342326.228535028 4777500.549639925 6371004.960059014
8 342304.316397012 4777496.882351936 6371009.182836227
9 342293.7847290429 4777578.5662904335 6371008.517891462
10 342298.60104868026 4777539.330196058 6371004.037062062
11 342309.0672011515 4777520.538326303 6371002.389314775
12 342253.7968834556 4777516.321680264 6371005.4184823455
13 342240.7964702017 4777527.567720403 6371000.550520975
14 342317.1706872105 4777494.648001663 6371002.766752425
15 342291.95985177247 4777560.629490633 6371004.462662099
16 342323.14743581135 4777557.761238398 6371004.26562463
17 342291.20439721673 4777566.191667143 6371002.675618865
18 342254.69040994335 4777488.498236224 6371001.032911824
19 342270.98069432774 4777523.3053393895 6371001.303604851
20 342276.71025088 4777518.16432278 6371009.724931769
21 342325.709358635 4777547.169559445 6371000.423834801
22 342324.2569516527 4777483.294513279 6371005.347219641
23 342294.1556201874 4777563.515368882 6371005.661907915
24 342261.23877302057 4777562.384161432 6371005.715945015
25 342271.35336609813 4777582.382937461 6371000.123961099
26 342321.92071742064 4777575.256292141 6371005.528996964
27 342306.30167851207 4777572.69793671 6371003.93870471
28 342275.10126339283 4777559.326155692 6371003.696283833
29 342280.3707137995 4777580.036137045 6371005.768622835
30 342335.54530063784 4777485.003453642 6371000.675273723
31 342255.05258798134 4777546.081860709 6371007.363129526
32 342244.17463419295 4777563.400046333 6371008.91544675
33 342259.446051763 4777565.979515321 6371009.537946073
34 342254.43259033293 4777510.327916752 6371009.633000482
35 342284.43074191967 4777551.146239087 6371000.731247326
36 342315.37625711213 4777544.603706996 6371000.981828988
37 342284.6197401703 4777537.723381105 6371000.672535302
38 342264.8327077343 4777531.185756574 6371006.185327406
39 342256.86429475044 4777549.041292701 6371002.7325193
40 342335.8734370751 4777499.772617297 6371007.242484645
41 342321.88421058276 4777486.78054813 6371009.1910049375
42 342276.8135931413 4777486.042879929 6371006.937534979
43 342322.52781785943 4777525.5686349515 6371001.56097916
44 342264.02824497095 4777532.427662756 6371008.458509415
45 342289.9612876035 4777565.675113195 6371003.3524289075
46 342280.86614430416 4777484.296909401 6371001.168572855
47 342247.5332667612 4777580.411834706 6371005.632761033
48 342295.66439287947 4777486.349773819 6371009.397662129
49 342266.1318520167 4777539.3655657945 6371009.832818288
50 342312.67596113903 4777522.904368883 6371000.875813973

View File

@ -1,11 +0,0 @@
342335.69542451313 4777759.354694403 6371000.083465349
342306.33770696004 4777800.527584484 6371000.843596581
342342.5397001469 4777737.801448842 6371008.514729953
342334.20897920633 4777752.131970737 6371002.572837907
342373.43258249346 4777782.9864068115 6371006.264778466
342369.71575528244 4777746.6415944705 6371006.306293758
342363.4853033537 4777724.591702434 6371004.960059014
342341.5731059497 4777720.9243124975 6371009.182836227
342331.0403974431 4777802.60842233 6371008.517891462
342335.85721573443 4777763.372244628 6371004.037062062
342346.32364570786 4777744.580369312 6371002.389314775
1 342335.69542451313 4777759.354694403 6371000.083465349
2 342306.33770696004 4777800.527584484 6371000.843596581
3 342342.5397001469 4777737.801448842 6371008.514729953
4 342334.20897920633 4777752.131970737 6371002.572837907
5 342373.43258249346 4777782.9864068115 6371006.264778466
6 342369.71575528244 4777746.6415944705 6371006.306293758
7 342363.4853033537 4777724.591702434 6371004.960059014
8 342341.5731059497 4777720.9243124975 6371009.182836227
9 342331.0403974431 4777802.60842233 6371008.517891462
10 342335.85721573443 4777763.372244628 6371004.037062062
11 342346.32364570786 4777744.580369312 6371002.389314775

View File

@ -1,450 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Numerical Cartography](../numerical cartography)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Geodetic datum transformations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Is common practice in Geospatial data science to work with datasets collected at different epoch and or referenced to different reference systems. In this context, the transformation parameters needed to convert data accurately into a more up-to-date reference system are often missed or, when available, are valid for wide areas affecting the accuracy of the transformation. In this briefing notes a simplified approach to derive datum transformation parameters is introduced.\n",
"\n",
"A Datum transformations can be defined as a geometric transformation between two three-dimensional coordinate reference systems. A common method consists of applying a *linear transformation* in the three-dimensional space (x,y,z).\n",
"A general linear transformation of a vector $x$ to another vector $y$ takes the form\n",
"\n",
"$$y=Mx+t \\quad (1)$$\n",
"\n",
"Each element of the $y$ vector is a combination of the element of $x$ plus a translation or shift represented by an element of the $t$ vector. The matrix **M** is called *transformation matrix* and **t** is called *translation vector*. With **M** being square nonsingular, the inverse relation exists (eq. 2)\n",
"\n",
"$$x = M^{-1}(y-t) \\quad (2)$$\n",
"\n",
"in which case is called *affine transformation*.\n",
"\n",
"Limited to the two- and three- dimensional space, six *elementary* transformations are identified, each representing a single effect. They are geometrically described as *Translation, Uniform scale, Rotation, Reflection, Stretch (Nonuniform scale factors) and Skew (Shear)*. \n",
"\n",
"<img src=\"../images/linear-transformation.svg\", width=\"80%\">\n",
"\n",
"<center>Figure 1: Elementary transformations</center>\n",
"\n",
"\n",
"---\n",
"\n",
"## The Helmert 7-parameter transformation\n",
"\n",
"<img src=\"../images/helmert.svg\", width=\"80%\">\n",
"\n",
"<center>Figure 2: Roto-Traslation and scaling in three- dimensional space</center>\n",
"\n",
"\n",
"The Helmert 7-parameter transformation, which is an affine (distortion-free) transformation in three dimensions, is extensively used in geodesy to perform Datum transformations. It is applied to geocentric coordinates and can be factored into seven elementary transformations: one uniform scale change, three translations, and three rotations.\n",
"\n",
"\n",
"\n",
"Considering a generic point $P$ represented in two orthogonal three dimensional Cartesian spatial reference frames $D_1 (x,y,z)$ and $D_2 (x',y',z')$. For small rotation the direct transformation $P_{D_1} \\to P_{D_2}$, is given by\n",
"\n",
"$$\n",
" {\\begin{pmatrix}\n",
"x_p \\\\\n",
"y_p \\\\\n",
"z_p \n",
"\\end{pmatrix}}_{{D}_2} = \\begin{pmatrix}\n",
"x^{\\prime}_0 \\\\\n",
"y^{\\prime}_0 \\\\\n",
"z^{\\prime}_0 \n",
"\\end{pmatrix} + (1+k) \\begin{pmatrix}\n",
"1 & R_z & -R_y \\\\\n",
"-R_z & 1 & R_x \\\\\n",
"R_y & -R_x & 1\n",
"\\end{pmatrix} \\begin{pmatrix}\n",
"x^{\\prime}_p \\\\\n",
"y^{\\prime}_p \\\\\n",
"z^{\\prime}_p\n",
"\\end{pmatrix}_{{D}_1} \\quad (3)\n",
"$$\n",
"\n",
"\n",
"## Horizontal geodetic datum transformations\n",
"\n",
"\n",
"\n",
"It is common in Geodesy to separate altimetry from planimetry, in this scenario the affine transformation (eq. 3) can be simplified to a *plane roto-translation with isotropic scale variation* which requires only four parameters: one scale factor $(\\lambda)$, one rotation $(\\alpha)$, two translations $(x'_0, y'_0)$. The direct (eq. 4) and inverse (eq. 5) transformations are expressed by:\n",
"\n",
"\n",
"<img src=\"../images/plane.svg\", width=\"80%\">\n",
"\n",
"<center>Figure 3: Roto-Traslation and scaling in two- dimensional space</center>\n",
"\n",
"$$\n",
" \\begin{pmatrix}\n",
"x_p \\\\\n",
"y_p\n",
"\\end{pmatrix}_{{D}_2} = \\begin{pmatrix}\n",
"T_x \\\\\n",
"T_y\n",
"\\end{pmatrix} + \\lambda \\begin{pmatrix}\n",
"\\cos \\alpha & \\sin \\alpha \\\\\n",
"- \\sin \\alpha & \\cos \\alpha\n",
"\\end{pmatrix} \\begin{pmatrix}\n",
"x'_p \\\\\n",
"y'_p\n",
"\\end{pmatrix}_{{D}_1} \\quad (4)\n",
"$$\n",
"\n",
"$$\n",
" \\begin{pmatrix}\n",
"x'_p \\\\\n",
"y'_p\n",
"\\end{pmatrix}_{{D}_2} = \\lambda^{-1} \\begin{pmatrix}\n",
"\\cos \\alpha & -\\sin \\alpha \\\\\n",
"\\sin \\alpha & \\cos \\alpha\n",
"\\end{pmatrix} \\begin{pmatrix}\n",
"x_p - T_x \\\\\n",
"y_p - T_y\n",
"\\end{pmatrix}_{{D}_1} \\quad (5)\n",
"$$\n",
"\n",
"To estimate the four parameters $(\\lambda, \\alpha, x_0, y_0)$ at least two planimetric coordinates in the two systems are needed. However, if more positions are available a least square method (*Fitting*) can be used solving the linear system:\n",
"\n",
"$$\n",
"\\left\\{ \n",
" \\begin{array}{l l}\n",
"x'_0 + a x'_p + b y'_p - x_p = 0 \\\\\n",
"y'_0 + a y'_p - b x'_p - y_p = 0 \n",
"\\end{array} \\right. \\quad (6)\n",
"$$\n",
"\n",
"with:\n",
"\n",
"$$\n",
"a = \\lambda \\cos \\alpha\n",
"$$\n",
"$$\n",
"b = \\lambda \\sin \\alpha\n",
"$$\n",
"\n",
"The linear system (6) can be solved knowing, at least, two points in $(D_1,D_2)$ once estimated the four unknown parameters $(a,b,{x'}_0,{y'}_0)$ it is possible to derive the rotation angle $\\alpha$ and the scale factor $\\lambda$ by:\n",
"\n",
"$$\n",
"\\left\\{ \n",
" \\begin{array}{l l}\n",
" \\lambda = \\sqrt{a^2 + b^2} \\\\\n",
" \\alpha = \\arctan \\frac{b}{a}\n",
" \\end{array} \\right. \\quad (7)\n",
"$$\n",
"\n",
"The relation expressed in (eq. 6) can be used in two different ways: \n",
"\n",
"\n",
"1. Knowing the four parameters it is possible to transform the coordinates of $P$ from $D_1 \\to D_2$; \n",
"2. Knowing the position of at least 2 points in both systems $(D_1, D_2)$ it is possible to estimate the four parameters by the *Least Square Method*.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Implementation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* [Conforme 2D](#Conforme-2D) \n",
"* [Affine 2D](#Affine-2D)\n",
"* [Helmert-7-Parameters (3D)](#Helmert-7-Parameters)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Firs we need to generate a proper test dataset, to do so we'll use a combination of pyproj and numpy.\n",
"Starting from the data used in the [Working with coordinates - Datum-transformation](../numerical cartography/Working with coordinates.ipynb#Datum-transformation) example, we generate a series of 50 random points in two different DATUM:\n",
"\n",
"* UTM zone 19, WGS84 ellipse, WGS84\n",
"* UTM zone 19, Clarke 1866, NAD27"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#import the pyproj and numpy library\n",
"import pyproj\n",
"import numpy as np\n",
"\n",
"# set a reference point P with coordinates: \n",
"P = (-70.93931369842528, 43.13567095719326)\n",
"\n",
"# define projection UTM 19 N: \n",
"# UTM zone 19, WGS84 ellipse, WGS84 datum, defined by epsg code 32619\n",
"p1 = pyproj.Proj(init='epsg:32619')\n",
"\n",
"#Find UTM coordinates for the point P(-70.93931369842528,43.13567095719326)\n",
"x1, y1 = p1(P[0],P[1])\n",
"\n",
"# define projection: UTM zone 19, Clarke 1866, NAD27 datum\n",
"p3 = pyproj.Proj(init='epsg:26719')\n",
"\n",
"# transform the UTM coordinates for the point P to projection 3 coordinates.\n",
"x3, y3 = pyproj.transform(p1,p3,x1,y1)\n",
"\n",
"# generate a set of random points in the range of 100 meters from P1 \n",
"# note: we use a fake altitude to perform a 3D transformation\n",
"# the value of 6371 is the ray of the spheroid in km\n",
"\n",
"xrand = (np.random.random_sample((50,))*100)+x1\n",
"yrand = (np.random.random_sample((50,))*100)+y1\n",
"zrand = (np.random.random_sample((50,))*10)+(6371*1000)\n",
"xrand,yrand,zrand\n",
"\n",
"# transform the UTM coordinates for the points [xrand, yrand] to the projection 3 coordinates.\n",
"x, y = pyproj.transform(p1,p3,xrand[:],yrand[:])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# now generate 2 dataframes to store the x,y,z coordinates in the two different DATUM \n",
"# and save the reults in a space delimited text file\n",
"import pandas as pd\n",
"d1 = pd.DataFrame(np.array([xrand,yrand,zrand],dtype=np.float).T, columns=['x','y','z'])\n",
"d2 = pd.DataFrame(np.array([x,y,zrand],dtype=np.float).T, columns=['x','y','z'])\n",
"d1.to_csv('d1.csv', index=False, header=False, sep=\" \")\n",
"d2.to_csv('d2.csv', index=False, header=False, sep=\" \")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Random points in DATUM 1**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"d1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Random points in Datum 2**\n",
"\n",
"(transformation performed using pyproj)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"d2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* testing dataset:\n",
"\n",
"We'll first select the first 10 points in both data frame and use them to estimate the transformation parameters. Then we'll use the other 40 points in $d1$ as input for the transformation. Finally, compare the results with the output of pyproj."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#d1,d2 subsample\n",
"d1s=d1[:11]\n",
"d2s=d1[:11]\n",
"d=d1[11:]\n",
"# save to file\n",
"d1s.to_csv('d1s.csv', index=False, header=False, sep=\" \")\n",
"d2s.to_csv('d2s.csv', index=False, header=False, sep=\" \")\n",
"d.to_csv('d.csv', index=False, header=False, sep=\" \")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Conforme 2D"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from transform import conforme"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"res_conforme = conforme(gcpD1='d1s.csv', gcpD2='d2s.csv', knowD1='d.csv', output='conforme.csv')\n",
"res_conforme"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Affine 2D"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from transform import affine"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"res_affine = affine(gcpD1='d1s.csv', gcpD2='d2s.csv', knowD1='d.csv', output='affine.csv')\n",
"res_affine"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Helmert 7 Parameters"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from transform import helmert"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"res_helmert = helmert(gcp1='d1s.csv', gcp2='d2s.csv', inputf='d.csv', output='helmert.txt')\n",
"res_helmert"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"d2[11:][['x','y']]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"delta_conforme = (d2[11:]['x'].values - res_conforme[:,0], d2[11:]['y'].values - res_conforme[:,1])\n",
"delta_conforme"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"delta_affine = (d2[11:]['x'].values - res_affine[:,0], d2[11:]['y'].values - res_affine[:,1])\n",
"delta_affine"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"delta_helmert = (d2[11:]['x'].values - res_helmert[:,0], d2[11:]['y'].values - res_helmert[:,1])\n",
"delta_helmert"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"[top](#Notebooks---Numerical-Cartography)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### References\n",
"\n",
"GPS. Principi, modalita' e tecniche di posizionamento - Alberto Cina (2000) - ISBN: 8876614176"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,39 +0,0 @@
3.422910531172005576e+05 4.777740363479495049e+06 6.371005418482345529e+06
3.422780525059666834e+05 4.777751609494659118e+06 6.371000550520975143e+06
3.423544274841793813e+05 4.777718690010458231e+06 6.371002766752424650e+06
3.423292157290527830e+05 4.777784671567500569e+06 6.371004462662098929e+06
3.423604034956423566e+05 4.777781803438861854e+06 6.371004265624630265e+06
3.423284602034637355e+05 4.777790233755520545e+06 6.371002675618864596e+06
3.422919469853131450e+05 4.777712539965643547e+06 6.371001032911824062e+06
3.423082369248265168e+05 4.777747347229405306e+06 6.371001303604850546e+06
3.423139665708763059e+05 4.777742206223327667e+06 6.371009724931769073e+06
3.423629655590662151e+05 4.777771211742747575e+06 6.371000423834800720e+06
3.423615139199149562e+05 4.777707336521958001e+06 6.371005347219641320e+06
3.423314114728729473e+05 4.777787557462602854e+06 6.371005661907915026e+06
3.422984944834707421e+05 4.777786426113739610e+06 6.371005715945014730e+06
3.423086088819543947e+05 4.777806424985138699e+06 6.371000123961099423e+06
3.423591765592533629e+05 4.777799298533591442e+06 6.371005528996963985e+06
3.423435574773782864e+05 4.777796740105740726e+06 6.371003938704710454e+06
3.423123570766042685e+05 4.777783368158218451e+06 6.371003696283833124e+06
3.423176263008305687e+05 4.777804078216431662e+06 6.371005768622835167e+06
3.423728023016868392e+05 4.777709045514377765e+06 6.371000675273722969e+06
3.422923084668048541e+05 4.777770123743905686e+06 6.371007363129526377e+06
3.422814302514794981e+05 4.777787441929566674e+06 6.371008915446749888e+06
3.422967017101223464e+05 4.777790021469592117e+06 6.371009537946073338e+06
3.422916888997707283e+05 4.777734369702809490e+06 6.371009633000481874e+06
3.423216866985324887e+05 4.777775188259245828e+06 6.371000731247326359e+06
3.423526324396999553e+05 4.777768645840060897e+06 6.371000981828987598e+06
3.423218758604582399e+05 4.777761765366605483e+06 6.371000672535302117e+06
3.423020888135355781e+05 4.777755227641544305e+06 6.371006185327406041e+06
3.422941201462723548e+05 4.777773083191342652e+06 6.371002732519299723e+06
3.423731302605434903e+05 4.777723814718367532e+06 6.371007242484644987e+06
3.423591411253153346e+05 4.777710822556014173e+06 6.371009191004937515e+06
3.423140703031602316e+05 4.777710084696033970e+06 6.371006937534978613e+06
3.423597842652014806e+05 4.777749610747885890e+06 6.371001560979159549e+06
3.423012843319001840e+05 4.777756469547622837e+06 6.371008458509415388e+06
3.423272170942250523e+05 4.777789717194980942e+06 6.371003352428907529e+06
3.423181228947083000e+05 4.777708338737960905e+06 6.371001168572855182e+06
3.422847886936801369e+05 4.777804453777041286e+06 6.371005632761033252e+06
3.423329211885412224e+05 4.777710391670132056e+06 6.371009397662129253e+06
3.423033878647821839e+05 4.777763407477849163e+06 6.371009832818288356e+06
3.423499323941044277e+05 4.777746946433324367e+06 6.371000875813973136e+06

View File

@ -1,2 +0,0 @@
30.263888889,45.563456
23.457654,34.433425
1 30.263888889 45.563456
2 23.457654 34.433425

View File

@ -1,260 +0,0 @@
import numpy as np
from scipy import linalg
import math
def conforme(gcpD1, gcpD2, knowD1, output, verbose=False):
L = np.loadtxt(str(gcpD1))
A = np.zeros((2*L.shape[0],4),float)
A[ ::2, 0] = 1.0
A[1::2, 1] = 1.0
A[ ::2, 2] = L[:,0]
A[1::2, 2] = L[:,1]
A[ ::2, 3] = L[:,1]
A[1::2, 3] = -L[:,0]
G = np.loadtxt(str(gcpD2))
Y = np.zeros((2*G.shape[0],1),float)
Y[ ::2, 0] = G[:,0]
Y[1::2, 0] = G[:,1]
N = np.dot(A.T.conj(), A)
T = np.dot(A.T.conj(), Y)
C = np.dot(linalg.inv(N), T)
Lambda = abs(C[2]+C[3]*1j)
Alpha = np.angle(C[2]+C[3]*1j)
E0 = C[0]
N0 = C[1]
LX = np.loadtxt(str(knowD1))
ss = LX.shape[0]
pq = G.shape[0]
ENglob = np.zeros((ss,2),float)
lam = math.sqrt(C[2]** + C[3]**2)
alp = np.arctan(C[3] / C[2]) / (math.pi / 180.)
for i in np.arange(ss):
E2 = E0+LX[i,0]*C[2]+LX[i,1]*C[3]
N2 = N0+LX[i,1]*C[2]-LX[i,0]*C[3]
ENglob[i,:] = np.hstack((E2,N2))
np.savetxt(output, ENglob)
sq = LX.shape[0]
sqx = np.zeros((G.shape[0],1),float)
sqy = np.zeros((G.shape[0],1),float)
sqx[ ::1, 0] = G[:,0]
sqy[::1, 0] = G[:,1]
sizeq = sqx.shape[0]
scartix = np.zeros((sizeq,1),float)
scartiy = np.zeros((sizeq,1),float)
scartiqx = np.zeros((sizeq,1),float)
scartiqy = np.zeros((sizeq,1),float)
sqm = np.zeros((sizeq,1),float)
for i in np.arange(sizeq):
Vx = E0 + LX[i,0] * C[2,0] + LX[i,1] * C[3,0] - sqx[i,0]
Vy = N0 + LX[i,1] * C[2,0] - LX[i,0] * C[3,0] - sqy[i,0]
sqmr = math.sqrt(Vx**2 + Vy**2)
sqm[i,:] = sqmr
scartiqx[i,0] = Vx**2
scartiqy[i,0] = Vy**2
scartix[i,0] = Vx
scartiy[i,0] = Vy
scartiq = np.concatenate((scartiqx,scartiqy))
scarti = np.concatenate((scartix,scartiy))
scartixy = np.concatenate((scartiqx,scartiqy),1)
scartiqxy = np.concatenate((scartix,scartiy),1)
sumscarti = sum(scartiq)
varqp = sumscarti / ((2 * sizeq) - 4)
varp = math.sqrt(varqp)
varianzaq = varqp * linalg.inv(N)
varianza = varp * linalg.inv(N)
varqunitp = np.diag(varianzaq)
varunitp = np.diag(varianza)
prec = np.zeros((sq,2),float)
for i in np.arange(sq):
xx = math.sqrt((LX[i,0]**2) * (varqunitp[2]) + (LX[i,1]**2) * (varqunitp[3]) + varqunitp[0])
yy = math.sqrt((LX[i,1]**2) * (varqunitp[2]) + (LX[i,0]**2) * (varqunitp[3]) + varqunitp[1])
prec[i,:] = np.hstack((xx,yy))
errore = np.concatenate((scartixy,scartiqxy,sqm),1)
np.savetxt(output+str('_precision'), prec)
np.savetxt(output+str('_error'), errore)
err_med = sum(sqm) / pq
a = C[2,0]
b = C[3,0]
lamvar = math.sqrt(((((2 * a) / math.sqrt(a**2 + b**2))**2) * varqunitp[2]) + ((((2 * b) / math.sqrt(a**2 + b**2))**2) * varqunitp[3]))
alphavar = math.sqrt(((((-b / a**2) / (1 + (b / a)**2))**2) * varqunitp[2]) + (((1 / a) / (1 + (b / a)**2))**2 * varqunitp[3])) / (math.pi / 180.)
results = str('Trasformation Parameters :\n')
results += str("\n")
results += str('Tx : ')+str(C[0,0])+'\n'
results += str('Ty : ')+str(C[1,0])+'\n'
results += str('Rigid Rotation : ')+str(alp)+'\n'
results += str('Scale Factor : ')+str(lam)+'\n'
results += str("\n")
results += str('Trasformation Parameters Variance :\n')
results += str("\n")
results += str('Sigma quadro Rigid Rotation :')+str(alphavar)+'\n'
results += str('Sigma quadro Scale Factor:')+str(lamvar)+'\n'
results += str("\n")
results += str('Results : ')+str("\n")
results += str(ENglob)
results += '\n'
results += str('Mean Error : ')+'\n'
results += str(err_med)+'\n'
results += '\n'
results += str('Precision : ')+'\n'
results += str(prec)
results += '\n'
results += str('Error : ')+str("\n")
results += str(errore)
results = results.replace('[','').replace(']','')
if verbose:
print(results)
return ENglob
def affine(gcpD1, gcpD2, knowD1, output, verbose=False):
L = np.loadtxt(str(gcpD1))
A = np.zeros((2*L.shape[0],6),float)
A[ ::2, 2] = 1.0
A[1::2, 5] = 1.0
A[ ::2, 0] = L[:,0]
A[1::2, 4] = L[:,1]
A[ ::2, 1] = L[:,1]
A[1::2, 3] = L[:,0]
G = np.loadtxt(str(gcpD2))
Y = np.zeros((2*G.shape[0],1),float)
Y[ ::2, 0] = G[:,0]
Y[1::2, 0] = G[:,1]
N = np.dot(A.T.conj(), A)
T = np.dot(A.T.conj(), Y)
C = np.dot(linalg.inv(N), T)
E0 = C[2]
N0 = C[5]
LX = np.loadtxt(str(knowD1))
ss = LX.shape[0]
ENglob = np.zeros((ss,2),float)
for i in np.arange(ss):
E2 = E0+LX[i,0]*C[0]+LX[i,1]*C[1]
N2 = N0+LX[i,0]*C[3]+LX[i,1]*C[4]
ENglob[i,:] = np.hstack((E2,N2))
np.savetxt(output,ENglob)
sq = LX.shape[0]
sqx = np.zeros((G.shape[0],1),float)
sqy = np.zeros((G.shape[0],1),float)
sqx[ ::1, 0] = G[:,0]
sqy[::1, 0] = G[:,1]
sizeq = sqx.shape[0]
scartix = np.zeros((sizeq,1),float)
scartiy = np.zeros((sizeq,1),float)
scartiqx = np.zeros((sizeq,1),float)
scartiqy = np.zeros((sizeq,1),float)
sqm = np.zeros((sizeq,1),float)
for i in np.arange(sizeq):
Vx = E0 + LX[i,0] * C[0,0] + LX[i,1] * C[1,0] - sqx[i,0]
Vy = N0 + LX[i,0] * C[3,0] + LX[i,1] * C[4,0] - sqy[i,0]
sqmr = math.sqrt(Vx**2 + Vy**2)
sqm[i,:] = sqmr
scartiqx[i,0] = Vx**2
scartiqy[i,0] = Vy**2
scartix[i,0] = Vx
scartiy[i,0] = Vx
scartiq = np.concatenate((scartiqx,scartiqy))
scarti = np.concatenate((scartix,scartiy))
scartixy = np.concatenate((scartiqx,scartiqy),1)
scartiqxy = np.concatenate((scartix,scartiy),1)
sumscarti = sum(scartiq)
varqp = sumscarti / ((2 * ss) - 4)
varp = math.sqrt(varqp)
varianzaq = varqp * linalg.inv(N)
varianza = varp * linalg.inv(N)
varqunitp = np.diag(varianzaq)
varunitp = np.diag(varianza)
prec = np.zeros((sq,2),float)
for i in np.arange(sq):
xx = math.sqrt((LX[i,0]**2) * (varqunitp[0]) + (LX[i,1]**2) * (varqunitp[1]) + varqunitp[2])
yy = math.sqrt((LX[i,1]**2) * (varqunitp[0]) + (LX[i,0]**2) * (varqunitp[1]) + varqunitp[5])
prec[i,:] = np.hstack((xx,yy))
errore = np.concatenate((scartixy,scartiqxy,sqm),1)
np.savetxt(output+str('_precision'), prec)
np.savetxt(output+str('_error'), errore)
err_med = sum(sqm) / sq
results = str('Trasformation Parameters :\n')
results += str('Tx : ')+str(C[2,0])+'\n'
results += str('Ty : ')+str(C[5,0])+'\n'
results += str('Rigid Rotation X : ')+str(C[1,0])+'\n'
results += str('Rigid Rotation Y : ')+str(C[3,0])+'\n'
results += str('Scale Factor X : ')+str(C[0,0])+'\n'
results += str('Scale Factor Y : ')+str(C[4,0])+'\n'
results += '\n'
results += str('Results : ')+'\n'
results += str(ENglob)
results += str("\n")
results += str('Mean Error : ')+'\n'
results += str(err_med)+'\n'
results += '\n'
results += str('Precision : ')+'\n'
results += str(prec)+'\n'
results += '\n'
results += str('Error : ')+'\n'
results += str(errore)
results = results.replace('[','').replace(']','')
if verbose:
print(results)
return ENglob
def vcross(v):
x, y, z = v
mat = np.zeros((3,3))
mat[0] = [ 0, -z, y]
mat[1] = [ z, 0, -x]
mat[2] = [-y, x, 0]
return mat
def block(v):
return np.hstack((np.eye(3), -vcross(v), v[:, np.newaxis]))
def helmert(gcp1, gcp2, inputf, output, verbose=False):
pt1 = np.loadtxt(str(gcp1))
pt2 = np.loadtxt(str(gcp2))
A = []
rhs = []
for i in range(3):
A.append(block(pt1[i]))
rhs.append((pt2[i] - pt1[i])[:, np.newaxis])
A = np.vstack(A)
rhs = np.vstack(rhs)
sol = np.linalg.lstsq(A, rhs)[0]
res = rhs - np.dot(A, sol)
XYZ = np.loadtxt(str(inputf))
XYZsize = XYZ.shape[0]
ENZglob = np.zeros((XYZsize,3),float)
for i in np.arange(XYZsize):
X = sol[0] + (1 + sol[6]) * ( XYZ[i,0] - sol[5] * XYZ[i,1] + sol[4] * XYZ[i,2] )
Y = sol[1] + (1 + sol[6]) * ( sol[5] * XYZ[i,0] + XYZ[i,1] - sol[3] * XYZ[i,2] )
Z = sol[2] + (1 + sol[6]) * ( -sol[4] * XYZ[i,0] + sol[3] * XYZ[i,1] + XYZ[i,2] )
ENZglob[i,:] = np.hstack((X,Y,Z))
np.savetxt(output,ENZglob)
hresults = str('Trasformation Parameters :\n')
hresults += str("\n")
hresults = str('Traslation :\n')
hresults += str("\n")
hresults += str('Tx : ')+str(sol[0])+'\n'
hresults += str('Ty : ')+str(sol[1])+'\n'
hresults += str('Tz : ')+str(sol[2])+'\n'
hresults += str("\n")
hresults += str('Rotation :\n ')
hresults += str("\n")
hresults += str('Rx : ')+str(sol[3])+'\n'
hresults += str('Ry : ')+str(sol[4])+'\n'
hresults += str('Rz : ')+str(sol[5])+'\n'
hresults += str("\n")
hresults += str('Scale Factor :\n ')
hresults += str("\n")
hresults += str("S : ")+str(sol[6])+'\n'
hresults += str("\n")
hresults += str('Trasformation Residuals :\n')
hresults += str("\n")
hresults += str(res)+'\n'
hresults += str('Results : \n')
hresults += str("\n")
hresults += str(ENZglob)
hresults += '\n'
hresults = hresults.replace('[','').replace(']','')
if verbose:
print(hresults)
return ENZglob

View File

@ -1 +0,0 @@
# Directory to host output data

View File

@ -1,167 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Cesium Widget Example KML\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If the installation of Cesiumjs is ok, it should be reachable here:\n",
"http://localhost:8888/nbextensions/CesiumWidget/cesium/index.html"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from CesiumWidget import CesiumWidget\n",
"from IPython import display\n",
"import numpy as np"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Create widget object"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesium = CesiumWidget()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Display the widget:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesium"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Cesium is packed with example data. Let's look at some GDP per captia data from 2008. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesium.kml_url = '/nbextensions/CesiumWidget/cesium/Apps/SampleData/kml/gdpPerCapita2008.kmz'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example zoomto"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"for lon in np.arange(0, 360, 0.5):\n",
" cesium.zoom_to(lon, 0, 36000000, 0 ,-90, 0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"cesium._zoomto"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example flyto"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesium.fly_to(14, 90, 20000001)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"cesium._flyto"
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,176 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# CesiumWidget together with CZML library\n",
"This notebook shows how to use the CesiumWidget together with the CZML library from https://github.com/cleder/czml"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If the CesiumWidget is installed correctly, Cesium should be accessable at:\n",
"http://localhost:8888/nbextensions/CesiumWidget/cesium/index.html\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import collections\n",
"from CesiumWidget import CesiumWidget\n",
"import czml"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"points = collections.OrderedDict()\n",
"points['p1'] = [18.07,59.33, 20]\n",
"points['p2'] = [19.07,59.33, 20]\n",
"points['p3'] = [20.07,59.33, 20]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"points"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"doc = czml.CZML()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"packet1 = czml.CZMLPacket(id='document',version='1.0')\n",
"doc.packets.append(packet1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"for i,v in enumerate(points):\n",
" print(i,v)\n",
" p = czml.CZMLPacket(id=i)\n",
" p.position = czml.Position(cartographicDegrees = points[v])\n",
" point = czml.Point(pixelSize=20, show=True)\n",
" point.color = czml.Color(rgba=(223, 150, 47, 128))\n",
" point.show = True\n",
" p.point = point\n",
" l = czml.Label(show=True, text=v)\n",
" l.scale = 0.5\n",
" p.label = l\n",
" doc.packets.append(p)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesiumExample = CesiumWidget(width=\"100%\", czml=tuple(doc.data()))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesiumExample"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"cesiumExample.zoom_to(points['p1'][0], points['p1'][1], 360000, 0 ,-90, 0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"doc.dumps()"
]
}
],
"metadata": {
"hide_input": true,
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
},
"latex_envs": {
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 0
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,152 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Cesium Widget Example\n",
"This is an example notebook accessing the CesiumWidget, in the way it should be accessed."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import json\n",
"from IPython import display\n",
"from CesiumWidget import CesiumWidget"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If the installation of Cesiumjs is ok, it should be reachable [here](http://localhost:8888/nbextensions/CesiumWidget/cesium/index.html)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Great, let's create a `CesiumWidget`!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"cesium = CesiumWidget()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Display the widget:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesium"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can change many settings of the widget:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"cesium.class_own_traits()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's turn on lighting: let there be light!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesium.enable_lighting = True"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Load data for the viewer to display in the [CZML](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Guide) format, which is based on JSON. It always expects a list of Packet objects."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from CesiumWidget.examples.iss import ISS\n",
"cesium.czml = ISS"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also use the excellent `czml` module to generate valid CZML: see an [example here](./CesiumWidget Example with CZML library.ipynb)."
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,266 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Cesium Widget Example\n",
"This is an example notebook to sow how to *bind* the [Cesiumjs](http://cesiumjs.org/index.html) with the [IPython interactive widget system](https://github.com/ipython/ipywidgets)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from CesiumWidget import CesiumWidget\n",
"from IPython import display\n",
"from czml_example import simple_czml, complex_czml"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The code:\n",
"\n",
"```from czml_example import simple_czml, complex_czml```\n",
"\n",
"Simply import some [CZML]() data for the viewer to display."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Create widget object**"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"cesiumExample = CesiumWidget(width=\"100%\", enable_lighting=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Display the widget:**"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesiumExample"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Add some data to the viewer**\n",
"\n",
"* A simple czml"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesiumExample.czml = simple_czml"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* A more complex CZML example"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesiumExample.czml = complex_czml"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's make some interactive widget:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"from ipywidgets import interact, interactive, fixed\n",
"from ipywidgets import widgets"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* store the CZML objet in a dictionary and use their name as ```keys```\n",
"* define a function to switch between CZML\n",
"* bind the IPython intercat class to the function"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"myczml = {'simple_czml':simple_czml, 'complex_czml':complex_czml}"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"myplace = {'Eboli, IT':'', 'Woods Hole, MA':'', 'Durham, NH':''}"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "ImportError",
"evalue": "No module named geocoder",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-9-45ff9bcce4a8>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mgeocoder\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mmyplace\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mg\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgeocoder\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgoogle\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mg\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlatlng\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mImportError\u001b[0m: No module named geocoder"
]
}
],
"source": [
"import geocoder\n",
"import time\n",
"for i in myplace.keys():\n",
" g = geocoder.google(i)\n",
" print(g.latlng)\n",
" myplace[i]=g.latlng"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"myplace"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"@interact(z=(0,20000000), heading=(-180,180), pitch=(-90,90), roll=(-360,360), \n",
" Location=('Eboli, IT','Woods Hole, MA','Durham, NH'))\n",
"def f(z=1000000, heading=0, pitch=-90, roll=0, Location='Eboli, IT'):\n",
" cesiumExample.zoom_to(myplace[Location][1], myplace[Location][0], z, heading, pitch, roll)\n",
"@interact(CZML=('simple_czml','complex_czml'))\n",
"def c(CZML=None):\n",
" cesiumExample.czml = myczml[CZML]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cesiumExample"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"hide_input": true,
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
},
"latex_envs": {
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 0
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,71 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../../) - [Simple web-gis products](../) - [CESIUM](../CESIUM/)- [Introduction](../CESIUM/cesium-introduction.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"## CesiumWidget\n",
"\n",
"CesiumWidget is an IPython/Jupyter notebook widget based on [Cesiumjs](http://cesiumjs.org/), a javascript\n",
"world globe widget.\n",
"\n",
"For license on Cesiumjs see http://cesiumjs.org/index.html\n",
"\n",
"CesiumWidget part of code is under Apache license\n",
"\n",
"\n",
"\n",
"## Features\n",
"\n",
"The widget is in development and has currently basic features such as load CZML, KML, GeoJson and camera functionalities like go-to, zoom-to, zoom-ti-region.\n",
"\n",
"The vision is to have a widget for representing orbits,\n",
"geo-related informations in an efficient way directly in the browser. By using the full\n",
"screen button, the widget can be expanded to provide a larger view.\n",
"\n",
"Roadmap still to be written but visioned features are:\n",
"* Time readout and control of widget from python\n",
"* Better interface with czml\n",
"* Pyplot-like interface to quickly plot stuff\n",
"\n",
"\n",
"## Examples\n",
"\n",
"* [CesiumWidget Example](CesiumWidget Example.ipynb)\n",
"* [CesiumWidget Example KML](CesiumWidget Example KML.ipynb)\n",
"* [CesiumWidget Example with CZML library](CesiumWidget Example with CZML library.ipynb)\n",
"* [CesiumWidget Interact-Example](CesiumWidget Interact-Example.ipynb)\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

File diff suppressed because one or more lines are too long

View File

@ -1,52 +0,0 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1><center>[Notebooks](../) - [Simple web-gis products](../Simple web-gis products) - [Introduction ](../Simple web-gis products/Introduction to Simple web-gis products.ipynb)</center></h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The intent of this set of notebooks is to provide some examoples on how to build simple ```HTML``` and ```JavaScrpt``` web based tools, using templates based on *cesiumJS*, *Openlayers*, *Leaflets*.\n",
"\n",
"The ability of the notebook to work on very diverse and heterogeneous data and information sources, provides an effective way to document the processes involved in generating a data product as well as a way to share the source code used to generate those products and associated metadata. Those features enable the ability to track the workflow provenance to allow the reproducibility of a data product."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"**[CESIUM](CESIUM/cesium-introduction.ipynb)**\n",
"\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,34 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,245 +0,0 @@
<?xml version='1.0'?>
<!-- This file was generated by dvisvgm 1.6 -->
<svg height='209.969pt' version='1.1' viewBox='0.994001 3.66019 259.874 209.969' width='259.874pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<defs>
<path d='M3.04359 -1.24533C3.04359 -1.91781 2.49564 -2.45579 1.83313 -2.45579C1.16563 -2.45579 0.622665 -1.91283 0.622665 -1.24533C0.622665 -0.572852 1.17061 -0.0348692 1.83313 -0.0348692C2.50062 -0.0348692 3.04359 -0.577833 3.04359 -1.24533ZM2.76463 -1.24533C2.76463 -0.732254 2.3462 -0.313823 1.83313 -0.313823S0.901619 -0.732254 0.901619 -1.24533S1.32005 -2.17684 1.83313 -2.17684S2.76463 -1.75841 2.76463 -1.24533Z' id='g0-14'/>
<path d='M4.35168 -0.0139477C4.35168 -0.0488169 4.33076 -0.0697385 4.31681 -0.0836862C4.23313 -0.160399 4.16339 -0.320797 4.13549 -0.383562L2.43387 -4.4005C2.38506 -4.52603 2.24558 -4.83985 1.50635 -4.83985C1.42267 -4.83985 1.32503 -4.83985 1.32503 -4.74222C1.32503 -4.65853 1.39477 -4.65156 1.42964 -4.64458C1.57609 -4.62366 1.70859 -4.60274 1.88294 -4.20523L2.71283 -2.25255L0.655542 -0.397509C0.571856 -0.327771 0.516065 -0.27198 0.516065 -0.153425C0.516065 0.0139477 0.655542 0.0836862 0.753176 0.0836862C0.885679 0.0836862 0.969365 -0.00697385 0.990286 -0.0278954L2.81743 -1.99452C3.16613 -1.1995 3.56364 -0.188294 3.64035 -0.0976339C3.77285 0.0697385 3.89838 0.0697385 4.00996 0.0697385H4.14944C4.28194 0.0697385 4.35168 0.0697385 4.35168 -0.0139477Z' id='g1-21'/>
<path d='M4.51208 -1.79228C4.51208 -2.52453 3.87049 -3.04757 3.01968 -3.08244L3.43113 -4.74919C3.43113 -4.83985 3.34745 -4.83985 3.31258 -4.83985C3.20797 -4.83985 3.201 -4.80498 3.1731 -4.68643L2.77559 -3.08941C1.54122 -3.03362 0.488169 -2.14795 0.488169 -1.21345C0.488169 -0.425405 1.20648 0.0488169 1.98057 0.0767123L1.82017 0.732254C1.73649 1.06002 1.67372 1.31806 1.67372 1.33898C1.67372 1.42267 1.76438 1.42267 1.78531 1.42267C1.88991 1.42267 1.89689 1.40174 1.93176 1.25529L2.22466 0.0836862C3.41719 0.0348692 4.51208 -0.843836 4.51208 -1.79228ZM2.02939 -0.118555C1.4924 -0.146451 0.99726 -0.439352 0.99726 -1.09489C0.99726 -1.79228 1.52727 -2.77559 2.7198 -2.88717L2.02939 -0.118555ZM4.00299 -1.91083C4.00299 -1.15068 3.40324 -0.216189 2.27347 -0.118555L2.96389 -2.88717C3.50087 -2.86625 4.00299 -2.57335 4.00299 -1.91083Z' id='g1-30'/>
<path d='M1.66675 -0.0418431C1.66675 -0.474222 1.49938 -0.801993 1.17858 -0.801993C0.948443 -0.801993 0.781071 -0.620672 0.781071 -0.404483C0.781071 -0.18132 0.941469 0 1.18555 0C1.35293 0 1.47148 -0.111582 1.47148 -0.111582C1.47148 0.27198 1.40174 0.718306 0.927522 1.16463C0.899626 1.19253 0.878705 1.21345 0.878705 1.24832C0.878705 1.29714 0.934496 1.34595 0.976339 1.34595C1.07397 1.34595 1.66675 0.788045 1.66675 -0.0418431Z' id='g1-59'/>
<path d='M3.98207 -0.99726C3.98207 -1.08792 3.89141 -1.08792 3.87049 -1.08792C3.77285 -1.08792 3.76588 -1.06002 3.71706 -0.871731C3.63337 -0.536986 3.50087 -0.125529 3.20797 -0.125529C3.02665 -0.125529 2.97783 -0.278954 2.97783 -0.467248C2.97783 -0.585803 3.03362 -0.836862 3.08244 -1.01818L3.23587 -1.64583C3.3056 -1.90386 3.31258 -1.9457 3.37534 -2.17584C3.41719 -2.35716 3.50087 -2.68493 3.50087 -2.7198C3.50087 -2.87323 3.37534 -2.94296 3.26376 -2.94296C3.14521 -2.94296 2.98481 -2.85928 2.94296 -2.66401C2.79651 -2.89415 2.5594 -3.07547 2.22466 -3.07547C1.332 -3.07547 0.425405 -2.09215 0.425405 -1.08792C0.425405 -0.411457 0.878705 0.0697385 1.47846 0.0697385C1.85504 0.0697385 2.18979 -0.146451 2.46874 -0.418431C2.60125 0 3.00573 0.0697385 3.18705 0.0697385C3.43811 0.0697385 3.61245 -0.0836862 3.73798 -0.299875C3.89141 -0.571856 3.98207 -0.969365 3.98207 -0.99726ZM2.82441 -2.17584L2.49664 -0.871731C2.44782 -0.676463 2.2944 -0.536986 2.14097 -0.404483C2.07821 -0.348692 1.79925 -0.125529 1.49938 -0.125529C1.24134 -0.125529 0.990286 -0.306849 0.990286 -0.801993C0.990286 -1.17161 1.19253 -1.93873 1.35293 -2.21768C1.67372 -2.77559 2.02939 -2.8802 2.22466 -2.8802C2.71283 -2.8802 2.84533 -2.35019 2.84533 -2.27347C2.84533 -2.24558 2.83138 -2.19676 2.82441 -2.17584Z' id='g1-97'/>
<path d='M3.28468 -1.91083C3.28468 -2.72677 2.7198 -3.07547 2.23861 -3.07547C1.87597 -3.07547 1.56912 -2.87323 1.3599 -2.69191L1.8411 -4.63064C1.84807 -4.64458 1.86899 -4.74222 1.86899 -4.74222C1.86899 -4.77709 1.8411 -4.83985 1.75741 -4.83985C1.61793 -4.83985 1.0391 -4.78406 0.864757 -4.77011C0.808966 -4.76314 0.711333 -4.75616 0.711333 -4.60971C0.711333 -4.51208 0.808966 -4.51208 0.892653 -4.51208C1.2274 -4.51208 1.2274 -4.46326 1.2274 -4.40747C1.2274 -4.35866 1.15766 -4.0797 1.11582 -3.9193L0.955417 -3.27771L0.495143 -1.42267C0.460274 -1.25529 0.460274 -1.16463 0.460274 -1.08095C0.460274 -0.376588 0.9066 0.0697385 1.48543 0.0697385C2.35716 0.0697385 3.28468 -0.878705 3.28468 -1.91083ZM2.72677 -2.20374C2.72677 -1.91781 2.57335 -1.20648 2.36413 -0.801993C2.19676 -0.460274 1.84807 -0.125529 1.4924 -0.125529C1.15068 -0.125529 0.955417 -0.425405 0.955417 -0.836862C0.955417 -1.09489 1.01818 -1.332 1.21345 -2.12005C1.25529 -2.25255 1.25529 -2.2665 1.3878 -2.41993C1.6528 -2.72677 1.96663 -2.8802 2.21768 -2.8802C2.48966 -2.8802 2.72677 -2.67796 2.72677 -2.20374Z' id='g1-98'/>
<path d='M3.88443 -1.91083C3.88443 -2.72677 3.31955 -3.07547 2.83836 -3.07547C2.40598 -3.07547 2.03636 -2.78257 1.84807 -2.5873C1.72951 -2.98481 1.33898 -3.07547 1.12976 -3.07547C0.857783 -3.07547 0.690411 -2.89415 0.578829 -2.70585C0.439352 -2.46874 0.327771 -2.05031 0.327771 -2.00847C0.327771 -1.91781 0.425405 -1.91781 0.446326 -1.91781C0.54396 -1.91781 0.550934 -1.93873 0.599751 -2.12702C0.704359 -2.53151 0.836862 -2.8802 1.10884 -2.8802C1.29016 -2.8802 1.33898 -2.72677 1.33898 -2.53848C1.33898 -2.46177 1.32503 -2.37111 1.31806 -2.32927L0.523039 0.850809C0.474222 1.04608 0.460274 1.10187 0.18132 1.10187C0.09066 1.10187 -0.00697385 1.10187 -0.00697385 1.24832C-0.00697385 1.32503 0.0557908 1.35293 0.09066 1.35293C0.27198 1.35293 0.502117 1.32503 0.690411 1.32503C0.927522 1.32503 1.19253 1.35293 1.42267 1.35293C1.48543 1.35293 1.56214 1.332 1.56214 1.1995C1.56214 1.10187 1.46451 1.10187 1.38082 1.10187C1.2274 1.10187 1.0391 1.10187 1.0391 1.01818C1.0391 0.983313 1.08792 0.801993 1.11582 0.697385L1.37385 -0.341719C1.45753 -0.202242 1.67372 0.0697385 2.09215 0.0697385C2.94296 0.0697385 3.88443 -0.871731 3.88443 -1.91083ZM3.32653 -2.20374C3.32653 -1.91781 3.1731 -1.20648 2.96389 -0.801993C2.78954 -0.460274 2.44782 -0.125529 2.09215 -0.125529C1.59701 -0.125529 1.47148 -0.662516 1.47148 -0.732254C1.47148 -0.760149 1.48543 -0.808966 1.4924 -0.836862L1.8411 -2.23861C2.24558 -2.77559 2.59427 -2.8802 2.81743 -2.8802C3.08941 -2.8802 3.32653 -2.67796 3.32653 -2.20374Z' id='g1-112'/>
<path d='M3.57061 -2.56638C3.57061 -2.92902 3.18705 -3.07547 2.83138 -3.07547C2.46874 -3.07547 2.15492 -2.92902 1.84807 -2.58032C1.72254 -3.00573 1.29714 -3.07547 1.12976 -3.07547C0.871731 -3.07547 0.697385 -2.91507 0.585803 -2.7198C0.425405 -2.44782 0.327771 -2.04334 0.327771 -2.00847C0.327771 -1.91781 0.425405 -1.91781 0.446326 -1.91781C0.54396 -1.91781 0.550934 -1.93873 0.599751 -2.12702C0.704359 -2.55243 0.836862 -2.8802 1.10884 -2.8802C1.29016 -2.8802 1.33898 -2.72677 1.33898 -2.53848C1.33898 -2.40598 1.27621 -2.14795 1.2274 -1.95965L1.07397 -1.332L0.850809 -0.439352C0.822914 -0.348692 0.781071 -0.174346 0.781071 -0.153425C0.781071 0 0.9066 0.0697385 1.01818 0.0697385C1.12279 0.0697385 1.26227 0.00697385 1.31806 -0.132503C1.332 -0.174346 1.40872 -0.481196 1.45056 -0.655542L1.63885 -1.40872C1.64583 -1.45056 1.80623 -2.07821 1.82017 -2.11308C1.83412 -2.16887 2.03636 -2.51756 2.25953 -2.68493C2.33624 -2.74072 2.52453 -2.8802 2.82441 -2.8802C2.89415 -2.8802 3.06849 -2.87323 3.20797 -2.78257C2.98481 -2.7198 2.90112 -2.52453 2.90112 -2.399C2.90112 -2.24558 3.01968 -2.14097 3.18007 -2.14097S3.57061 -2.27347 3.57061 -2.56638Z' id='g1-114'/>
<path d='M3.90535 -0.99726C3.90535 -1.08792 3.81469 -1.08792 3.79377 -1.08792C3.69614 -1.08792 3.68917 -1.05305 3.66127 -0.969365C3.51482 -0.488169 3.09639 -0.125529 2.70585 -0.125529C2.4269 -0.125529 2.28045 -0.313823 2.28045 -0.578829C2.28045 -0.760149 2.44782 -1.39477 2.64309 -2.16887C2.78257 -2.70585 3.09639 -2.8802 3.32653 -2.8802C3.32653 -2.8802 3.55666 -2.8802 3.70311 -2.78257C3.47995 -2.7198 3.39626 -2.52453 3.39626 -2.399C3.39626 -2.24558 3.51482 -2.14097 3.67522 -2.14097S4.06575 -2.27347 4.06575 -2.56638C4.06575 -2.95691 3.61943 -3.07547 3.34047 -3.07547C2.99178 -3.07547 2.71283 -2.84533 2.5594 -2.58032C2.43387 -2.86625 2.11308 -3.07547 1.72254 -3.07547C0.941469 -3.07547 0.495143 -2.21768 0.495143 -2.00847C0.495143 -1.91781 0.592777 -1.91781 0.613699 -1.91781C0.704359 -1.91781 0.711333 -1.9457 0.746202 -2.03636C0.920548 -2.58032 1.3599 -2.8802 1.70162 -2.8802C1.93176 -2.8802 2.12005 -2.75467 2.12005 -2.41993C2.12005 -2.28045 2.03636 -1.93176 1.9736 -1.69465L1.73649 -0.739228C1.66675 -0.502117 1.43661 -0.125529 1.08095 -0.125529C1.06002 -0.125529 0.850809 -0.125529 0.704359 -0.223163C0.990286 -0.313823 1.01121 -0.564882 1.01121 -0.606725C1.01121 -0.760149 0.892653 -0.864757 0.732254 -0.864757C0.536986 -0.864757 0.334745 -0.697385 0.334745 -0.439352C0.334745 -0.09066 0.72528 0.0697385 1.067 0.0697385C1.3878 0.0697385 1.67372 -0.132503 1.84807 -0.425405C2.01544 -0.0557908 2.399 0.0697385 2.67796 0.0697385C3.47995 0.0697385 3.90535 -0.801993 3.90535 -0.99726Z' id='g1-120'/>
<path d='M3.87746 -2.62914C3.90535 -2.72677 3.90535 -2.74072 3.90535 -2.78257C3.90535 -2.92204 3.79377 -3.00573 3.67522 -3.00573C3.59851 -3.00573 3.466 -2.97086 3.38929 -2.83836C3.36837 -2.79651 3.31258 -2.57335 3.27771 -2.43387L3.13126 -1.85504L2.8523 -0.732254C2.8523 -0.732254 2.53848 -0.125529 1.99452 -0.125529C1.5203 -0.125529 1.5203 -0.578829 1.5203 -0.704359C1.5203 -1.08095 1.6807 -1.5203 1.88991 -2.05729C1.9736 -2.28045 2.00847 -2.36413 2.00847 -2.48269C2.00847 -2.81743 1.72254 -3.07547 1.34595 -3.07547C0.641594 -3.07547 0.327771 -2.12702 0.327771 -2.00847C0.327771 -1.91781 0.425405 -1.91781 0.446326 -1.91781C0.54396 -1.91781 0.550934 -1.95268 0.571856 -2.02939C0.746202 -2.60822 1.04608 -2.8802 1.32503 -2.8802C1.44359 -2.8802 1.49938 -2.80349 1.49938 -2.63611C1.49938 -2.47572 1.43661 -2.32229 1.40174 -2.23163C1.067 -1.38082 0.99726 -1.12279 0.99726 -0.81594C0.99726 -0.697385 0.99726 -0.369614 1.26924 -0.146451C1.48543 0.0348692 1.77833 0.0697385 1.96663 0.0697385C2.24558 0.0697385 2.49664 -0.0348692 2.72677 -0.244085C2.63611 0.139477 2.5594 0.432379 2.2665 0.781071C2.07821 0.99726 1.79925 1.2274 1.42964 1.2274C1.38082 1.2274 1.05305 1.2274 0.9066 0.99726C1.28319 0.955417 1.28319 0.613699 1.28319 0.613699C1.28319 0.390535 1.08095 0.348692 1.01121 0.348692C0.836862 0.348692 0.606725 0.488169 0.606725 0.808966C0.606725 1.16463 0.941469 1.42267 1.43661 1.42267C2.14097 1.42267 2.99875 0.878705 3.21494 0.00697385L3.87746 -2.62914Z' id='g1-121'/>
<path d='M3.47298 -1.01121C3.47298 -1.09489 3.39626 -1.10187 3.35442 -1.10187C3.27073 -1.10187 3.25679 -1.067 3.22889 -0.990286C3.09639 -0.641594 2.68493 -0.474222 2.34321 -0.474222C2.18281 -0.474222 2.00847 -0.509091 1.83412 -0.550934C1.51333 -0.620672 1.45753 -0.620672 1.332 -0.620672C1.332 -0.620672 1.21345 -0.620672 1.17161 -0.613699C1.35293 -0.795019 1.47846 -0.927522 2.07123 -1.40174C2.21768 -1.5203 2.74072 -1.93873 2.94296 -2.134C3.36837 -2.55243 3.63337 -2.90809 3.63337 -2.99178S3.54271 -3.07547 3.51482 -3.07547C3.45205 -3.07547 3.43113 -3.06152 3.39626 -3.00573C3.18007 -2.68493 3.03362 -2.58032 2.86625 -2.58032C2.78257 -2.58032 2.67796 -2.5873 2.46874 -2.78954C2.23163 -3.02665 2.07821 -3.07547 1.91781 -3.07547C1.3599 -3.07547 0.983313 -2.46874 0.983313 -2.25953C0.983313 -2.19676 1.05305 -2.17584 1.10187 -2.17584C1.18555 -2.17584 1.1995 -2.19676 1.2274 -2.27347C1.332 -2.51756 1.72254 -2.53151 1.83412 -2.53151C1.99452 -2.53151 2.17584 -2.48966 2.27347 -2.46874C2.65704 -2.38506 2.70585 -2.38506 2.8802 -2.38506C2.69888 -2.19676 2.57335 -2.07123 1.91083 -1.54122C1.36687 -1.10884 1.17858 -0.934496 1.04608 -0.795019C0.627646 -0.383562 0.425405 -0.0767123 0.425405 -0.0139477C0.425405 0.0697385 0.516065 0.0697385 0.54396 0.0697385C0.613699 0.0697385 0.627646 0.0557908 0.662516 0C0.850809 -0.265006 1.067 -0.425405 1.30411 -0.425405C1.3878 -0.425405 1.4924 -0.418431 1.6807 -0.244085C1.89689 -0.0348692 2.03636 0.0697385 2.25953 0.0697385C3.00573 0.0697385 3.47298 -0.774097 3.47298 -1.01121Z' id='g1-122'/>
<path d='M5.62092 -2.51756C5.62092 -2.68493 5.45355 -2.68493 5.36289 -2.68493H0.746202C0.655542 -2.68493 0.488169 -2.68493 0.488169 -2.51756C0.488169 -2.34321 0.648568 -2.34321 0.753176 -2.34321H5.35592C5.46052 -2.34321 5.62092 -2.34321 5.62092 -2.51756ZM5.62092 -0.976339C5.62092 -1.15068 5.46052 -1.15068 5.35592 -1.15068H0.753176C0.648568 -1.15068 0.488169 -1.15068 0.488169 -0.976339C0.488169 -0.808966 0.655542 -0.808966 0.746202 -0.808966H5.36289C5.45355 -0.808966 5.62092 -0.808966 5.62092 -0.976339Z' id='g2-61'/>
<path d='M2.61519 1.6528C2.61519 1.61096 2.59427 1.59701 2.54545 1.54819C1.61793 0.711333 1.27621 -0.474222 1.27621 -1.74346C1.27621 -3.6264 1.99452 -4.54695 2.56638 -5.06301C2.59427 -5.09091 2.61519 -5.11183 2.61519 -5.1467C2.61519 -5.23039 2.53151 -5.23039 2.47572 -5.23039C1.15068 -4.29589 0.801993 -2.81743 0.801993 -1.75044C0.801993 -0.767123 1.09489 0.760149 2.47572 1.73649C2.53151 1.73649 2.61519 1.73649 2.61519 1.6528Z' id='g3-40'/>
<path d='M2.30137 -1.74346C2.30137 -2.72677 2.00847 -4.25405 0.627646 -5.23039C0.578829 -5.23039 0.495143 -5.23039 0.495143 -5.1467C0.495143 -5.11183 0.516065 -5.09091 0.557908 -5.04209C1.15766 -4.49116 1.82715 -3.54969 1.82715 -1.75044C1.82715 -0.292902 1.37385 0.808966 0.620672 1.4924C0.502117 1.61096 0.495143 1.61793 0.495143 1.6528S0.516065 1.73649 0.585803 1.73649C0.669489 1.73649 1.332 1.27621 1.79228 0.404483C2.09913 -0.174346 2.30137 -0.927522 2.30137 -1.74346Z' id='g3-41'/>
<path d='M3.59851 -2.22466C3.59851 -2.99178 3.50785 -3.54271 3.18705 -4.03088C2.97086 -4.35168 2.53848 -4.63064 1.98057 -4.63064C0.36264 -4.63064 0.36264 -2.72677 0.36264 -2.22466S0.36264 0.139477 1.98057 0.139477S3.59851 -1.72254 3.59851 -2.22466ZM2.96389 -2.31532C2.96389 -1.79925 2.96389 -1.28319 2.87323 -0.843836C2.73375 -0.209215 2.25953 -0.0557908 1.98057 -0.0557908C1.65978 -0.0557908 1.23437 -0.244085 1.09489 -0.81594C0.99726 -1.2274 0.99726 -1.79925 0.99726 -2.31532C0.99726 -2.82441 0.99726 -3.35442 1.10187 -3.73798C1.24832 -4.28892 1.69465 -4.43537 1.98057 -4.43537C2.35716 -4.43537 2.7198 -4.20523 2.84533 -3.80075C2.95691 -3.42416 2.96389 -2.92204 2.96389 -2.31532Z' id='g3-48'/>
<path d='M5.18854 -1.63188C5.18854 -1.70859 5.18157 -1.76438 5.06999 -1.76438C5.02814 -1.76438 4.95841 -1.76438 4.95143 -1.67372C4.89564 -0.550934 3.9472 -0.111582 3.25679 -0.111582C2.51059 -0.111582 1.23437 -0.564882 1.23437 -2.37808C1.23437 -4.268 2.5873 -4.65156 3.24284 -4.65156C3.93325 -4.65156 4.75616 -4.19128 4.93748 -2.99178C4.95143 -2.90809 5.0142 -2.90809 5.06301 -2.90809C5.18854 -2.90809 5.18854 -2.94994 5.18854 -3.08941V-4.7213C5.18854 -4.83985 5.18854 -4.90262 5.09091 -4.90262C5.06301 -4.90262 5.02814 -4.90262 4.97235 -4.81893L4.60274 -4.28892C4.30984 -4.58182 3.82864 -4.90262 3.15915 -4.90262C1.69465 -4.90262 0.488169 -3.77285 0.488169 -2.38506C0.488169 -0.969365 1.71557 0.139477 3.15915 0.139477C4.39352 0.139477 5.18854 -0.781071 5.18854 -1.63188Z' id='g3-67'/>
<path d='M5.07696 -1.83412H4.83985C4.65853 -0.781071 4.49813 -0.251059 3.20797 -0.251059H2.1061C1.77833 -0.251059 1.77136 -0.306849 1.77136 -0.523039V-2.33624H2.47572C3.18007 -2.33624 3.28468 -2.12702 3.28468 -1.5203H3.52179V-3.40324H3.28468C3.28468 -2.79651 3.18007 -2.5873 2.47572 -2.5873H1.77136V-4.2122C1.77136 -4.42839 1.77833 -4.48418 2.1061 -4.48418H3.15218C4.29589 -4.48418 4.49813 -4.1076 4.62366 -3.13126H4.86077L4.65156 -4.73524H0.390535V-4.48418H0.557908C1.09489 -4.48418 1.10884 -4.41445 1.10884 -4.17036V-0.564882C1.10884 -0.327771 1.09489 -0.251059 0.557908 -0.251059H0.390535V0H4.76314L5.07696 -1.83412Z' id='g3-69'/>
<path d='M4.75616 -3.13126L4.54695 -4.73524H0.390535V-4.48418H0.557908C1.09489 -4.48418 1.10884 -4.41445 1.10884 -4.17036V-0.564882C1.10884 -0.327771 1.09489 -0.251059 0.557908 -0.251059H0.390535V0L1.45056 -0.0278954L2.67098 0V-0.251059H2.4269C1.77136 -0.251059 1.77136 -0.341719 1.77136 -0.571856V-2.24558H2.44782C3.14521 -2.24558 3.24284 -2.03636 3.24284 -1.42964H3.47995V-3.31258H3.24284C3.24284 -2.71283 3.14521 -2.49664 2.44782 -2.49664H1.77136V-4.2122C1.77136 -4.42839 1.77833 -4.48418 2.1061 -4.48418H3.08244C4.20523 -4.48418 4.39352 -4.1076 4.51905 -3.13126H4.75616Z' id='g3-70'/>
<path d='M5.48144 -4.51208V-4.76314C5.19552 -4.74222 4.91656 -4.73524 4.63064 -4.73524S4.06575 -4.74222 3.77983 -4.76314V-4.51208C4.49813 -4.51208 4.49813 -4.19826 4.49813 -4.00996V-1.05305L1.82017 -4.65853C1.74346 -4.75616 1.73649 -4.76314 1.59701 -4.76314H0.390535V-4.51208H0.599751C0.899626 -4.51208 1.07397 -4.47721 1.10884 -4.47024V-0.753176C1.10884 -0.564882 1.10884 -0.251059 0.390535 -0.251059V0C0.676463 -0.0209215 0.955417 -0.0278954 1.24134 -0.0278954S1.80623 -0.0209215 2.09215 0V-0.251059C1.37385 -0.251059 1.37385 -0.564882 1.37385 -0.753176V-4.27497L4.47024 -0.104608C4.53998 -0.00697385 4.54695 0 4.63064 0C4.76314 0 4.76314 -0.0627646 4.76314 -0.195268V-4.00996C4.76314 -4.19826 4.76314 -4.51208 5.48144 -4.51208Z' id='g3-78'/>
<path d='M4.86077 -3.45205C4.86077 -4.14247 4.0797 -4.76314 3.05455 -4.76314H0.404483V-4.51208H0.571856C1.10884 -4.51208 1.12279 -4.44234 1.12279 -4.19826V-0.564882C1.12279 -0.327771 1.10884 -0.251059 0.571856 -0.251059H0.404483V0L1.45056 -0.0278954L2.50361 0V-0.251059H2.33624C1.79925 -0.251059 1.78531 -0.320797 1.78531 -0.564882V-2.16189H3.05455C4.06575 -2.16189 4.86077 -2.7477 4.86077 -3.45205ZM4.11457 -3.45205C4.11457 -3.14521 4.11457 -2.38506 2.8802 -2.38506H1.75741V-4.2401C1.75741 -4.45629 1.76438 -4.51208 2.09215 -4.51208H2.8802C4.04483 -4.51208 4.11457 -3.85654 4.11457 -3.45205Z' id='g3-80'/>
<path d='M5.61395 0V-0.251059H5.47447C5.0142 -0.251059 4.93051 -0.320797 4.80498 -0.488169L3.15218 -2.67098L4.23313 -4.0797C4.55392 -4.50511 5.09091 -4.51208 5.28618 -4.51208V-4.76314C5.02814 -4.74222 4.77011 -4.73524 4.51208 -4.73524L3.58456 -4.76314V-4.51208C3.90535 -4.49813 3.96812 -4.30286 3.96812 -4.22615C3.96812 -4.14247 3.93325 -4.10062 3.88443 -4.03786L2.99875 -2.8802L1.99452 -4.2122C1.93176 -4.28194 1.93176 -4.29589 1.93176 -4.31681C1.93176 -4.40747 2.09215 -4.50511 2.34321 -4.51208V-4.76314L1.28319 -4.73524C0.948443 -4.73524 0.411457 -4.76314 0.369614 -4.76314V-4.51208H0.509091C0.920548 -4.51208 1.0391 -4.46326 1.17858 -4.27497L2.60822 -2.37111L1.33898 -0.711333C1.1995 -0.530012 0.934496 -0.251059 0.265006 -0.251059V0C0.523039 -0.0209215 0.781071 -0.0278954 1.0391 -0.0278954C1.37385 -0.0278954 1.93176 0 1.96663 0V-0.251059C1.67372 -0.265006 1.58306 -0.432379 1.58306 -0.536986C1.58306 -0.557908 1.58306 -0.627646 1.65978 -0.72528L2.76862 -2.16887L3.99601 -0.54396C4.00996 -0.523039 4.04483 -0.474222 4.04483 -0.446326C4.04483 -0.36264 3.91233 -0.258032 3.63337 -0.251059V0L4.70037 -0.0278954C5.02814 -0.0278954 5.5721 0 5.61395 0Z' id='g3-88'/>
<path d='M5.70461 -4.51208V-4.76314C5.50237 -4.74222 5.23039 -4.73524 5.02117 -4.73524C4.74222 -4.73524 4.22615 -4.76314 4.18431 -4.76314V-4.51208C4.41445 -4.51208 4.53998 -4.40747 4.53998 -4.268C4.53998 -4.17733 4.47721 -4.09365 4.44234 -4.03786L3.1731 -2.22466L1.77136 -4.23313C1.70859 -4.31681 1.70859 -4.33076 1.70859 -4.35866C1.70859 -4.51208 1.98755 -4.51208 2.16189 -4.51208V-4.76314L1.08792 -4.73524C0.72528 -4.73524 0.167372 -4.76314 0.167372 -4.76314V-4.51208H0.306849C0.669489 -4.51208 0.822914 -4.47721 0.962391 -4.27497L2.61519 -1.90386V-0.564882C2.61519 -0.327771 2.60125 -0.251059 2.06426 -0.251059H1.89689V0L2.93599 -0.0278954L3.97509 0V-0.251059H3.80075C3.26376 -0.251059 3.24981 -0.320797 3.24981 -0.592777V-1.90386L4.75616 -4.05878C5.05604 -4.49116 5.50237 -4.51208 5.70461 -4.51208Z' id='g3-89'/>
<path d='M4.37958 -1.90386H4.14247C4.0797 -0.969365 3.95417 -0.278954 2.5873 -0.278954H1.29016L4.27497 -4.47721C4.33076 -4.55392 4.33076 -4.58879 4.33076 -4.63064C4.33076 -4.76314 4.268 -4.76314 4.13549 -4.76314H0.676463L0.592777 -3.15915H0.829888C0.892653 -4.19826 1.3878 -4.51208 2.31532 -4.51208H3.53574L0.550934 -0.299875C0.488169 -0.216189 0.488169 -0.202242 0.488169 -0.139477C0.488169 0 0.54396 0 0.683437 0H4.25405L4.37958 -1.90386Z' id='g3-90'/>
<path d='M3.79377 -0.627646V-1.01121H3.55666V-0.63462C3.55666 -0.564882 3.55666 -0.230137 3.29863 -0.230137S3.0406 -0.557908 3.0406 -0.648568V-1.86899C3.0406 -2.23861 3.0406 -2.50361 2.7198 -2.76164C2.43387 -2.99875 2.09913 -3.11034 1.68767 -3.11034C1.02516 -3.11034 0.557908 -2.85928 0.557908 -2.43387C0.557908 -2.21071 0.711333 -2.09215 0.892653 -2.09215C1.08095 -2.09215 1.22042 -2.23163 1.22042 -2.41993C1.22042 -2.53848 1.16463 -2.68493 0.976339 -2.74072C1.2274 -2.91507 1.63188 -2.91507 1.67372 -2.91507C2.06426 -2.91507 2.48966 -2.65704 2.48966 -2.07123V-1.85504C2.1061 -1.8411 1.64583 -1.82017 1.13674 -1.63188C0.509091 -1.40174 0.313823 -1.01818 0.313823 -0.704359C0.313823 -0.104608 1.0391 0.0697385 1.53425 0.0697385C2.09215 0.0697385 2.41993 -0.244085 2.56638 -0.516065C2.59427 -0.230137 2.78257 0.0348692 3.10336 0.0348692C3.10336 0.0348692 3.79377 0.0348692 3.79377 -0.627646ZM2.48966 -0.983313C2.48966 -0.313823 1.90386 -0.125529 1.59004 -0.125529C1.23437 -0.125529 0.899626 -0.36264 0.899626 -0.704359C0.899626 -1.08792 1.23437 -1.62491 2.48966 -1.67372V-0.983313Z' id='g3-97'/>
<path d='M4.05181 0V-0.251059C3.58456 -0.251059 3.52877 -0.299875 3.52877 -0.641594V-4.83985L2.48269 -4.76314V-4.51208C2.94994 -4.51208 3.00573 -4.46326 3.00573 -4.12154V-2.67796C2.7477 -2.92902 2.41295 -3.07547 2.02939 -3.07547C1.10187 -3.07547 0.320797 -2.37808 0.320797 -1.49938C0.320797 -0.627646 1.06002 0.0697385 1.9457 0.0697385C2.51756 0.0697385 2.85928 -0.237111 2.97783 -0.36264V0.0697385L4.05181 0ZM2.97783 -0.732254C2.79651 -0.404483 2.44085 -0.125529 1.98755 -0.125529C1.59701 -0.125529 1.31806 -0.355666 1.17858 -0.557908C1.0391 -0.767123 0.955417 -1.04608 0.955417 -1.4924C0.955417 -1.6528 0.955417 -2.17584 1.24134 -2.50361C1.5203 -2.81743 1.86202 -2.8802 2.06426 -2.8802C2.399 -2.8802 2.69888 -2.72677 2.89415 -2.47572C2.97783 -2.36413 2.97783 -2.35716 2.97783 -2.22466V-0.732254Z' id='g3-100'/>
<path d='M3.26376 -0.836862C3.26376 -0.864757 3.24981 -0.934496 3.14521 -0.934496C3.05455 -0.934496 3.0406 -0.892653 3.01968 -0.822914C2.80349 -0.258032 2.27347 -0.153425 2.02242 -0.153425C1.69465 -0.153425 1.38082 -0.299875 1.17161 -0.564882C0.913574 -0.892653 0.9066 -1.31806 0.9066 -1.59004H3.06849C3.21494 -1.59004 3.26376 -1.59004 3.26376 -1.74346C3.26376 -2.35716 2.92204 -3.11034 1.88294 -3.11034C0.969365 -3.11034 0.27198 -2.38506 0.27198 -1.52727C0.27198 -0.641594 1.04608 0.0697385 1.9736 0.0697385C2.91507 0.0697385 3.26376 -0.683437 3.26376 -0.836862ZM2.77559 -1.77136H0.913574C0.990286 -2.75467 1.61793 -2.91507 1.88294 -2.91507C2.74072 -2.91507 2.76862 -1.9457 2.77559 -1.77136Z' id='g3-101'/>
<path d='M3.80075 -2.78954C3.80075 -2.94994 3.66824 -3.14521 3.38929 -3.14521C3.28468 -3.14521 2.90809 -3.12428 2.58032 -2.82441C2.37111 -2.97783 2.07821 -3.07547 1.77136 -3.07547C1.05305 -3.07547 0.530012 -2.59427 0.530012 -2.05031C0.530012 -1.77833 0.669489 -1.52727 0.864757 -1.34595C0.808966 -1.28319 0.655542 -1.05305 0.655542 -0.781071C0.655542 -0.690411 0.676463 -0.36264 0.948443 -0.160399C0.63462 -0.0557908 0.27198 0.174346 0.27198 0.536986C0.27198 1.04608 1.0391 1.42964 1.98057 1.42964C2.86625 1.42964 3.68917 1.08095 3.68917 0.523039C3.68917 0.313823 3.60548 -0.0627646 3.22192 -0.27198C2.81046 -0.488169 2.399 -0.488169 1.72254 -0.488169C1.56912 -0.488169 1.31806 -0.488169 1.26227 -0.495143C1.0391 -0.54396 0.913574 -0.753176 0.913574 -0.955417C0.913574 -1.12976 0.962391 -1.18555 1.00423 -1.24134C1.10884 -1.17858 1.3599 -1.02516 1.76438 -1.02516C2.48269 -1.02516 3.00573 -1.50635 3.00573 -2.05031C3.00573 -2.32229 2.8802 -2.53848 2.71283 -2.7198C3.02665 -2.94296 3.29863 -2.94994 3.41719 -2.94994C3.38929 -2.92204 3.35442 -2.89415 3.35442 -2.78257C3.35442 -2.64309 3.45903 -2.5594 3.57758 -2.5594C3.67522 -2.5594 3.80075 -2.62914 3.80075 -2.78954ZM2.44782 -2.05031C2.44782 -1.93873 2.44782 -1.65978 2.30834 -1.47846C2.21071 -1.3599 2.02242 -1.23437 1.77136 -1.23437C1.08792 -1.23437 1.08792 -1.90386 1.08792 -2.05031C1.08792 -2.16189 1.08792 -2.44085 1.2274 -2.62217C1.32503 -2.74072 1.51333 -2.86625 1.76438 -2.86625C2.44782 -2.86625 2.44782 -2.19676 2.44782 -2.05031ZM3.26376 0.530012C3.26376 0.899626 2.71283 1.22042 1.98057 1.22042S0.697385 0.892653 0.697385 0.530012C0.697385 0.285928 0.920548 -0.0139477 1.36687 -0.0209215H1.77136C2.39203 -0.0209215 3.26376 -0.0209215 3.26376 0.530012Z' id='g3-103'/>
<path d='M4.11457 0V-0.251059C3.66127 -0.251059 3.59153 -0.251059 3.59153 -0.550934V-2.11308C3.59153 -2.7198 3.29166 -3.07547 2.54545 -3.07547C1.92478 -3.07547 1.58306 -2.70585 1.42964 -2.44085H1.42267V-4.83985L0.376588 -4.76314V-4.51208C0.843836 -4.51208 0.899626 -4.46326 0.899626 -4.12154V-0.550934C0.899626 -0.251059 0.829888 -0.251059 0.376588 -0.251059V0C0.376588 0 0.878705 -0.0278954 1.17161 -0.0278954C1.42964 -0.0278954 1.91083 -0.00697385 1.9736 0V-0.251059C1.5203 -0.251059 1.45056 -0.251059 1.45056 -0.550934V-1.80623C1.45056 -2.53848 2.02939 -2.8802 2.48966 -2.8802C2.97783 -2.8802 3.0406 -2.49664 3.0406 -2.14097V-0.550934C3.0406 -0.251059 2.97086 -0.251059 2.51756 -0.251059V0C2.51756 0 3.01968 -0.0278954 3.31258 -0.0278954C3.57061 -0.0278954 4.05181 -0.00697385 4.11457 0Z' id='g3-104'/>
<path d='M1.91083 0V-0.251059C1.50635 -0.251059 1.43661 -0.251059 1.43661 -0.54396V-3.07547L0.411457 -2.99875V-2.7477C0.850809 -2.7477 0.913574 -2.70585 0.913574 -2.36413V-0.550934C0.913574 -0.251059 0.843836 -0.251059 0.390535 -0.251059V0C0.390535 0 0.892653 -0.0278954 1.17161 -0.0278954C1.41569 -0.0278954 1.66675 -0.0209215 1.91083 0ZM1.52727 -4.19826C1.52727 -4.42142 1.35293 -4.60274 1.12976 -4.60274C0.892653 -4.60274 0.732254 -4.40747 0.732254 -4.20523C0.732254 -3.98207 0.9066 -3.80075 1.12976 -3.80075C1.36687 -3.80075 1.52727 -3.99601 1.52727 -4.19826Z' id='g3-105'/>
<path d='M1.69465 0.320797V-3.07547L0.592777 -2.99875V-2.7477C1.10884 -2.7477 1.17161 -2.69888 1.17161 -2.35716V0.334745C1.17161 0.599751 1.11582 1.2274 0.648568 1.2274C0.627646 1.2274 0.460274 1.2274 0.299875 1.15766C0.313823 1.15068 0.474222 1.067 0.474222 0.857783C0.474222 0.669489 0.334745 0.530012 0.146451 0.530012C-0.0557908 0.530012 -0.188294 0.669489 -0.188294 0.864757C-0.188294 1.24134 0.230137 1.42267 0.655542 1.42267C1.22042 1.42267 1.69465 0.983313 1.69465 0.320797ZM1.69465 -4.19826C1.69465 -4.42142 1.5203 -4.60274 1.29714 -4.60274C1.06002 -4.60274 0.899626 -4.40747 0.899626 -4.20523C0.899626 -3.98207 1.07397 -3.80075 1.29714 -3.80075C1.53425 -3.80075 1.69465 -3.99601 1.69465 -4.19826Z' id='g3-106'/>
<path d='M1.95965 0V-0.251059C1.50635 -0.251059 1.43661 -0.251059 1.43661 -0.550934V-4.83985L0.390535 -4.76314V-4.51208C0.857783 -4.51208 0.913574 -4.46326 0.913574 -4.12154V-0.550934C0.913574 -0.251059 0.843836 -0.251059 0.390535 -0.251059V0C0.390535 0 0.892653 -0.0278954 1.17161 -0.0278954C1.43661 -0.0278954 1.69465 -0.0209215 1.95965 0Z' id='g3-108'/>
<path d='M6.25554 0V-0.251059C5.80224 -0.251059 5.7325 -0.251059 5.7325 -0.550934V-2.11308C5.7325 -2.7198 5.43263 -3.07547 4.68643 -3.07547C4.13549 -3.07547 3.7589 -2.77559 3.57061 -2.4269C3.43113 -2.92204 3.05455 -3.07547 2.54545 -3.07547C1.9736 -3.07547 1.60399 -2.76164 1.40872 -2.399H1.40174V-3.07547L0.376588 -2.99875V-2.7477C0.843836 -2.7477 0.899626 -2.69888 0.899626 -2.35716V-0.550934C0.899626 -0.251059 0.829888 -0.251059 0.376588 -0.251059V0C0.376588 0 0.878705 -0.0278954 1.17161 -0.0278954C1.42964 -0.0278954 1.91083 -0.00697385 1.9736 0V-0.251059C1.5203 -0.251059 1.45056 -0.251059 1.45056 -0.550934V-1.80623C1.45056 -2.53848 2.02939 -2.8802 2.48966 -2.8802C2.97783 -2.8802 3.0406 -2.49664 3.0406 -2.14097V-0.550934C3.0406 -0.251059 2.97086 -0.251059 2.51756 -0.251059V0C2.51756 0 3.01968 -0.0278954 3.31258 -0.0278954C3.57061 -0.0278954 4.05181 -0.00697385 4.11457 0V-0.251059C3.66127 -0.251059 3.59153 -0.251059 3.59153 -0.550934V-1.80623C3.59153 -2.53848 4.17036 -2.8802 4.63064 -2.8802C5.1188 -2.8802 5.18157 -2.49664 5.18157 -2.14097V-0.550934C5.18157 -0.251059 5.11183 -0.251059 4.65853 -0.251059V0C4.65853 0 5.16065 -0.0278954 5.45355 -0.0278954C5.71158 -0.0278954 6.19278 -0.00697385 6.25554 0Z' id='g3-109'/>
<path d='M4.11457 0V-0.251059C3.66127 -0.251059 3.59153 -0.251059 3.59153 -0.550934V-2.11308C3.59153 -2.7198 3.29166 -3.07547 2.54545 -3.07547C1.9736 -3.07547 1.60399 -2.76164 1.40872 -2.399H1.40174V-3.07547L0.376588 -2.99875V-2.7477C0.843836 -2.7477 0.899626 -2.69888 0.899626 -2.35716V-0.550934C0.899626 -0.251059 0.829888 -0.251059 0.376588 -0.251059V0C0.376588 0 0.878705 -0.0278954 1.17161 -0.0278954C1.42964 -0.0278954 1.91083 -0.00697385 1.9736 0V-0.251059C1.5203 -0.251059 1.45056 -0.251059 1.45056 -0.550934V-1.80623C1.45056 -2.53848 2.02939 -2.8802 2.48966 -2.8802C2.97783 -2.8802 3.0406 -2.49664 3.0406 -2.14097V-0.550934C3.0406 -0.251059 2.97086 -0.251059 2.51756 -0.251059V0C2.51756 0 3.01968 -0.0278954 3.31258 -0.0278954C3.57061 -0.0278954 4.05181 -0.00697385 4.11457 0Z' id='g3-110'/>
<path d='M3.68917 -1.48543C3.68917 -2.35716 2.94296 -3.11034 1.98057 -3.11034S0.27198 -2.35716 0.27198 -1.48543C0.27198 -0.620672 1.0391 0.0697385 1.98057 0.0697385S3.68917 -0.620672 3.68917 -1.48543ZM3.05455 -1.54819C3.05455 -1.21345 3.03362 -0.843836 2.83138 -0.557908C2.64309 -0.292902 2.32229 -0.153425 1.98057 -0.153425C1.72254 -0.153425 1.34595 -0.237111 1.11582 -0.578829C0.927522 -0.864757 0.9066 -1.2274 0.9066 -1.54819C0.9066 -1.84807 0.913574 -2.25953 1.15766 -2.5594C1.332 -2.76164 1.62491 -2.91507 1.98057 -2.91507C2.39203 -2.91507 2.68493 -2.7198 2.83836 -2.50361C3.03362 -2.23163 3.05455 -1.88294 3.05455 -1.54819Z' id='g3-111'/>
<path d='M4.07273 -1.50635C4.07273 -2.36413 3.36139 -3.07547 2.47572 -3.07547C2.07821 -3.07547 1.67372 -2.92902 1.3878 -2.65006V-3.07547L0.341719 -2.99875V-2.7477C0.829888 -2.7477 0.864757 -2.71283 0.864757 -2.41993V0.801993C0.864757 1.10187 0.795019 1.10187 0.341719 1.10187V1.35293C0.341719 1.35293 0.843836 1.32503 1.13674 1.32503C1.39477 1.32503 1.87597 1.34595 1.93873 1.35293V1.10187C1.48543 1.10187 1.41569 1.10187 1.41569 0.801993V-0.334745C1.45056 -0.299875 1.77833 0.0697385 2.36413 0.0697385C3.28468 0.0697385 4.07273 -0.620672 4.07273 -1.50635ZM3.43811 -1.50635C3.43811 -0.711333 2.91507 -0.125529 2.32229 -0.125529C1.70859 -0.125529 1.43661 -0.662516 1.41569 -0.704359V-2.32229C1.62491 -2.67098 2.02939 -2.8523 2.399 -2.8523C2.98481 -2.8523 3.43811 -2.23861 3.43811 -1.50635Z' id='g3-112'/>
<path d='M4.05181 1.35293V1.10187C3.59851 1.10187 3.52877 1.10187 3.52877 0.801993V-3.07547H3.31955L3.06849 -2.46874C2.8523 -2.80349 2.50361 -3.07547 2.00847 -3.07547C1.10884 -3.07547 0.320797 -2.39203 0.320797 -1.49938C0.320797 -0.627646 1.067 0.0697385 1.9457 0.0697385C2.50361 0.0697385 2.80349 -0.230137 2.97783 -0.404483V0.801993C2.97783 1.10187 2.90809 1.10187 2.45479 1.10187V1.35293C2.45479 1.35293 2.95691 1.32503 3.24981 1.32503C3.50785 1.32503 3.98904 1.34595 4.05181 1.35293ZM3.00573 -1.00423C3.00573 -0.878705 3.00573 -0.850809 2.90112 -0.669489C2.69191 -0.327771 2.34321 -0.125529 1.98755 -0.125529C1.40872 -0.125529 0.955417 -0.753176 0.955417 -1.4924C0.955417 -2.30834 1.50635 -2.8523 2.06426 -2.8523C2.65006 -2.8523 3.00573 -2.28045 3.00573 -1.88991V-1.00423Z' id='g3-113'/>
<path d='M2.83836 -2.62914C2.83836 -2.86625 2.61519 -3.07547 2.28742 -3.07547C1.93873 -3.07547 1.55517 -2.85928 1.34595 -2.32927H1.33898V-3.07547L0.341719 -2.99875V-2.7477C0.808966 -2.7477 0.864757 -2.69888 0.864757 -2.35716V-0.550934C0.864757 -0.251059 0.795019 -0.251059 0.341719 -0.251059V0C0.376588 0 0.850809 -0.0278954 1.13674 -0.0278954L2.04334 0V-0.251059H1.90386C1.3878 -0.251059 1.3878 -0.327771 1.3878 -0.564882V-1.59004C1.3878 -2.17584 1.65978 -2.8802 2.32229 -2.8802C2.25953 -2.83138 2.20374 -2.74072 2.20374 -2.62914C2.20374 -2.399 2.38506 -2.30834 2.51756 -2.30834C2.68493 -2.30834 2.83836 -2.41993 2.83836 -2.62914Z' id='g3-114'/>
<path d='M2.83836 -0.913574C2.83836 -1.17858 2.7198 -1.3878 2.53848 -1.55517C2.27347 -1.79925 1.95268 -1.85504 1.70859 -1.89689C1.15068 -1.99452 0.697385 -2.07821 0.697385 -2.44782C0.697385 -2.67098 0.885679 -2.94296 1.54819 -2.94296C2.35716 -2.94296 2.39203 -2.37808 2.40598 -2.17584C2.41295 -2.09913 2.49664 -2.09913 2.52453 -2.09913C2.64309 -2.09913 2.64309 -2.14795 2.64309 -2.28045V-2.92902C2.64309 -3.04757 2.64309 -3.11034 2.54545 -3.11034C2.51059 -3.11034 2.49664 -3.11034 2.40598 -3.02665C2.39203 -3.01968 2.32229 -2.95691 2.28045 -2.92204C2.07123 -3.06849 1.80623 -3.11034 1.54819 -3.11034C0.550934 -3.11034 0.313823 -2.5873 0.313823 -2.23861C0.313823 -2.01544 0.411457 -1.83412 0.578829 -1.69465C0.843836 -1.46451 1.10884 -1.41569 1.54122 -1.34595C1.88991 -1.28319 2.45479 -1.18555 2.45479 -0.718306C2.45479 -0.446326 2.2665 -0.125529 1.59701 -0.125529S0.683437 -0.564882 0.557908 -1.0391C0.536986 -1.12976 0.530012 -1.15766 0.432379 -1.15766C0.313823 -1.15766 0.313823 -1.10884 0.313823 -0.969365V-0.111582C0.313823 0.00697385 0.313823 0.0697385 0.411457 0.0697385C0.474222 0.0697385 0.606725 -0.0767123 0.746202 -0.230137C1.05305 0.0557908 1.42964 0.0697385 1.59701 0.0697385C2.50361 0.0697385 2.83836 -0.418431 2.83836 -0.913574Z' id='g3-115'/>
<path d='M2.61519 -0.878705V-1.26227H2.37808V-0.885679C2.37808 -0.411457 2.15492 -0.153425 1.88294 -0.153425C1.40174 -0.153425 1.40174 -0.739228 1.40174 -0.864757V-2.75467H2.48966V-3.00573H1.40174V-4.28892H1.16463C1.15766 -3.66127 0.871731 -2.97086 0.202242 -2.94994V-2.75467H0.850809V-0.871731C0.850809 -0.09066 1.43661 0.0697385 1.82715 0.0697385C2.2944 0.0697385 2.61519 -0.327771 2.61519 -0.878705Z' id='g3-116'/>
<path d='M4.11457 0V-0.251059C3.64732 -0.251059 3.59153 -0.299875 3.59153 -0.641594V-3.07547L2.51756 -2.99875V-2.7477C2.98481 -2.7477 3.0406 -2.69888 3.0406 -2.35716V-1.16463C3.0406 -0.550934 2.64309 -0.125529 2.11308 -0.125529C1.47846 -0.125529 1.45056 -0.425405 1.45056 -0.781071V-3.07547L0.376588 -2.99875V-2.7477C0.899626 -2.7477 0.899626 -2.72677 0.899626 -2.1061V-1.06002C0.899626 -0.578829 0.899626 0.0697385 2.06426 0.0697385C2.21768 0.0697385 2.72677 0.0697385 3.06152 -0.516065H3.06849V0.0697385L4.11457 0Z' id='g3-117'/>
<path d='M4.00299 0V-0.251059C3.53574 -0.251059 3.47995 -0.292902 3.31955 -0.474222L2.36413 -1.56214L2.30834 -1.63188C2.30834 -1.6528 2.76862 -2.14795 2.83138 -2.21071C3.07547 -2.48269 3.31955 -2.7477 3.87049 -2.75467V-3.00573C3.67522 -2.99178 3.47298 -2.97783 3.28468 -2.97783C3.07547 -2.97783 2.80349 -2.98481 2.59427 -3.00573V-2.75467C2.71283 -2.73375 2.73375 -2.65704 2.73375 -2.59427C2.73375 -2.59427 2.73375 -2.47572 2.62914 -2.35716L2.14097 -1.80623L1.56214 -2.46874C1.4924 -2.54545 1.48543 -2.58032 1.48543 -2.60822C1.48543 -2.71283 1.58306 -2.75467 1.67372 -2.75467V-3.00573C1.41569 -2.98481 1.15068 -2.97783 0.892653 -2.97783C0.683437 -2.97783 0.418431 -2.98481 0.216189 -3.00573V-2.75467C0.536986 -2.75467 0.718306 -2.75467 0.899626 -2.54545L1.77136 -1.54122L1.82715 -1.47148C1.82715 -1.45056 1.30411 -0.878705 1.23437 -0.801993C0.976339 -0.523039 0.739228 -0.265006 0.18132 -0.251059V0C0.390535 -0.0139477 0.54396 -0.0278954 0.760149 -0.0278954C0.969365 -0.0278954 1.24832 -0.0209215 1.45753 0V-0.251059C1.37385 -0.265006 1.31806 -0.313823 1.31806 -0.411457C1.31806 -0.54396 1.39477 -0.63462 1.50635 -0.753176L1.99452 -1.29016L2.60125 -0.599751C2.73375 -0.4533 2.73375 -0.439352 2.73375 -0.397509C2.73375 -0.258032 2.57335 -0.251059 2.54545 -0.251059V0C2.60822 -0.00697385 3.11034 -0.0278954 3.3335 -0.0278954S3.77983 -0.0209215 4.00299 0Z' id='g3-120'/>
</defs>
<g id='page1' transform='matrix(1 0 0 -1 0 0)'>
<path d='M123.934 -113.129L101.914 -129.391' fill='none' stroke='#000000' stroke-width='0.399994'/>
<path d='M100.305 -130.582L103.832 -129.965L101.914 -129.39L101.93 -127.39'/>
<g transform='matrix(1 0 0 -1 39.6457 -97.1019)'>
<use x='51.9331' xlink:href='#g3-88' y='41.1301'/>
</g>
<path d='M123.933 -113.129L255.941 -116.16' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M257.934 -116.207L254.782 -114.539L255.942 -116.16L254.707 -117.726'/>
<g transform='matrix(1 0 0 -1 203.058 -82.7279)'>
<use x='51.9331' xlink:href='#g3-89' y='41.1301'/>
</g>
<path d='M123.933 -113.129V-14.6249' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M123.933 -12.6328L122.34 -15.8203L123.933 -14.625L125.527 -15.8203'/>
<g transform='matrix(1 0 0 -1 69.5859 31.3454)'>
<use x='51.9331' xlink:href='#g3-90' y='41.1301'/>
</g>
<path d='M12.266 -110.566C1.394 -118.598 42.5702 -126.258 104.242 -127.672C165.918 -129.09 224.726 -123.727 235.598 -115.695' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<path d='M235.598 -115.695C246.473 -107.664 205.293 -100.004 143.621 -98.5858C81.9491 -97.1718 23.141 -102.535 12.266 -110.566' fill='none' stroke='#000000' stroke-dasharray='0.79701,1.99255' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<path d='M112.121 -121.855L179.121 -123.394L190.934 -114.668V-64.4179L123.933 -62.8788L112.121 -71.6054V-121.855M112.121 -71.6054L179.121 -73.1444V-123.394M179.121 -73.1444L190.934 -64.4179' fill='none' stroke='#40bf40' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<g fill='#40bf40' transform='matrix(1 0 0 -1 91.5409 -87.5429)'>
<use x='51.9331' xlink:href='#g1-121' y='41.1301'/>
</g>
<g fill='#40bf40' transform='matrix(1 0 0 -1 136.139 -83.9499)'>
<use x='51.9331' xlink:href='#g1-120' y='41.1301'/>
</g>
<g fill='#40bf40' transform='matrix(1 0 0 -1 142.046 -49.9147)'>
<use x='51.9331' xlink:href='#g1-122' y='41.1301'/>
</g>
<path d='M123.933 -113.129L179.121 -123.394M123.933 -113.129L179.121 -73.1444' fill='none' stroke='#ff0000' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<g fill='#ff0000' transform='matrix(1 0 0 -1 114.096 -75.8089)'>
<use x='51.9331' xlink:href='#g1-112' y='41.1301'/>
</g>
<g fill='#ff0000' transform='matrix(1 0 0 -1 108.674 -40.9641)'>
<use x='51.9331' xlink:href='#g1-114' y='41.1301'/>
</g>
<g transform='matrix(1 0 0 -1 76.9989 -84.0139)'>
<use x='51.9331' xlink:href='#g1-21' y='41.1301'/>
</g>
<path d='M118.027 -117.492C126.91 -117.695 136.055 -117.433 141.461 -116.941' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M143.445 -116.758L140.125 -115.461L141.461 -116.942L140.414 -118.637'/>
<g transform='matrix(1 0 0 -1 93.4399 -69.5899)'>
<use x='51.9331' xlink:href='#g1-30' y='41.1301'/>
</g>
<path d='M143.445 -116.758C143.445 -111.562 142.191 -106.258 140.754 -103.371' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M139.863 -101.582L139.855 -105.16L140.754 -103.371L142.718 -103.734'/>
<path d='M123.933 -113.129V-211.637' fill='none' stroke='#000000' stroke-dasharray='2.98883,2.98883' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M123.933 -213.629L125.527 -210.442L123.933 -211.637L122.34 -210.442'/>
<path d='M123.933 -29.3788C113.059 -37.414 104.242 -81.4179 104.242 -127.672C104.242 -173.926 113.059 -204.91 123.933 -196.879' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<path d='M123.933 -196.879C134.809 -188.848 143.621 -144.84 143.621 -98.5858C143.621 -52.3319 134.809 -21.3476 123.933 -29.3788' fill='none' stroke='#000000' stroke-dasharray='0.79701,1.99255' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<path d='M123.933 -29.3788C185.605 -30.7968 235.598 -69.4413 235.598 -115.695C235.598 -161.949 185.605 -198.297 123.933 -196.879C62.2616 -195.465 12.266 -156.82 12.266 -110.566C12.266 -64.3124 62.2616 -27.9647 123.933 -29.3788' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<g transform='matrix(1 0 0 -1 30.8813 17.7227)'>
<use x='51.9331' xlink:href='#g3-78' y='41.1301'/>
<use x='57.792' xlink:href='#g3-111' y='41.1301'/>
<use x='61.7483' xlink:href='#g3-114' y='41.1301'/>
<use x='64.85' xlink:href='#g3-116' y='41.1301'/>
<use x='67.9517' xlink:href='#g3-104' y='41.1301'/>
<use x='75.0198' xlink:href='#g3-80' y='41.1301'/>
<use x='80.1403' xlink:href='#g3-111' y='41.1301'/>
<use x='84.0965' xlink:href='#g3-108' y='41.1301'/>
<use x='86.3436' xlink:href='#g3-101' y='41.1301'/>
</g>
<g transform='matrix(1 0 0 -1 119.061 -107.935)'>
<use x='51.9331' xlink:href='#g3-69' y='36.9319'/>
<use x='57.268' xlink:href='#g3-113' y='36.9319'/>
<use x='61.4382' xlink:href='#g3-117' y='36.9319'/>
<use x='65.8219' xlink:href='#g3-97' y='36.9319'/>
<use x='69.7782' xlink:href='#g3-116' y='36.9319'/>
<use x='72.8798' xlink:href='#g3-111' y='36.9319'/>
<use x='76.8361' xlink:href='#g3-114' y='36.9319'/>
<use x='51.9331' xlink:href='#g3-40' y='44.9021'/>
<use x='55.0348' xlink:href='#g3-48' y='44.9021'/>
<use x='58.991' xlink:href='#g0-14' y='41.8955'/>
<use x='63.156' xlink:href='#g3-108' y='44.9021'/>
<use x='65.4031' xlink:href='#g3-97' y='44.9021'/>
<use x='69.3594' xlink:href='#g3-116' y='44.9021'/>
<use x='72.4611' xlink:href='#g3-105' y='44.9021'/>
<use x='74.7082' xlink:href='#g3-116' y='44.9021'/>
<use x='77.8099' xlink:href='#g3-117' y='44.9021'/>
<use x='82.1936' xlink:href='#g3-100' y='44.9021'/>
<use x='86.5774' xlink:href='#g3-101' y='44.9021'/>
<use x='90.1063' xlink:href='#g3-41' y='44.9021'/>
</g>
<g transform='matrix(1 0 0 -1 -10.7622 -30.5868)'>
<use x='51.9331' xlink:href='#g3-80' y='36.9319'/>
<use x='57.268' xlink:href='#g3-114' y='36.9319'/>
<use x='60.3697' xlink:href='#g3-105' y='36.9319'/>
<use x='62.6168' xlink:href='#g3-109' y='36.9319'/>
<use x='69.1373' xlink:href='#g3-101' y='36.9319'/>
<use x='75.2305' xlink:href='#g3-109' y='36.9319'/>
<use x='81.751' xlink:href='#g3-101' y='36.9319'/>
<use x='85.28' xlink:href='#g3-114' y='36.9319'/>
<use x='88.3817' xlink:href='#g3-105' y='36.9319'/>
<use x='90.6288' xlink:href='#g3-100' y='36.9319'/>
<use x='95.0125' xlink:href='#g3-105' y='36.9319'/>
<use x='97.2597' xlink:href='#g3-97' y='36.9319'/>
<use x='101.216' xlink:href='#g3-110' y='36.9319'/>
<use x='51.9331' xlink:href='#g3-40' y='44.9021'/>
<use x='55.0348' xlink:href='#g3-48' y='44.9021'/>
<use x='58.991' xlink:href='#g0-14' y='41.8955'/>
<use x='63.156' xlink:href='#g3-108' y='44.9021'/>
<use x='65.4031' xlink:href='#g3-111' y='44.9021'/>
<use x='69.3594' xlink:href='#g3-110' y='44.9021'/>
<use x='73.7431' xlink:href='#g3-103' y='44.9021'/>
<use x='77.6994' xlink:href='#g3-105' y='44.9021'/>
<use x='79.9465' xlink:href='#g3-116' y='44.9021'/>
<use x='83.0482' xlink:href='#g3-117' y='44.9021'/>
<use x='87.4319' xlink:href='#g3-100' y='44.9021'/>
<use x='91.8157' xlink:href='#g3-101' y='44.9021'/>
<use x='95.3446' xlink:href='#g3-41' y='44.9021'/>
</g>
<g transform='matrix(1 0 0 -1 160.043 32.6451)'>
<use x='51.9331' xlink:href='#g1-30' y='41.1301'/>
<use x='58.9733' xlink:href='#g2-61' y='41.1301'/>
<use x='67.7509' xlink:href='#g3-108' y='41.1301'/>
<use x='69.998' xlink:href='#g3-97' y='41.1301'/>
<use x='73.9543' xlink:href='#g3-116' y='41.1301'/>
<use x='77.056' xlink:href='#g3-105' y='41.1301'/>
<use x='79.3031' xlink:href='#g3-116' y='41.1301'/>
<use x='82.4048' xlink:href='#g3-117' y='41.1301'/>
<use x='86.7885' xlink:href='#g3-100' y='41.1301'/>
<use x='91.1723' xlink:href='#g3-101' y='41.1301'/>
</g>
<g transform='matrix(1 0 0 -1 154.85 25.945)'>
<use x='51.9331' xlink:href='#g1-21' y='41.1301'/>
<use x='58.9085' xlink:href='#g2-61' y='41.1301'/>
<use x='67.6861' xlink:href='#g3-108' y='41.1301'/>
<use x='69.9332' xlink:href='#g3-111' y='41.1301'/>
<use x='73.8895' xlink:href='#g3-110' y='41.1301'/>
<use x='78.2732' xlink:href='#g3-103' y='41.1301'/>
<use x='82.2295' xlink:href='#g3-105' y='41.1301'/>
<use x='84.4766' xlink:href='#g3-116' y='41.1301'/>
<use x='87.5783' xlink:href='#g3-117' y='41.1301'/>
<use x='91.9621' xlink:href='#g3-100' y='41.1301'/>
<use x='96.3458' xlink:href='#g3-101' y='41.1301'/>
</g>
<g fill='#8080ff' transform='matrix(1 0 0 -1 151.025 19.4706)'>
<use x='51.9331' xlink:href='#g1-97' y='41.1301'/>
<use x='58.5061' xlink:href='#g2-61' y='41.1301'/>
<use x='67.2837' xlink:href='#g3-109' y='41.1301'/>
<use x='73.8042' xlink:href='#g3-97' y='41.1301'/>
<use x='77.975' xlink:href='#g3-106' y='41.1301'/>
<use x='80.4356' xlink:href='#g3-111' y='41.1301'/>
<use x='84.3919' xlink:href='#g3-114' y='41.1301'/>
<use x='90.178' xlink:href='#g3-97' y='41.1301'/>
<use x='94.1342' xlink:href='#g3-120' y='41.1301'/>
<use x='98.3044' xlink:href='#g3-105' y='41.1301'/>
<use x='100.552' xlink:href='#g3-115' y='41.1301'/>
</g>
<g fill='#d24d79' transform='matrix(1 0 0 -1 151.843 11.868)'>
<use x='51.9331' xlink:href='#g1-98' y='41.1301'/>
<use x='57.6912' xlink:href='#g2-61' y='41.1301'/>
<use x='66.4689' xlink:href='#g3-109' y='41.1301'/>
<use x='72.9894' xlink:href='#g3-105' y='41.1301'/>
<use x='75.2365' xlink:href='#g3-110' y='41.1301'/>
<use x='79.6202' xlink:href='#g3-111' y='41.1301'/>
<use x='83.5765' xlink:href='#g3-114' y='41.1301'/>
<use x='89.3626' xlink:href='#g3-97' y='41.1301'/>
<use x='93.3188' xlink:href='#g3-120' y='41.1301'/>
<use x='97.489' xlink:href='#g3-105' y='41.1301'/>
<use x='99.7361' xlink:href='#g3-115' y='41.1301'/>
</g>
<g fill='#40bf40' transform='matrix(1 0 0 -1 119.57 5.8653)'>
<use x='51.9331' xlink:href='#g1-120' y='41.1301'/>
<use x='56.434' xlink:href='#g1-59' y='41.1301'/>
<use x='60.1519' xlink:href='#g1-121' y='41.1301'/>
<use x='64.4275' xlink:href='#g1-59' y='41.1301'/>
<use x='68.1454' xlink:href='#g1-122' y='41.1301'/>
<use x='74.4913' xlink:href='#g2-61' y='41.1301'/>
<use x='83.2689' xlink:href='#g3-69' y='41.1301'/>
<use x='88.6038' xlink:href='#g3-67' y='41.1301'/>
<use x='94.2697' xlink:href='#g3-69' y='41.1301'/>
<use x='99.6047' xlink:href='#g3-70' y='41.1301'/>
<use x='107.411' xlink:href='#g3-112' y='41.1301'/>
<use x='112.009' xlink:href='#g3-111' y='41.1301'/>
<use x='115.965' xlink:href='#g3-115' y='41.1301'/>
<use x='119.109' xlink:href='#g3-105' y='41.1301'/>
<use x='121.357' xlink:href='#g3-116' y='41.1301'/>
<use x='124.458' xlink:href='#g3-105' y='41.1301'/>
<use x='126.705' xlink:href='#g3-111' y='41.1301'/>
<use x='130.662' xlink:href='#g3-110' y='41.1301'/>
</g>
<path d='M205.391 -146.125C213.406 -140.109 209.793 -130.453 203.371 -125.637' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M201.777 -124.441L203.371 -127.629L203.371 -125.637L205.281 -125.078'/>
<path d='M79.2655 -61.8554C79.2655 -53.3515 98.078 -45.7968 107.426 -45.7968' fill='none' stroke='#000000' stroke-miterlimit='10.0375' stroke-width='0.399994'/>
<path d='M109.418 -45.7968L106.23 -44.2031L107.426 -45.7968L106.23 -47.3906'/>
<path d='M123.933 -113.129C122.445 -112.371 120.449 -112.605 118.445 -114.086L116.617 -115.437C114.613 -116.918 112.617 -117.152 111.129 -116.394C111.418 -118.039 110.605 -119.879 108.602 -121.355L106.773 -122.707C104.769 -124.187 103.957 -126.023 104.246 -127.672' fill='none' stroke='#8080ff' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<g fill='#8080ff' transform='matrix(1 0 0 -1 55.3479 -73.3619)'>
<use x='51.9331' xlink:href='#g1-97' y='41.1301'/>
</g>
<path d='M123.933 -113.129C124.715 -111.652 126.48 -110.699 128.969 -110.754L174.84 -111.808C177.332 -111.863 179.098 -110.91 179.879 -109.433C180.59 -110.941 182.309 -111.98 184.801 -112.035L230.672 -113.09C233.16 -113.144 234.879 -114.183 235.594 -115.695' fill='none' stroke='#8080ff' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<g fill='#8080ff' transform='matrix(1 0 0 -1 125.672 -66.2509)'>
<use x='51.9331' xlink:href='#g1-97' y='41.1301'/>
</g>
<path d='M123.933 -113.129C122.437 -112.383 121.441 -110.641 121.441 -108.148V-76.2382C121.441 -73.746 120.445 -72.0038 118.953 -71.2538C120.445 -70.5077 121.441 -68.7655 121.441 -66.2733V-34.3632C121.441 -31.871 122.437 -30.1288 123.933 -29.3788' fill='none' stroke='#d24d79' stroke-miterlimit='10.0375' stroke-width='0.799999'/>
<g fill='#d24d79' transform='matrix(1 0 0 -1 61.4659 -32.5469)'>
<use x='51.9331' xlink:href='#g1-98' y='41.1301'/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 47 KiB

View File

@ -1,158 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg preserveAspectRatio="xMinYMin meet" width="100%" height="100%" viewBox="29.000 14.775 252.500 182.750" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>Matlab/PLOT2SVG figure: geod-spheroidal-x (2013-08-03T11:37-0400)</desc>
<g id="topgroup">
<rect x="29.000" y="14.775" width="252.500" height="182.750" fill="#ffffff" stroke="none" />
<g id ="ID000000">
<clipPath id="ID000001">
<rect x="39.000" y="24.775" width="232.500" height="162.750"/>
</clipPath>
<g>
<g id="ID000002" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="39.000,137.361 39.071,138.749 39.283,140.135 39.637,141.517 40.131,142.895 40.766,144.265 41.540,145.628 42.453,146.980 43.503,148.321 44.690,149.648 46.011,150.960 47.465,152.256 49.050,153.533 50.765,154.791 52.607,156.027 54.575,157.241 56.664,158.431 58.874,159.595 61.202,160.731 63.644,161.840 66.197,162.918 68.859,163.966 71.627,164.981 74.496,165.962 77.464,166.909 80.526,167.819 83.679,168.692 86.920,169.528 90.244,170.324 93.647,171.080 97.125,171.794 100.674,172.467 104.289,173.097 107.967,173.684 111.702,174.226 115.490,174.723 119.327,175.175 123.207,175.581 127.127,175.940 131.080,176.252 135.063,176.517 139.071,176.734 143.099,176.903 147.141,177.024 151.193,177.097 155.250,177.121 159.307,177.097 163.359,177.024 167.401,176.903 171.429,176.734 175.437,176.517 179.420,176.252 183.373,175.940 187.293,175.581 191.173,175.175 195.010,174.723 198.798,174.226 202.533,173.684 206.211,173.097 209.826,172.467 213.375,171.794 216.853,171.080 220.256,170.324 223.580,169.528 226.821,168.692 229.974,167.819 233.036,166.909 236.004,165.962 238.873,164.981 241.641,163.966 244.303,162.918 246.856,161.840 249.298,160.731 251.626,159.595 253.836,158.431 255.925,157.241 257.893,156.027 259.735,154.791 261.450,153.533 263.035,152.256 264.489,150.960 265.810,149.648 266.997,148.321 268.047,146.980 268.960,145.628 269.734,144.265 270.369,142.895 270.863,141.517 271.217,140.135 271.429,138.749 271.500,137.361 "/>
<g>
</g>
</g>
<g id="ID000003" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="39.000,137.361 39.065,133.653 39.259,129.949 39.582,126.251 40.035,122.563 40.617,118.889 41.328,115.231 42.168,111.594 43.136,107.981 44.232,104.395 45.456,100.840 46.808,97.320 48.286,93.838 49.890,90.398 51.619,87.004 53.473,83.659 55.451,80.369 57.550,77.136 59.771,73.964 62.111,70.858 64.570,67.823 67.145,64.861 69.834,61.977 72.635,59.176 75.546,56.462 78.564,53.838 81.686,51.310 84.909,48.881 88.231,46.555 91.646,44.337 95.152,42.231 98.745,40.240 102.419,38.367 106.171,36.618 109.995,34.995 113.887,33.501 117.841,32.140 121.851,30.913 125.912,29.825 130.019,28.877 134.164,28.072 138.342,27.410 142.546,26.894 146.769,26.524 151.006,26.302 155.250,26.228 159.494,26.302 163.731,26.524 167.954,26.894 172.158,27.410 176.336,28.072 180.481,28.877 184.588,29.825 188.649,30.913 192.659,32.140 196.613,33.501 200.505,34.995 204.329,36.618 208.081,38.367 211.755,40.240 215.348,42.231 218.854,44.337 222.269,46.555 225.591,48.881 228.814,51.310 231.936,53.838 234.954,56.462 237.865,59.176 240.666,61.977 243.355,64.861 245.930,67.823 248.389,70.858 250.729,73.964 252.950,77.136 255.049,80.369 257.027,83.659 258.881,87.004 260.610,90.398 262.214,93.838 263.692,97.320 265.044,100.840 266.268,104.395 267.364,107.981 268.332,111.594 269.172,115.231 269.883,118.889 270.465,122.563 270.918,126.251 271.241,129.949 271.435,133.653 271.500,137.361 271.435,141.069 271.241,144.774 270.918,148.472 270.465,152.160 269.883,155.834 269.172,159.491 268.332,163.128 267.364,166.742 266.268,170.327 265.044,173.882 263.692,177.403 262.214,180.885 260.610,184.325 258.881,187.719 257.027,191.063 255.049,194.354 252.950,197.587 250.729,200.758 248.389,203.864 245.930,206.900 243.355,209.862 240.666,212.745 237.865,215.546 234.954,218.261 231.936,220.884 228.814,223.412 225.591,225.841 222.269,228.167 218.854,230.385 215.348,232.492 211.755,234.483 208.081,236.355 204.329,238.104 200.505,239.728 196.613,241.222 192.659,242.583 188.649,243.809 184.588,244.897 180.481,245.845 176.336,246.651 172.158,247.313 167.954,247.829 163.731,248.198 159.494,248.420 155.250,248.494 151.006,248.420 146.769,248.198 142.546,247.829 138.342,247.313 134.164,246.651 130.019,245.845 125.912,244.897 121.851,243.809 117.841,242.583 113.887,241.222 109.995,239.728 106.171,238.104 102.419,236.355 98.745,234.483 95.152,232.492 91.646,230.385 88.231,228.167 84.909,225.841 81.686,223.412 78.564,220.884 75.546,218.261 72.635,215.546 69.834,212.745 67.145,209.862 64.570,206.900 62.111,203.864 59.771,200.758 57.550,197.587 55.451,194.354 53.473,191.063 51.619,187.719 49.890,184.325 48.286,180.885 46.808,177.403 45.456,173.882 44.232,170.327 43.136,166.742 42.168,163.128 41.328,159.491 40.617,155.834 40.035,152.160 39.582,148.472 39.259,144.774 39.065,141.069 39.000,137.361 "/>
<g>
</g>
</g>
<g id="ID000004" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#b31b1b" stroke-width="1.0pt" stroke-dasharray="none" points="134.390,135.364 137.706,133.386 141.044,131.417 144.401,129.458 147.772,127.511 151.155,125.580 154.545,123.667 157.938,121.773 161.330,119.901 164.719,118.054 168.099,116.233 171.467,114.441 174.820,112.681 178.153,110.953 181.462,109.261 184.745,107.606 187.997,105.990 191.214,104.415 194.393,102.884 197.530,101.397 200.622,99.957 "/>
<g>
</g>
</g>
<g id="ID000005" >
<polygon fill="#b31b1b" fill-opacity="1.00" stroke="#b31b1b" stroke-width="0.5pt" stroke-opacity="1.00" stroke-dasharray="none" points="181.462,109.261 170.072,110.688 174.163,112.993 174.163,112.993 174.163,112.993 174.163,112.993 174.163,112.993 174.163,112.993 174.163,112.993 172.386,118.298 181.462,109.261 "/>
</g>
<g id="ID000006" >
<g transform="translate(164.719,129.854)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" ><tspan></tspan><tspan font-style="italic">s</tspan><tspan font-style="normal" font-weight="normal"></tspan><tspan dy="4.0pt" font-size="7pt">12</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000007" >
<g transform="translate(137.878,118.914)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" ><tspan>&#945;</tspan><tspan></tspan><tspan dy="4.0pt" font-size="7pt">1</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000008" >
<g transform="translate(198.297,88.157)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" ><tspan>&#945;</tspan><tspan></tspan><tspan dy="4.0pt" font-size="7pt">2</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000009" >
<g transform="translate(135.553,146.001)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" >A</text>
</g>
</g>
</g>
<g id="ID000010" >
<g transform="translate(205.272,109.432)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" >B</text>
</g>
</g>
</g>
<g id="ID000011" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#000000" stroke-width="0.5pt" stroke-dasharray="none" points="56.285,193.095 56.649,192.444 57.122,191.727 57.702,190.946 58.390,190.102 59.184,189.197 60.084,188.230 61.088,187.204 62.196,186.120 63.407,184.979 64.720,183.783 66.132,182.533 67.643,181.231 69.251,179.878 70.955,178.476 72.752,177.027 74.640,175.533 76.619,173.995 78.684,172.416 80.836,170.797 83.070,169.140 85.385,167.448 87.778,165.722 90.247,163.965 92.789,162.179 95.401,160.365 98.081,158.527 100.825,156.666 103.631,154.785 106.496,152.885 109.417,150.970 112.389,149.042 115.411,147.102 118.479,145.154 121.590,143.199 124.740,141.241 127.925,139.280 131.143,137.320 134.390,135.364 "/>
<polyline fill="none" stroke="#000000" stroke-width="0.5pt" stroke-dasharray="none" points="200.622,99.957 203.626,98.584 206.578,97.259 209.477,95.984 212.317,94.762 215.097,93.592 217.814,92.476 220.463,91.417 223.043,90.414 225.550,89.469 227.982,88.583 230.336,87.758 232.608,86.993 234.798,86.290 236.901,85.650 238.916,85.072 240.841,84.559 242.672,84.110 244.410,83.726 246.050,83.407 247.591,83.153 249.032,82.965 250.371,82.843 251.607,82.787 252.737,82.797 253.761,82.872 254.677,83.013 255.485,83.219 256.183,83.490 256.770,83.825 257.246,84.225 257.610,84.688 "/>
<g>
</g>
</g>
<g id="ID000012" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#b31b1b" stroke-width="1.0pt" stroke-dasharray="none" points="134.390,135.364 134.684,131.586 135.002,127.816 135.344,124.057 135.708,120.313 136.096,116.589 136.505,112.889 136.937,109.217 137.390,105.579 137.863,101.977 138.357,98.416 138.870,94.901 139.402,91.434 139.953,88.022 140.522,84.666 141.107,81.372 141.710,78.143 142.327,74.983 142.960,71.895 143.607,68.883 144.268,65.951 144.941,63.102 145.627,60.339 146.323,57.666 147.030,55.085 147.747,52.600 148.472,50.213 149.205,47.928 149.945,45.747 150.692,43.672 151.443,41.706 152.199,39.851 152.959,38.109 153.721,36.483 154.485,34.974 155.250,33.584 "/>
<g>
</g>
</g>
<g id="ID000013" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#b31b1b" stroke-width="1.0pt" stroke-dasharray="none" points="200.622,99.957 199.350,96.420 198.025,92.931 196.648,89.496 195.222,86.119 193.748,82.803 192.228,79.552 190.663,76.371 189.055,73.263 187.407,70.232 185.721,67.281 183.998,64.415 182.240,61.636 180.450,58.949 178.630,56.355 176.781,53.859 174.907,51.462 173.009,49.169 171.090,46.982 169.152,44.904 167.197,42.936 165.228,41.082 163.247,39.343 161.256,37.722 159.258,36.221 157.255,34.841 155.250,33.584 "/>
<g>
</g>
</g>
<g id="ID000014" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="100.424,228.069 98.852,225.942 97.348,223.707 95.915,221.368 94.555,218.925 93.268,216.384 92.057,213.746 90.923,211.015 89.867,208.194 88.891,205.287 87.996,202.297 87.182,199.228 86.452,196.084 85.805,192.868 85.243,189.584 84.767,186.237 84.376,182.831 84.071,179.368 83.854,175.855 83.723,172.295 83.679,168.692 83.723,165.052 83.854,161.377 84.071,157.673 84.376,153.945 84.767,150.196 85.243,146.431 85.805,142.656 86.452,138.874 87.182,135.090 87.996,131.309 88.891,127.535 89.867,123.774 90.923,120.029 92.057,116.305 93.268,112.606 94.555,108.938 95.915,105.304 97.348,101.710 98.852,98.159 100.424,94.656 102.063,91.204 103.766,87.809 105.533,84.475 107.360,81.204 109.245,78.003 111.187,74.873 113.182,71.820 115.228,68.846 117.323,65.956 119.465,63.153 121.650,60.440 123.875,57.822 126.140,55.300 128.439,52.877 130.771,50.558 133.133,48.345 135.522,46.240 137.935,44.246 140.370,42.366 142.822,40.601 145.289,38.954 147.769,37.427 150.257,36.022 152.752,34.741 155.250,33.584 157.748,32.554 160.243,31.651 162.731,30.877 165.211,30.233 167.678,29.720 170.130,29.338 172.565,29.087 174.978,28.968 177.367,28.981 179.729,29.127 182.061,29.404 184.360,29.812 186.625,30.352 "/>
<g>
</g>
</g>
<g id="ID000015" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="138.059,233.953 137.569,232.007 137.100,229.946 136.653,227.775 136.229,225.494 135.827,223.108 135.449,220.618 135.094,218.028 134.764,215.340 134.459,212.559 134.178,209.687 133.923,206.729 133.694,203.686 133.490,200.564 133.313,197.366 133.162,194.095 133.038,190.757 132.940,187.353 132.870,183.890 132.826,180.371 132.809,176.800 132.820,173.181 132.857,169.519 132.921,165.819 133.012,162.084 133.130,158.320 133.275,154.530 133.446,150.720 133.643,146.893 133.866,143.055 134.116,139.211 134.390,135.364 "/>
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="155.250,33.584 156.033,32.286 156.815,31.115 157.596,30.075 158.373,29.164 159.147,28.386 159.916,27.741 160.679,27.229 161.436,26.851 162.185,26.608 162.925,26.500 "/>
<g>
</g>
</g>
<g id="ID000016" >
<g transform="translate(134.370,163.028)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" ><tspan>&#966;</tspan><tspan></tspan><tspan dy="4.0pt" font-size="7pt">1</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000017" clip-path="url(#ID000001)" >
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="199.589,230.482 200.835,228.467 202.028,226.346 203.166,224.120 204.248,221.793 205.273,219.368 206.240,216.846 207.146,214.231 207.992,211.527 208.777,208.736 209.498,205.861 210.157,202.906 210.751,199.875 211.280,196.770 211.744,193.596 212.141,190.356 212.472,187.054 212.736,183.694 212.933,180.280 213.063,176.816 213.125,173.305 213.119,169.753 213.045,166.162 212.904,162.538 212.695,158.885 212.420,155.206 212.077,151.507 211.668,147.791 211.193,144.062 210.652,140.326 210.047,136.586 209.378,132.848 208.645,129.114 207.850,125.391 206.993,121.681 206.076,117.989 205.099,114.321 204.065,110.679 202.973,107.068 201.825,103.493 200.622,99.957 "/>
<polyline fill="none" stroke="#000000" stroke-width="0.3pt" stroke-dasharray="none" points="155.250,33.584 153.230,32.444 151.212,31.431 149.200,30.548 147.195,29.795 145.199,29.173 143.216,28.683 141.247,28.325 139.296,28.100 137.364,28.008 135.454,28.049 133.568,28.224 131.708,28.531 "/>
<g>
</g>
</g>
<g id="ID000018" >
<g transform="translate(212.239,142.639)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" ><tspan>&#966;</tspan><tspan></tspan><tspan dy="4.0pt" font-size="7pt">2</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000019" >
<g transform="translate(166.294,39.828)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" >N</text>
</g>
</g>
</g>
<g id="ID000020" >
<g transform="translate(161.644,48.871)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="middle" font-size="10pt" fill="#000000" ><tspan>&#955;</tspan><tspan></tspan><tspan dy="4.0pt" font-size="7pt">12</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000021" >
<g transform="translate(86.004,151.080)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" ><tspan>&#945;</tspan><tspan></tspan><tspan dy="4.0pt" font-size="7pt">0</tspan><tspan dy="-4.0pt" font-size="10pt"></tspan></text>
</g>
</g>
</g>
<g id="ID000022" >
<g transform="translate(84.842,181.655)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" >E</text>
</g>
</g>
</g>
<g id="ID000023" >
<g transform="translate(133.972,189.336)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" >F</text>
</g>
</g>
</g>
<g id="ID000024" >
<g transform="translate(214.293,184.805)">
<g transform="rotate(-0.0)">
<text x="0.000" y="0.000" font-family="Helvetica" text-anchor="start" font-size="10pt" fill="#000000" >H</text>
</g>
</g>
</g>
<g id="ID000025" >
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 135 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 40 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 114 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.3 MiB

View File

@ -1,5 +0,0 @@
course_content/simple.svg
.ipynb_checkpoints
.project
.pydevproject

View File

@ -1,37 +0,0 @@
# The language in this case has no bearing - we are going to be making use of conda for a
# python distribution for the scientific python stack.
language: python
sudo: false
env:
global:
- CONDA_INSTALL_LOCN="${HOME}/conda"
# Generated with `$ travis encrypt GH_TOKEN=<auth_token>` for SciTools/courses.
- secure: "IGrdEKM5CH5OCus7pCCrzSWV9WOEuY9QKvWFbNBkBLa3MNszvZop3oioB3QVvygHvMV2HvcOBEx4KaQvUt6UanNb8j+C1zrPGWBuDeuWVDC3pCfqCsXRGXJU1TJp0alRByxaSoenvSjEBJi/GpF9zsAosS/wJIX1rBCbLsjKrhU="
matrix:
- PYTHON=3.4
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ${HOME}/miniconda.sh
- bash ${HOME}/miniconda.sh -b -p ${CONDA_INSTALL_LOCN} && export PATH=${CONDA_INSTALL_LOCN}/bin:$PATH
- git config --global user.name "Travis user"
- git config --global user.email travis-tests@example.com
# Now do the things we need to do to install it.
- conda install notebook nbconvert python=${PYTHON} --yes --quiet
- rm -rf build
- git clone https://dkillick:${GH_TOKEN}@github.com/SciTools/courses.git --branch build build
script:
- ./make.sh
- cd build
- git add -A --ignore-removal .
- git status
# This will only fail if there's nothing to commit, so we can safely skip over this failure.
- git commit -am "Build of ${TRAVIS_COMMIT}" || true
- if [ ! -z "$GH_TOKEN" ]; then
git push origin build > /dev/null;
fi

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see {http://www.gnu.org/licenses/}.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
courses Copyright (C) 2013 SciTools
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
{http://www.gnu.org/licenses/}.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
{http://www.gnu.org/philosophy/why-not-lgpl.html}.

View File

@ -1,23 +0,0 @@
Python courses for the scientific researcher
============================================
This repository contains several courses for the benefit of scientific researchers,
particularly in the fields of oceanography and meteorology.
There are currently four courses:
### An introduction to numpy
3.5 hours &mdash; depends on a basic Python background
http://nbviewer.ipython.org/github/SciTools/courses/blob/master/course_content/notebooks/numpy_intro.ipynb?create=1
### An introduction to matplotlib
3 hours &mdash; depends on "An introduction to numpy"
http://nbviewer.ipython.org/github/SciTools/courses/blob/master/course_content/notebooks/matplotlib_intro.ipynb?create=1
### Cartopy in a nutshell (for Iris)
0.5 hours &mdash; depends on "An introduction to matplotlib"
http://nbviewer.ipython.org/github/SciTools/courses/blob/master/course_content/notebooks/cartopy_intro.ipynb?create=1
### An introduction to Iris
6 hours &mdash; depends on "Cartopy in a nutshell"
http://nbviewer.ipython.org/github/SciTools/courses/blob/master/course_content/notebooks/iris_intro.ipynb?create=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -1,258 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Cartopy in a nutshell\n",
"\n",
"Cartopy is a Python package that provides easy creation of maps, using matplotlib, for the analysis and visualisation of geospatial data."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to create a map with cartopy and matplotlib, we typically need to import pyplot from matplotlib and cartopy's crs (coordinate reference system) submodule. These are typically imported as follows:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import cartopy.crs as ccrs"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Cartopy's matplotlib interface is set up via the `projection` keyword when constructing a matplotlib `Axes` / `SubAxes` instance. The resulting axes instance has new methods, such as the **``coastlines()``** method, which are specific to drawing cartographic data:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ax = plt.axes(projection=ccrs.PlateCarree())\n",
"ax.coastlines()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A full list of Cartopy projections is available at http://scitools.org.uk/cartopy/docs/latest/crs/projections.html."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To draw cartographic data, we use the the standard matplotlib plotting routines with an additional **transform** keyword argument. The value of the **transform** argument should be the cartopy coordinate reference system *of the data being plotted*:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ax = plt.axes(projection=ccrs.PlateCarree())\n",
"ax.coastlines()\n",
"ax.set_global()\n",
"plt.plot([-100, 50], [25, 25], linewidth=4, transform=ccrs.Geodetic())\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Notice that unless we specify a map extent (we did so via the **``set_global``** method in this case) the map will zoom into the range of the plotted data."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can add graticule lines and tick labels to the map using the gridlines method (this currently is limited to just a few coordinate reference systems):"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ax = plt.axes(projection=ccrs.Mercator())\n",
"ax.coastlines()\n",
"gl = ax.gridlines(draw_labels=True)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can control the specific tick values by using matplotlib's locator object, and the formatting can be controlled with matplotlib formatters:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.ticker as mticker\n",
"from cartopy.mpl.gridliner import LATITUDE_FORMATTER\n",
"\n",
"ax = plt.axes(projection=ccrs.PlateCarree())\n",
"ax.coastlines()\n",
"gl = ax.gridlines(draw_labels=True)\n",
"\n",
"gl.xlocator = mticker.FixedLocator([-180, -45, 0, 45, 180])\n",
"gl.yformatter = LATITUDE_FORMATTER\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Cartopy cannot currently label all types of projection, though more work is intended on this functionality in the future."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise 1\n",
"\n",
"The following snippet of code produces coordinate arrays and some data in a rotated pole coordinate system. The coordinate system for the `x` and `y` values, which is similar to that found in the some limited area models of Europe, has a projection \"north pole\" at 177.5 longitude and 37.5 latitude."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import cartopy.crs as ccrs\n",
"\n",
"x = np.linspace(310, 390, 25)\n",
"y = np.linspace(-24, 25, 35)\n",
"x2d, y2d = np.meshgrid(x, y)\n",
"\n",
"data = np.cos(np.deg2rad(y2d) * 4) + np.sin(np.deg2rad(x2d) * 4)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Part 1**\n",
"\n",
"Define a cartopy coordinate reference system which represents a rotated pole with a pole latitude of 37.5 and a pole longitude of 177.5."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"** Part 2**\n",
"\n",
"Produce a map, with coastlines, using the coordinate reference system created in Part 1."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Part 3**\n",
"\n",
"Produce a map, with coastlines, in a Plate Carree projection with a pcolormesh of the data generated by the code snippet provided at the beginning of the exercise. Remember that the data is supplied in the rotated coordinate system defined in Part 1."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

File diff suppressed because it is too large Load Diff

View File

@ -1,618 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# An introduction to matplotlib\n",
"\n",
"Matplotlib is a Python package used widely throughout the scientific Python community to produce high quality 2D publication graphics. It transparently supports a wide range of output formats including PNG (and other raster formats), PostScript/EPS, PDF and SVG and has interfaces for all of the major desktop GUI (Graphical User Interface) toolkits.\n",
"\n",
"Matplotlib comes with a convenience sub-package called ``pyplot``. For consistency with the wider maptlotlib community, this should always be imported as ``plt``:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The matplotlib Figure\n",
"\n",
"At the heart of every matplotlib plot is the \"Figure\". The Figure is the top level concept that can be drawn to one of the many output formats, or simply just to screen.\n",
"\n",
"Let's create our first Figure using pyplot, and then show it:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"fig = plt.figure()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On its own, drawing the Figure is uninteresting and will result in an empty piece of paper (that's why we didn't see anything above). \n",
"Other visible elements are added to a Figure to make a plot. All visible items in Matplotlib are instances of the [Artist](http://matplotlib.org/api/artist_api.html#artist-class) class : The Figure and Axes are both types of Artist.\n",
"\n",
"To start with we can draw an [Axes](http://matplotlib.org/api/axes_api.html) artist in the Figure, to represent our data space. The most basic Axes is rectangular and has tick labels and tick marks. Multiple Axes artists can be placed on a Figure.\n",
"\n",
"Let's go ahead and create a Figure with a single Axes, and show it using pyplot:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ax = plt.axes()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Matplotlib's ``pyplot`` module makes the process of creating graphics easier by allowing us to skip some of the tedious object construction. For example, we did not need to manually create the Figure with ``plt.figure`` because it was implicit that we needed a Figure when we created the Axes.\n",
"\n",
"Under the hood matplotlib still had to create a Figure; we just didn't need to capture it into a variable. We can access the created object with the \"state\" functions found in pyplot called **``gcf``** and **``gca``**."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise 1\n",
"\n",
"Go to matplotlib.org and search for what these strangely named functions do.\n",
"\n",
"Hint: you will find multiple results so remember we are looking for the ``pyplot`` versions of these functions."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Working with the Axes\n",
"\n",
"As has already been mentioned, most of your time building a graphic in matplotlib will be spent on the Axes. Whilst the matplotlib documentation for the Axes is very detailed, it is also rather difficult to navigate (though this is an area of ongoing improvement).\n",
"\n",
"As a result, it is often easier to find new plot types by looking at the pyplot module's documentation.\n",
"\n",
"The first and most common Axes method is ``plot``. Go ahead and look at the ``plot`` documentation from the following sources:\n",
"\n",
" * http://matplotlib.org/api/pyplot_summary.html\n",
" * http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot\n",
" * http://matplotlib.org/api/axes_api.html?#matplotlib.axes.Axes.plot\n",
" \n",
"Plot can be used to draw one or more lines in axes data space:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ax = plt.axes()\n",
"line1, = ax.plot([0, 1, 2, 1.5], [3, 1, 2, 4])\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Notice how the Axes view limits (``ax.viewLim``) have been updated to include the whole of the line.\n",
"Should we want to add some spacing around the edges of our Axes we can set a margin using the [``margins``](http://matplotlib.org/api/axes_api.html?highlight=axes#matplotlib.axes.Axes.margins) method. Alternatively, we can manually set the limits with the [``set_xlim``](http://matplotlib.org/api/axes_api.html?#matplotlib.axes.Axes.set_xlim) and [``set_ylim``](http://matplotlib.org/api/axes_api.html?#matplotlib.axes.Axes.set_ylim) methods."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise 2\n",
"\n",
"Modify the previous example to produce three different Figures that control the limits of the Axes."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1\\. Manually set the x and y limits to $[0.5, 2]$ and $[1, 5]$ respectively."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" 2\\. Define a margin such that there is 10% whitespace inside the axes around the drawn line (Hint: numbers to margins are normalised such that 0% is 0.0 and 100% is 1.0)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"3\\. Set a 10% margin on the Axes with the lower y limit set to 0. (Note: order is important here)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"--------------\n",
"\n",
"If we want to create a plot in its simplest form, without any modifications to the Figure or Axes, we can leave out the creation of artist variables. Our simple line example then becomes:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.plot([0, 1, 2, 1.5], [3, 1, 2, 4])\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The simplicity of this example shows how visualisations can be produced quickly and easily with matplotlib, but it is worth remembering that for full control of the Figure and Axes artists we can mix the convenience of ``pyplot`` with the power of matplotlib's object oriented design."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise 3\n",
"\n",
"By calling ``plot`` multiple times, create a single Axes showing the line plots of $y=sin(x)$ and $y=cos(x)$ in the interval $[0, 2\\pi]$ with 200 linearly spaced $x$ samples."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"--------\n",
"\n",
"## Multiple Axes on the same Figure (aka subplot)\n",
"\n",
"Matplotlib makes it relatively easy to add more than one Axes object to a Figure. The ``Figure.add_subplot()`` method, which is wrapped by the ``pyplot.subplot()`` function, adds an Axes in the grid position specified. To compute the position, we tell matplotlib the number of rows and columns (respectively) to divide the figure into, followed by the index of the axes to be created (1 based). \n",
"\n",
"For example, to create an axes grid with two columns, the grid specification would be ``plt.subplot(1, 2, <plot_number>)``. \n",
"The left-hand Axes is plot number 1, created with ``subplot(1, 2, 1)``, and the right-hand one is number 2, ``subplot(1, 2, 2)`` :"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ax_left = plt.subplot(1, 2, 1)\n",
"plt.plot([2,1,3,4])\n",
"plt.title('left = #1')\n",
"\n",
"ax_left = plt.subplot(1, 2, 2)\n",
"plt.plot([4,1,3,2])\n",
"plt.title('right = #2')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Likewise, for plots above + below one another we would use *two* rows and *one* column, as in ``subplot(2, 1, <plot_number>)``."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's expand our grid to two rows and three columns, and place one set of axes on the top right (grid specification ``(2, 3, 3)``) and another on the bottom left (grid specification ``(2, 3, 4)``)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"top_right_ax = plt.subplot(2, 3, 3, title='#3 = top-right')\n",
"bottom_left_ax = plt.subplot(2, 3, 4, title='#4 = bottom-left')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"--------\n",
"\n",
"**Exercise 3 continued:** Copy the answer from the previous task (plotting $y=sin(x)$ and $y=cos(x)$) and add the appropriate ``plt.subplot`` calls to create a Figure with two rows of Axes, one showing $y=sin(x)$ and the other showing $y=cos(x)$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"--------\n",
"\n",
"## Further plot types\n",
"\n",
"Matplotlib comes with a huge variety of different plot types. Here is a quick demonstration of the more common ones."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x = np.linspace(-180, 180, 60)\n",
"y = np.linspace(-90, 90, 30)\n",
"x2d, y2d = np.meshgrid(x, y)\n",
"data = np.cos(3 * np.deg2rad(x2d)) + np.sin(2 * np.deg2rad(y2d))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.contourf(x, y, data)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.imshow(data, extent=[-180, 180, -90, 90],\n",
" interpolation='nearest', origin='lower')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.pcolormesh(x, y, data)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.scatter(x2d, y2d, c=data, s=15)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.bar(x, data.sum(axis=0), width=np.diff(x)[0])\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.plot(x, data.sum(axis=0), linestyle='--',\n",
" marker='d', markersize=10, color='red')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Titles, legends, colorbars and annotations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Matplotlib has convenience functions for the addition of plot elements such as titles, legends, colorbars and text based annotation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The ``suptitle`` pyplot function allows us to set the title of a Figure, and the ``set_title`` method on an Axes allows us to set the title of an individual Axes. Additionally, an Axes has methods named ``set_xlabel`` and ``set_ylabel`` to label the respective x and y axes. Finally, we can add text, located by data coordinates, with the Axes ``text`` method:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"fig = plt.figure()\n",
"ax = plt.axes()\n",
"# Adjust the created axes so its topmost extent is 0.8 of the figure.\n",
"fig.subplots_adjust(top=0.8)\n",
"\n",
"fig.suptitle('Figure title', fontsize=18, fontweight='bold')\n",
"ax.set_title('Axes title', fontsize=16)\n",
"\n",
"ax.set_xlabel('The X axis')\n",
"ax.set_ylabel('The Y axis $y=f(x)$', fontsize=16)\n",
"\n",
"ax.text(0.5, 0.5, 'Text centered at (0.5, 0.5)\\nin data coordinates.',\n",
" horizontalalignment='center', fontsize=14)\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The creation of a legend is as simple as adding a \"label\" to lines of interest. This can be done in the call to ``plt.plot`` and then followed up with a call to ``plt.legend``:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x = np.linspace(-3, 7, 200)\n",
"plt.plot(x, 0.5*x**3 - 3*x**2, linewidth=2,\n",
" label='$f(x)=0.5x^3-3x^2$')\n",
"plt.plot(x, 1.5*x**2 - 6*x, linewidth=2, linestyle='--',\n",
" label='Gradient of $f(x)$', )\n",
"plt.legend(loc='lower right')\n",
"plt.grid()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Colorbars are created with the ``plt.colorbar`` function:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x = np.linspace(-180, 180, 60)\n",
"y = np.linspace(-90, 90, 30)\n",
"x2d, y2d = np.meshgrid(x, y)\n",
"data = np.cos(3 * np.deg2rad(x2d)) + np.sin(2 * np.deg2rad(y2d))\n",
"\n",
"plt.contourf(x, y, data)\n",
"plt.colorbar(orientation='horizontal')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Matplotlib comes with powerful annotation capabilities, which are described in detail at http://matplotlib.org/users/annotations_intro.html.\n",
"\n",
"The annotation's power can mean that the syntax is a little harder to read, which is demonstrated by one of the simplest examples of using annotate:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x = np.linspace(-3, 7, 200)\n",
"plt.plot(x, 0.5*x**3 - 3*x**2, linewidth=2)\n",
"plt.annotate('Local minimum',\n",
" xy=(4, -18),\n",
" xytext=(-2, -40), fontsize=15,\n",
" arrowprops={'facecolor': 'black', 'frac': 0.3})\n",
"plt.grid()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Savefig & backends\n",
"\n",
"Matplotlib allows you to specify a \"backend\" to drive rendering the Figure. The backend includes the graphical user interface (GUI) library to use, and the most used backend (as it is normally the default one) is the \"TkAgg\" backend. When ``plt.show()`` is called, this backend pops up a Figure in a new TkInter window, which is rendered by the anti-grain graphics library (also known as \"agg\"). Generally, the most common reason to want to change backends is for automated Figure production on a headless server. In this situation, the \"agg\" backend can be used:\n",
"\n",
" import matplotlib\n",
" matplotlib.use('agg')\n",
" import matplotlib.pyplot as plt\n",
" \n",
"Note: The backend must be chosen before importing pyplot for the first time, unless the ``force`` keyword is added.\n",
"\n",
"Non-interactive backends such as the \"agg\" backend will do nothing when **``plt.show()``** is called - this is because there is nowhere (no graphical display) specified for a Figure to be displayed.\n",
"\n",
"To save a Figure programmatically the ``savefig`` function can be used from _any_ backend:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.plot(range(10))\n",
"plt.savefig('simple.svg')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For graphical backends, showing and subsequently closing the window of a Figure results in the Figure being cleared from the matplotlib system. This is not the case for ``plt.savefig``, which typically should be called before ``plt.show``.\n",
"\n",
"It is also possible to manually close Figures without showing them by using the ``plt.close`` function. This could be called to remove the current Figure after saving it with ``plt.savefig`` on the occasion where not clearing the Figure might interfere with subsequent plots to be created."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,42 +0,0 @@
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 1:\n",
"\n",
"1\\. Using the file in ``iris.sample_data_path('atlantic_profiles.nc')`` load the data and print the cube list. Store these cubes in a variable called cubes.\n",
"\n",
"2\\. Print a sorted list of unique names for the cubes.\n",
"\n",
"3\\. Extract the \"sea_water_potential_temperature\" cube. Print the minimum, maximum, mean and standard deviation of the cube's data.\n",
"\n",
"4\\. Print the attributes of the cube.\n",
"\n",
"5\\. Print the names of all coordinates on the cube. (Hint: Remember the cube.coords method)\n",
"\n",
"6\\. Get hold of the \"latitude\" coordinate on the cube. Identify whether the cube has bounds. Print the minimum and maximum latitude points in this cube."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
}
],
"metadata": {}
}
]
}

View File

@ -1,80 +0,0 @@
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Exercise 2:**\n",
"Print the result of ``iris.sample_data_path('uk_hires.pp')`` to verify that it returns a string pointing to a file on your system. Use this string directly in the call to ``iris.load`` and confirm the result is the same as in the previous example e.g.:\n",
"\n",
" print iris.load('/path/to/iris/sampledata/uk_hires.pp', 'air_potential_temperature')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Exercise 2 continued:** Read in the files found at ``iris.sample_data_path('GloSea4', 'ensemble_010.pp')`` and ``iris.sample_data_path('GloSea4', 'ensemble_011.pp')`` using a single load call. Do this by:\n",
"\n",
"1\\. Providing a list of the two filenames."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import iris\n",
"print iris.load([iris.sample_data_path('GloSea4', 'ensemble_010.pp'),\n",
" iris.sample_data_path('GloSea4', 'ensemble_011.pp')])"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"0: surface_temperature / (K) (realization: 2; time: 6; latitude: 145; longitude: 192)\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2\\. Providing a suitable glob pattern."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print iris.load(iris.sample_data_path('GloSea4', 'ensemble_01[12].pp'))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"0: surface_temperature / (K) (time: 6; forecast_reference_time: 2; latitude: 145; longitude: 192)\n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}

View File

@ -1,24 +0,0 @@
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Exercise 3:**\n",
"\n",
"1. Write a function, which when given a cube, returns True or False depending on whether a cell method exists.\n",
"2. Use this function as a value for the ``iris.Constraint`` **cube_func** keyword, and load the file in ``iris.sample_data_path('A1B_north_america.nc')`` such that only cubes with cell methods are loaded (note: in this case, that is all that exists in the file)."
]
}
],
"metadata": {}
}
]
}

View File

@ -1,43 +0,0 @@
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 4\n",
"\n",
"The following exercise is designed to give you experience of identifying why two cubes are not merging. Work is underway to make this identification process more automatic, but the resolution of the identified differences will still be a necessary process.\n",
"\n",
"There are 6 problems, each of which are not merging into a single cube as desired. In no particular order the problems are:\n",
"\n",
" 1. one of the cubes has a history attribute, but the other doesn't\n",
" 2. one of the cubes has bounds on the spatial coordinates, but the other doesn't\n",
" 3. the two cubes have different time coordinate units\n",
" 4. the two cubes have different data dtypes\n",
" 5. the two cubes have different long names\n",
" 6. the two cubes have different shapes (the data must currently be loaded to correct this)\n",
" \n",
"The files can be found in the repository along with this course in ```exercises/iris/merge/```. There are two files to be loaded for each exercise: ```merge_exercise.{problem_number}.f1.nc``` and ```merge_exercise.{problem_number}.f2.nc```.\n",
"\n",
"Identify, and correct, the reason that the two cubes are not merging for all 6 sets of files."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Problem 1"
]
}
],
"metadata": {}
}
]
}

View File

@ -1,44 +0,0 @@
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import iris.analysis.cartography\n",
"cube.coord('grid_latitude').guess_bounds()\n",
"cube.coord('grid_longitude').guess_bounds()\n",
"grid_areas = iris.analysis.cartography.area_weights(cube)\n",
"\n",
"area_avg = cube.collapsed(['grid_longitude', 'grid_latitude'], iris.analysis.MEAN, weights=grid_areas)"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Exercise 5:** What other aggregators are available? Calculate the potential temperature variance with time for the area averaged cube (hint: We want to reduce the vertical dimension, and end up with a cube of length 3). Print the data values of the resulting cube."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -1,254 +0,0 @@
{
"metadata": {
"name": "iris_exercise_7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Graduation exercise\n",
"\n",
"1\\. Load 'A1B_north_america.nc' from the iris sample data"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import iris\n",
"filename = iris.sample_data_path(\"A1B_north_america.nc\")\n",
"cube = iris.load_cube(filename)\n",
"print cube"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"air_temperature / (K) (time: 240; latitude: 37; longitude: 49)\n",
" Dimension coordinates:\n",
" time x - -\n",
" latitude - x -\n",
" longitude - - x\n",
" Auxiliary coordinates:\n",
" forecast_period x - -\n",
" Scalar coordinates:\n",
" forecast_reference_time: 1859-09-01 06:00:00\n",
" height: 1.5 m\n",
" Attributes:\n",
" Conventions: CF-1.5\n",
" Model scenario: A1B\n",
" STASH: m01s03i236\n",
" source: Data from Met Office Unified Model 6.05\n",
" Cell methods:\n",
" mean: time (6 hour)\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2\\. Extract just data from the year 1980 and beyond from the loaded cube"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"tcoord = cube.coord('time')\n",
"def since_1980(cell):\n",
" return tcoord.units.num2date(cell.point).year >= 1980\n",
"\n",
"tcon = iris.Constraint(time=since_1980)\n",
"cube = cube.extract(tcon)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"tcoord = cube.coord('time')\n",
"\n",
"print tcoord.units.num2date(tcoord.points.min())\n",
"print tcoord.units.num2date(tcoord.points.max())"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"1980-06-01 00:00:00\n",
"2099-06-01 00:00:00\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"3\\. Define a function which takes a coordinate and a single time point as arguments, and returns the decade. For example, your function should return 2010 for the following:\n",
"\n",
" time = iris.coords.DimCoord([10], 'time', units='days since 2018-01-01')\n",
" print your_decade_function(time, time.points[0])"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def get_decade(coord, point):\n",
" year = coord.units.num2date(point).year\n",
" return (year/10)*10\n",
"time = iris.coords.DimCoord([10], 'time', units='days since 2018-01-01')\n",
"print get_decade(time, time.points[0])"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"2010\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"4\\. Add a \"decade\" coordinate to the loaded cube using your function and the coord categorisation module"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import iris.coord_categorisation as coord_cat\n",
"coord_cat.add_categorised_coord(cube, 'decade', 'time', get_decade)\n",
"print cube.coord('decade')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"AuxCoord(array([1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1990,\n",
" 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 2000, 2000,\n",
" 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2010, 2010, 2010,\n",
" 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2020, 2020, 2020, 2020,\n",
" 2020, 2020, 2020, 2020, 2020, 2020, 2030, 2030, 2030, 2030, 2030,\n",
" 2030, 2030, 2030, 2030, 2030, 2040, 2040, 2040, 2040, 2040, 2040,\n",
" 2040, 2040, 2040, 2040, 2050, 2050, 2050, 2050, 2050, 2050, 2050,\n",
" 2050, 2050, 2050, 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060,\n",
" 2060, 2060, 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,\n",
" 2070, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080,\n",
" 2090, 2090, 2090, 2090, 2090, 2090, 2090, 2090, 2090, 2090]), standard_name=None, units=Unit('1'), long_name=u'decade')\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"5\\. Calculate the decadal means cube for this scenario"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import iris.analysis\n",
"cube = cube.aggregated_by('decade', iris.analysis.MEAN)\n",
"print cube"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"air_temperature / (K) (time: 12; latitude: 37; longitude: 49)\n",
" Dimension coordinates:\n",
" time x - -\n",
" latitude - x -\n",
" longitude - - x\n",
" Auxiliary coordinates:\n",
" decade x - -\n",
" forecast_period x - -\n",
" Scalar coordinates:\n",
" forecast_reference_time: 1859-09-01 06:00:00\n",
" height: 1.5 m\n",
" Attributes:\n",
" Conventions: CF-1.5\n",
" Model scenario: A1B\n",
" STASH: m01s03i236\n",
" history: Mean of air_temperature aggregated over decade\n",
" source: Data from Met Office Unified Model 6.05\n",
" Cell methods:\n",
" mean: time (6 hour)\n",
" mean: decade\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"6\\. Create a figure with 3 rows and 4 columns displaying the decadal means, with the decade displayed prominently in each axes' title"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import matplotlib.pyplot as plt\n",
"import iris.plot as iplt\n",
"\n",
"plt.figure(figsize=(12, 6))\n",
"\n",
"plt.suptitle('Decadal means for the A1B scenario')\n",
"for i, decade_cube in enumerate(cube.slices(['latitude', 'longitude'])):\n",
" plt.subplot(3, 4, i+1)\n",
" iplt.contourf(decade_cube, 20)\n",
" plt.title('{}'.format(decade_cube.coord('decade').points[0]))\n",
" plt.gca().coastlines()\n",
"plt.show()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 16
}
],
"metadata": {}
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,111 +0,0 @@
{
"metadata": {
"name": "",
"signature": "sha256:848ef38126532012d51f85fda6138dfe097a4c6c37850c846063ebee9d3928bb"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 1\n",
"\n",
"Use ``np.arange`` and ``reshape`` to create the array\n",
"\n",
" A = [[1 2 3 4]\n",
" [5 6 7 8]]"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy as np\n",
"A = np.arange(1, 9).reshape(2, -1)\n",
"print A"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[[1 2 3 4]\n",
" [5 6 7 8]]\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"Use ``np.array`` to create the array\n",
"\n",
" B = [1 2]"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"B = np.array([1, 2])\n",
"print B"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[1 2]\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use broadcasting to add ``B`` to ``A`` to create the final array\n",
"\n",
" A + B = [[2 3 4 5]\n",
" [7 8 9 10]\n",
"\n",
"Hint: what shape does ``B`` have to be changed to?"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print A + B.reshape(2, 1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[[ 2 3 4 5]\n",
" [ 7 8 9 10]]\n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}

View File

@ -1,305 +0,0 @@
{
"metadata": {
"name": "",
"signature": "sha256:e3e7c1608702d0a84f35e6fa63112daab968fe74a96ae1f6ee9f39993826a343"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# Exercise: trapezoidal integration\n",
"\n",
"In this exercise, you are tasked with implementing the simple trapezoid rule\n",
"formula for numerical integration. If we want to compute the definite integral\n",
"\n",
"$$\n",
" \\int_{a}^{b}f(x)dx\n",
"$$\n",
"\n",
"we can partition the integration interval $[a,b]$ into smaller subintervals. We then approximate the area under the curve for each subinterval by calculating the area of the trapezoid created by linearly interpolating between the two function values at each end of the subinterval:\n",
"\n",
"![Illustration of the trapezoidal rule](../images/trapezoidal_rule.png)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"For a pre-computed $y$ array (where $y = f(x)$ at discrete samples) the trapezoidal rule equation is:\n",
"\n",
"$$\n",
" \\int_{a}^{b}f(x)dx\\approx\\frac{1}{2}\\sum_{i=1}^{n}\\left(x_{i}-x_{i-1}\\right)\\left(y_{i}+y_{i-1}\\right).\n",
"$$\n",
"\n",
"In pure python, this can be written as:\n",
"\n",
" def trapz_slow(x, y):\n",
" area = 0.\n",
" for i in range(1, len(x)):\n",
" area += (x[i] - x[i-1]) * (y[i] + y[i-1])\n",
" return area / 2"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### Exercise 2\n",
"\n",
"#### Part 1\n",
"\n",
"Create two arrays $x$ and $y$, where $x$ is a linearly spaced array in the interval $[0, 3]$ of length 10, and $y$ represents the function $f(x) = x^2$ sampled at $x$."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy as np\n",
"\n",
"x = np.linspace(0, 3, 10)\n",
"y = x ** 2\n",
"\n",
"print x\n",
"print y"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[ 0. 0.33333333 0.66666667 1. 1.33333333 1.66666667\n",
" 2. 2.33333333 2.66666667 3. ]\n",
"[ 0. 0.11111111 0.44444444 1. 1.77777778 2.77777778\n",
" 4. 5.44444444 7.11111111 9. ]\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"#### Part 2\n",
"\n",
"Use indexing (not a for loop) to find the 9 values representing $y_{i}+y_{i-1}$ for $i$ between 1 and 10.\n",
"\n",
"Hint: What indexing would be needed to get all but the last element of the 1d array **``y``**. Similarly what indexing would be needed to get all but the first element of a 1d array."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"y_roll_sum = y[:-1] + y[1:]\n",
"print y_roll_sum"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[ 0.11111111 0.55555556 1.44444444 2.77777778 4.55555556\n",
" 6.77777778 9.44444444 12.55555556 16.11111111]\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"#### Part 3\n",
"\n",
"Write a function `trapz(x, y)`, that applies the trapezoid formula to pre-computed values, where `x` and `y` are 1-d arrays. The function should not use a for loop."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def trapz(x, y):\n",
" return 0.5 * np.sum((x[1:] - x[:-1]) * (y[:-1] + y[1:]))"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"#### Part 4\n",
"\n",
"Verify that your function is correct by using the arrays created in #1 as input to ``trapz``. Your answer should be a close approximation of $\\int_0^3 x^2$ which is $9$."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"trapz(x, y)"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"text": [
"9.0555555555555554"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"#### Part 5 (extension)\n",
"\n",
"``numpy`` and ``scipy.integrate`` provides many common integration schemes. Find the documentation for NumPy's own version of the trapezoidal integration scheme and check its result with your own:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print np.trapz(y, x)"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"9.05555555556\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"#### Part 6 (extension)\n",
"\n",
"Write a function `trapzf(f, a, b, npts=100)` that accepts a function `f`, the endpoints `a` and `b` and the number of samples to take `npts`. Sample the function uniformly at these\n",
"points and return the value of the integral.\n",
"\n",
"Use the trapzf function to identify the minimum number of sampling points needed to approximate the integral $\\int_0^3 x^2$ with an absolute error of $<=0.0001$. (A loop is necessary here)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def trapzf(f, a, b, npts=100):\n",
" x = np.linspace(a, b, npts)\n",
" y = f(x)\n",
" return trapz(x, y)\n",
"\n",
"def x_squared(x):\n",
" return x ** 2\n",
"\n",
"abs_err = 1.0\n",
"n_samples = 0\n",
"expected = 9\n",
"while abs_err > 0.0001:\n",
" n_samples += 1\n",
" integral = trapzf(x_squared, 0, 3, npts=n_samples)\n",
" abs_err = np.abs(integral - 9)\n",
"\n",
"print 'Minimum samples for absolute error less than or equal to 0.0001:', n_samples\n",
" "
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Minimum samples for absolute error less than or equal to 0.0001: 214\n"
]
}
],
"prompt_number": 6
}
],
"metadata": {}
}
]
}

View File

@ -1 +0,0 @@
../resources

View File

@ -1,32 +0,0 @@
#!/usr/bin/env bash
# Fail on first exception.
set -e
# Clean out the build folder then replace the files we need to keep.
rm -rf build/*
cp .gitignore LICENSE README.md build
# Set up the folders we will need.
mkdir -p build/html
mkdir -p build/notebooks
mkdir -p build/solutions
cd build
cp -rf ../course_content/images images
cp -rf ../course_content/resources resources
for name in "numpy_intro" "matplotlib_intro" "cartopy_intro" "iris_intro"
do
#ipython nbconvert --to slides ../../course_content/${name}.ipynb
# Build static (html) copies of the course content.
jupyter nbconvert --to html ../course_content/notebooks/${name}.ipynb
mv ../course_content/notebooks/*.html ./html/
done
#.reveal aside.notes {
# visibility: inline;
#}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Some files were not shown because too many files have changed in this diff Show More