SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
The Centre for Australian Weather and Climate Research
A partnership between CSIRO and the Bureau of Meteorology
Dynamic visualisation
in the IPython Notebook
Brianna Laugher
Hobart, Tasmania
July 2013, PyCon AU
www.cawcr.gov.au
The Centre for Australian
Slides & code
github.com/pfctdayelise/dapbook
The Centre for Australian
What we have...
The Centre for Australian
What we have...
The Centre for Australian
The problem
Can't zoom
Can't pan
Can't layer
IPython Notebook makes it easy to explore datasets and plot them with matplotlib...
...but for gridded datasets, it really would be nice to have them on a map!
The Centre for Australian
...what we want
The Centre for Australian
What is this data?
NetCDF file – common format for gridded data (could easily have been HDF5)
Commonly used by earth science communities
Sample TAS MinT grid from the Australian Digital Forecast Database produced by
BoM, see http://www.bom.gov.au/catalogue/data-feeds.shtml for details and to
download sample grids
ADFD grids feed into MetEye - http://www.bom.gov.au/australia/meteye/
The Centre for Australian
MetEye
The Centre for Australian
OpenLayers
PyDAP +
WMS response
How to get there?
NetCDF
The Centre for Australian
IPython notebook
“a web-based interactive computational environment where you can
combine code execution, text, mathematics, plots and rich media into a
single document”
•
Inspired by Mathematica, SAGE notebooks
•
Built-in support for numpy, matplotlib
•
Half-interpreter, half-script
•
Great way to “show your work”
•
Useful for tuning fiddly APIs (ahem matplotlib)
•
Perfect for tutorials!
Run a local server, and/or
Publish your notebook as .ipynb and use http://nbviewer.ipython.org/
The Centre for Australian
IPython notebook
pip install ipython
pip install tornado pyzmq # needed for notebook, not ipython shell
ipython notebook --pylab inline
The Centre for Australian
IPython notebook
Rich display – essentially more types of __repr__
HTML
JSON
PNG, JPEG, SVG
LaTeX
Expect this API to change (improve) in future versions, esp. for JavaScript
Make a class “Notebook compatible” by adding html, png etc properties:
from IPython.display import Image
class Foo(object):
….
@property
def png(self):
Return Image(...)
The Centre for Australian
OpenLayers
PyDAP +
WMS response
How to get there?
NetCDF
The Centre for Australian
JavaScript mapping libraries
Leaflet and OpenLayers:
Specify layers as “tile layers” or “WMS tile layers” (different APIs)
Can set projection as required
Can reproject points and vectors (but not map tiles) on-the-fly
The Centre for Australian
WMS
The Centre for Australian
Web Map Service
Supports 2+ request types – GetMap, GetCapabilities
http://test.pydap.org/coads.nc.wms?SST[0]&LAYERS=SST&TRANSPARENT=true&FORMAT=image
%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG
%3A900913&BBOX=-180,-90,1252164.27125,1252254.27125&WIDTH=256&HEIGHT=256
REQUEST=GetMap
SERVICE=WMS
VERSION=1.1.1
LAYERS=MinT_SFC
SRS=EPSG:900913
BBOX=-180,-10018844.17,10018574.17,-90
FORMAT=image/png
TRANSPARENT=true
HEIGHT=256
WIDTH=256
The Centre for Australian
OpenLayers
PyDAP +
WMS response
How to get there?
NetCDF
The Centre for Australian
PyDAP
2 parts: OPeNDAP server, OPeNDAP client
Client
• “Lazy loading” of data from any OPeNDAP server into numpy (incl.
slices, subsets)
• Don't have to care about file format of original data
Server
• WSGI app
• Handlers (input): NetCDF, HDF5, SQL, CSV, remote!, ...
• Responses (output): DAS/DDS/DODS, HTML, ASCII,
WMS, KML, XLS, ...
The Centre for Australian
PyDAP
The Centre for Australian
PyDAP
pip install pydap pydap.handlers.netcdf pydap.responses.wms
paster create -t pydap myserver
cp mydata.nc myserver/data/
# starts a server like http://test.pydap.org/
# run server with 4 workers, better for serving up map tiles
gunicorn_paster -w 4 -b 127.0.0.1:8001 myserver/server.ini
The Centre for Australian
PyDAP
The Centre for Australian
PyDAP
The Centre for Australian
PyDAP
The Centre for Australian
Projections 101
Mapping libraries can reproject points and vectors, but not map tiles...
Base layers and overlays need to be requested in the same projection!
The Centre for Australian
Projections 101
CRS EPSG:4326 EPSG:3857
(aka EPSG:900913)
Example of Geographic coordinate
system (represents a
globe/part of a globe)
Projected coordinate system,
“Spherical Mercator”
(represents a map)
Used by “GIS enthusiasts”,
Metacarta
“almost all free and commercial
tile providers” (Google, OSM,
Yahoo, Bing)
Coords as Lat-lons in decimal
degrees
“Metres”
PyDAP WMS can
serve map tiles in
√
OpenLayers supports
by default
√ √
Leaflet supports by
default
√
But... issue #1207
“EPSG 4326 Support Broken for
TileLayers” and... CloudMade
doesn't provide WMS.
√
The Centre for Australian
Option 1: Render overlays in EPSG:3857
Base layer
Overlays
PyDAP
WMS
4326
OSM
Google
Yahoo
Bing
3857
Cascading
WMS
3857
The Centre for Australian
Option 2: Pick base layer in EPSG:4326
Base layer
Overlays
MetaCarta
PyDAP
WMS
4326
4326
Cascading
WMS
4326
OSM
Google
Yahoo
Bing
3857
The Centre for Australian
Cascading WMS
• MapServer
• C
• MIT license
• GeoServer + GeoWebCache
• Java
• GPL, LGPL licenses
• http://maps.opengeo.org/geowebcache/demo
• Includes OpenStreetMap, NASA “Blue Marble”
The Centre for Australian
Putting it all together
The Centre for Australian
The Centre for Australian
template.html
The Centre for Australian
Back to the notebook
The Centre for Australian
Other options – GeoDjango?
First impression -
seems to be a lot more about vector layers than gridded data
No particular mention of netcdf, gridded data, WMS
The Centre for Australian
The future – HTML5 backend for matplotlib?
The Centre for Australian
Credits
With thanks to:
Nathan Faggian, for the original leavis, and willingness to share his ideas
Leafvis – a WMS-ish app, DIY map tile rendering.
https://github.com/nfaggian/leafvis
And also:
Roberto De Almeida
James Sofra
Danielle Madeley
Roald de Wit
Credits
Map tiles photo: “Carcassonne” by Tom & Katrien, licensed CC-BY-SA.
http://www.flickr.com/photos/inferis/283379928/
PyDAP slide: by PyCon 2007 talk by Roberto De Almeida.
http://www.scribd.com/doc/2864/PyCon-2007
The Centre for Australian Weather and Climate Research
A partnership between CSIRO and the Bureau of Meteorology
Brianna Laugher
Email: b.laugher@bom.gov.au
Web: www.cawcr.gov.au
Slides & code:
https://github.com/pfctdayelise/dapbook
Thank you
www.cawcr.gov.au

Mais conteúdo relacionado

Mais procurados

Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
IndicThreads
 
Automated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with DaskAutomated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with Dask
ASI Data Science
 
Data Structures for Statistical Computing in Python
Data Structures for Statistical Computing in PythonData Structures for Statistical Computing in Python
Data Structures for Statistical Computing in Python
Wes McKinney
 
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
Accumulo Summit
 

Mais procurados (20)

GeoMesa: Scalable Geospatial Analytics
GeoMesa:  Scalable Geospatial AnalyticsGeoMesa:  Scalable Geospatial Analytics
GeoMesa: Scalable Geospatial Analytics
 
MindRaider
MindRaiderMindRaider
MindRaider
 
MapReduce Algorithm Design
MapReduce Algorithm DesignMapReduce Algorithm Design
MapReduce Algorithm Design
 
The Matsu Project - Open Source Software for Processing Satellite Imagery Data
The Matsu Project - Open Source Software for Processing Satellite Imagery DataThe Matsu Project - Open Source Software for Processing Satellite Imagery Data
The Matsu Project - Open Source Software for Processing Satellite Imagery Data
 
Summary of HDF-EOS5 Files, Data Model and File Format
Summary of HDF-EOS5 Files, Data Model and File FormatSummary of HDF-EOS5 Files, Data Model and File Format
Summary of HDF-EOS5 Files, Data Model and File Format
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
 
Machine learning at scale with Google Cloud Platform
Machine learning at scale with Google Cloud PlatformMachine learning at scale with Google Cloud Platform
Machine learning at scale with Google Cloud Platform
 
Processing Geospatial at Scale at LocationTech
Processing Geospatial at Scale at LocationTechProcessing Geospatial at Scale at LocationTech
Processing Geospatial at Scale at LocationTech
 
OpenTopography - Scalable Services for Geosciences Data
OpenTopography - Scalable Services for Geosciences DataOpenTopography - Scalable Services for Geosciences Data
OpenTopography - Scalable Services for Geosciences Data
 
GeoMesa LocationTech DC
GeoMesa LocationTech DCGeoMesa LocationTech DC
GeoMesa LocationTech DC
 
Working with Scientific Data in MATLAB
Working with Scientific Data in MATLABWorking with Scientific Data in MATLAB
Working with Scientific Data in MATLAB
 
Modeling with Hadoop kdd2011
Modeling with Hadoop kdd2011Modeling with Hadoop kdd2011
Modeling with Hadoop kdd2011
 
APAN Cloud WG (2015/3/2)
APAN Cloud WG (2015/3/2)APAN Cloud WG (2015/3/2)
APAN Cloud WG (2015/3/2)
 
Automated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with DaskAutomated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with Dask
 
GeoSpatially enabling your Spark and Accumulo clusters with LocationTech
GeoSpatially enabling your Spark and Accumulo clusters with LocationTechGeoSpatially enabling your Spark and Accumulo clusters with LocationTech
GeoSpatially enabling your Spark and Accumulo clusters with LocationTech
 
London data science
London data scienceLondon data science
London data science
 
Data Structures for Statistical Computing in Python
Data Structures for Statistical Computing in PythonData Structures for Statistical Computing in Python
Data Structures for Statistical Computing in Python
 
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
 
Nexxworks bootcamp ML6 (27/09/2017)
Nexxworks bootcamp ML6 (27/09/2017)Nexxworks bootcamp ML6 (27/09/2017)
Nexxworks bootcamp ML6 (27/09/2017)
 
Query-Driven Visualization in the Cloud with MapReduce
Query-Driven Visualization in the Cloud with MapReduce Query-Driven Visualization in the Cloud with MapReduce
Query-Driven Visualization in the Cloud with MapReduce
 

Destaque

Introduction to Big Data and Data Science
Introduction to Big Data and Data ScienceIntroduction to Big Data and Data Science
Introduction to Big Data and Data Science
Feyzi R. Bagirov
 
The magic of IPython Notebook
The magic of IPython NotebookThe magic of IPython Notebook
The magic of IPython Notebook
Alexey Agapov
 
Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...
Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...
Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...
Chris Fregly
 

Destaque (20)

Introduction to Big Data and Data Science
Introduction to Big Data and Data ScienceIntroduction to Big Data and Data Science
Introduction to Big Data and Data Science
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 Keynote
 
Why Python?
Why Python?Why Python?
Why Python?
 
PyData: Past, Present Future (PyData SV 2014 Keynote)
PyData: Past, Present Future (PyData SV 2014 Keynote)PyData: Past, Present Future (PyData SV 2014 Keynote)
PyData: Past, Present Future (PyData SV 2014 Keynote)
 
The magic of IPython Notebook
The magic of IPython NotebookThe magic of IPython Notebook
The magic of IPython Notebook
 
An Obligatory Introduction to Data Science
An Obligatory Introduction to Data ScienceAn Obligatory Introduction to Data Science
An Obligatory Introduction to Data Science
 
Building Serverless Machine Learning Models in the Cloud [PyData DC]
Building Serverless Machine Learning Models in the Cloud [PyData DC]Building Serverless Machine Learning Models in the Cloud [PyData DC]
Building Serverless Machine Learning Models in the Cloud [PyData DC]
 
A quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchA quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for research
 
Clean Code in Jupyter notebook
Clean Code in Jupyter notebookClean Code in Jupyter notebook
Clean Code in Jupyter notebook
 
Reproducible Workflow with Cytoscape and Jupyter Notebook
Reproducible Workflow with Cytoscape and Jupyter NotebookReproducible Workflow with Cytoscape and Jupyter Notebook
Reproducible Workflow with Cytoscape and Jupyter Notebook
 
Pydata-Python tools for webscraping
Pydata-Python tools for webscrapingPydata-Python tools for webscraping
Pydata-Python tools for webscraping
 
Jupyter, A Platform for Data Science at Scale
Jupyter, A Platform for Data Science at ScaleJupyter, A Platform for Data Science at Scale
Jupyter, A Platform for Data Science at Scale
 
Data Science Introduction
Data Science IntroductionData Science Introduction
Data Science Introduction
 
Apache Toree
Apache ToreeApache Toree
Apache Toree
 
Advanced Spark and TensorFlow Meetup 08-04-2016 One Click Spark ML Pipeline D...
Advanced Spark and TensorFlow Meetup 08-04-2016 One Click Spark ML Pipeline D...Advanced Spark and TensorFlow Meetup 08-04-2016 One Click Spark ML Pipeline D...
Advanced Spark and TensorFlow Meetup 08-04-2016 One Click Spark ML Pipeline D...
 
Introduction to Data Science - ESCP Europe
Introduction to Data Science - ESCP Europe Introduction to Data Science - ESCP Europe
Introduction to Data Science - ESCP Europe
 
Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...
Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...
Deploy Spark ML and Tensorflow AI Models from Notebooks to Microservices - No...
 
Anaconda and PyData Solutions
Anaconda and PyData SolutionsAnaconda and PyData Solutions
Anaconda and PyData Solutions
 
Introduction to Data Science and Analytics
Introduction to Data Science and AnalyticsIntroduction to Data Science and Analytics
Introduction to Data Science and Analytics
 
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
 

Semelhante a Dynamic viz in the IPython Notebook

Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterStockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
ACSG Section Montréal
 
DSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado Blasco
DSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado BlascoDSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado Blasco
DSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado Blasco
Deltares
 

Semelhante a Dynamic viz in the IPython Notebook (20)

Raster data in GeoServer and GeoTools: Achievements, issues and future devel...
Raster data in GeoServer and GeoTools:  Achievements, issues and future devel...Raster data in GeoServer and GeoTools:  Achievements, issues and future devel...
Raster data in GeoServer and GeoTools: Achievements, issues and future devel...
 
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS RasterStockage, manipulation et analyse de données matricielles avec PostGIS Raster
Stockage, manipulation et analyse de données matricielles avec PostGIS Raster
 
Ultra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & Alluxio
Ultra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & AlluxioUltra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & Alluxio
Ultra Fast Deep Learning in Hybrid Cloud using Intel Analytics Zoo & Alluxio
 
Open@EDINA
Open@EDINAOpen@EDINA
Open@EDINA
 
DSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado Blasco
DSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado BlascoDSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado Blasco
DSD-INT 2015 - RSS Sentinel Toolbox - J. Manuel Delgado Blasco
 
Adding geospatial features to a java web app
Adding geospatial features to a java web appAdding geospatial features to a java web app
Adding geospatial features to a java web app
 
Linked Data in Learning Analytics Tools
Linked Data in Learning Analytics ToolsLinked Data in Learning Analytics Tools
Linked Data in Learning Analytics Tools
 
New Developments in Spark
New Developments in SparkNew Developments in Spark
New Developments in Spark
 
Very Large Data Files, Object Stores, and Deep Learning—Lessons Learned While...
Very Large Data Files, Object Stores, and Deep Learning—Lessons Learned While...Very Large Data Files, Object Stores, and Deep Learning—Lessons Learned While...
Very Large Data Files, Object Stores, and Deep Learning—Lessons Learned While...
 
Processing Geospatial Data At Scale @locationtech
Processing Geospatial Data At Scale @locationtechProcessing Geospatial Data At Scale @locationtech
Processing Geospatial Data At Scale @locationtech
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
 
Q4 2016 GeoTrellis Presentation
Q4 2016 GeoTrellis PresentationQ4 2016 GeoTrellis Presentation
Q4 2016 GeoTrellis Presentation
 
Ultra Fast Deep Learning in Hybrid Cloud Using Intel Analytics Zoo & Alluxio
Ultra Fast Deep Learning in Hybrid Cloud Using Intel Analytics Zoo & AlluxioUltra Fast Deep Learning in Hybrid Cloud Using Intel Analytics Zoo & Alluxio
Ultra Fast Deep Learning in Hybrid Cloud Using Intel Analytics Zoo & Alluxio
 
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterFOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
 
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
Automated ML Workflow for Distributed Big Data Using Analytics Zoo (CVPR2020 ...
 
Dataiku - hadoop ecosystem - @Epitech Paris - janvier 2014
Dataiku  - hadoop ecosystem - @Epitech Paris - janvier 2014Dataiku  - hadoop ecosystem - @Epitech Paris - janvier 2014
Dataiku - hadoop ecosystem - @Epitech Paris - janvier 2014
 
Geographic information system and remote sensing
Geographic information system and remote sensingGeographic information system and remote sensing
Geographic information system and remote sensing
 
Consuming open and linked data with open source tools
Consuming open and linked data with open source toolsConsuming open and linked data with open source tools
Consuming open and linked data with open source tools
 
10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds10 things I’ve learnt In the clouds
10 things I’ve learnt In the clouds
 

Mais de Brianna Laugher

Mais de Brianna Laugher (20)

So You're A Software Developer, Now What? Exploring Career Growth
So You're A Software Developer, Now What? Exploring Career GrowthSo You're A Software Developer, Now What? Exploring Career Growth
So You're A Software Developer, Now What? Exploring Career Growth
 
CFFSW - Crowdfunded free software
CFFSW - Crowdfunded free softwareCFFSW - Crowdfunded free software
CFFSW - Crowdfunded free software
 
Funcargs & other fun with pytest
Funcargs & other fun with pytestFuncargs & other fun with pytest
Funcargs & other fun with pytest
 
Zookeepr: Home-grown conference management software
Zookeepr: Home-grown conference management softwareZookeepr: Home-grown conference management software
Zookeepr: Home-grown conference management software
 
BarCamp Geelong - Why gender should be a text field
BarCamp Geelong - Why gender should be a text fieldBarCamp Geelong - Why gender should be a text field
BarCamp Geelong - Why gender should be a text field
 
Distributed wikis
Distributed wikisDistributed wikis
Distributed wikis
 
Neurosexism
NeurosexismNeurosexism
Neurosexism
 
Clash of the encyclopedias - is competition good for sharing?
Clash of the encyclopedias - is competition good for sharing?Clash of the encyclopedias - is competition good for sharing?
Clash of the encyclopedias - is competition good for sharing?
 
Language Sleuthing HOWTO with NLTK
Language Sleuthing HOWTO with NLTKLanguage Sleuthing HOWTO with NLTK
Language Sleuthing HOWTO with NLTK
 
Visualising geo-data
Visualising geo-dataVisualising geo-data
Visualising geo-data
 
Wiki[mp]edia data sources & the MediaWiki API
Wiki[mp]edia data sources & the MediaWiki APIWiki[mp]edia data sources & the MediaWiki API
Wiki[mp]edia data sources & the MediaWiki API
 
GLAM-WIKI - Wikimedia tech infrastructure
GLAM-WIKI - Wikimedia tech infrastructureGLAM-WIKI - Wikimedia tech infrastructure
GLAM-WIKI - Wikimedia tech infrastructure
 
The right level of detail (MediaWiki, APIs)
The right level of detail (MediaWiki, APIs)The right level of detail (MediaWiki, APIs)
The right level of detail (MediaWiki, APIs)
 
Free as in Market: Liberty and Property - Rusty Russell
Free as in Market: Liberty and Property - Rusty RussellFree as in Market: Liberty and Property - Rusty Russell
Free as in Market: Liberty and Property - Rusty Russell
 
Public history in the digital age - Claudine Chionh
Public history in the digital age - Claudine ChionhPublic history in the digital age - Claudine Chionh
Public history in the digital age - Claudine Chionh
 
It's all fun and games until someone wants to sue you: Reporting in the age o...
It's all fun and games until someone wants to sue you: Reporting in the age o...It's all fun and games until someone wants to sue you: Reporting in the age o...
It's all fun and games until someone wants to sue you: Reporting in the age o...
 
Gratis & libre - Liam Wyatt
Gratis & libre - Liam WyattGratis & libre - Liam Wyatt
Gratis & libre - Liam Wyatt
 
OpenAustralia - Everyday democracy for everybody in Australia - Matthew Landauer
OpenAustralia - Everyday democracy for everybody in Australia - Matthew LandauerOpenAustralia - Everyday democracy for everybody in Australia - Matthew Landauer
OpenAustralia - Everyday democracy for everybody in Australia - Matthew Landauer
 
Freedom Fighting: How do we convince the powers that be to relax their grip? ...
Freedom Fighting: How do we convince the powers that be to relax their grip? ...Freedom Fighting: How do we convince the powers that be to relax their grip? ...
Freedom Fighting: How do we convince the powers that be to relax their grip? ...
 
Free and open geodata: From shadows to reality - Simon Greener
Free and open geodata: From shadows to reality - Simon GreenerFree and open geodata: From shadows to reality - Simon Greener
Free and open geodata: From shadows to reality - Simon Greener
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Dynamic viz in the IPython Notebook

  • 1. The Centre for Australian Weather and Climate Research A partnership between CSIRO and the Bureau of Meteorology Dynamic visualisation in the IPython Notebook Brianna Laugher Hobart, Tasmania July 2013, PyCon AU www.cawcr.gov.au
  • 2. The Centre for Australian Slides & code github.com/pfctdayelise/dapbook
  • 3. The Centre for Australian What we have...
  • 4. The Centre for Australian What we have...
  • 5. The Centre for Australian The problem Can't zoom Can't pan Can't layer IPython Notebook makes it easy to explore datasets and plot them with matplotlib... ...but for gridded datasets, it really would be nice to have them on a map!
  • 6. The Centre for Australian ...what we want
  • 7. The Centre for Australian What is this data? NetCDF file – common format for gridded data (could easily have been HDF5) Commonly used by earth science communities Sample TAS MinT grid from the Australian Digital Forecast Database produced by BoM, see http://www.bom.gov.au/catalogue/data-feeds.shtml for details and to download sample grids ADFD grids feed into MetEye - http://www.bom.gov.au/australia/meteye/
  • 8. The Centre for Australian MetEye
  • 9. The Centre for Australian OpenLayers PyDAP + WMS response How to get there? NetCDF
  • 10. The Centre for Australian IPython notebook “a web-based interactive computational environment where you can combine code execution, text, mathematics, plots and rich media into a single document” • Inspired by Mathematica, SAGE notebooks • Built-in support for numpy, matplotlib • Half-interpreter, half-script • Great way to “show your work” • Useful for tuning fiddly APIs (ahem matplotlib) • Perfect for tutorials! Run a local server, and/or Publish your notebook as .ipynb and use http://nbviewer.ipython.org/
  • 11. The Centre for Australian IPython notebook pip install ipython pip install tornado pyzmq # needed for notebook, not ipython shell ipython notebook --pylab inline
  • 12. The Centre for Australian IPython notebook Rich display – essentially more types of __repr__ HTML JSON PNG, JPEG, SVG LaTeX Expect this API to change (improve) in future versions, esp. for JavaScript Make a class “Notebook compatible” by adding html, png etc properties: from IPython.display import Image class Foo(object): …. @property def png(self): Return Image(...)
  • 13. The Centre for Australian OpenLayers PyDAP + WMS response How to get there? NetCDF
  • 14. The Centre for Australian JavaScript mapping libraries Leaflet and OpenLayers: Specify layers as “tile layers” or “WMS tile layers” (different APIs) Can set projection as required Can reproject points and vectors (but not map tiles) on-the-fly
  • 15. The Centre for Australian WMS
  • 16. The Centre for Australian Web Map Service Supports 2+ request types – GetMap, GetCapabilities http://test.pydap.org/coads.nc.wms?SST[0]&LAYERS=SST&TRANSPARENT=true&FORMAT=image %2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG %3A900913&BBOX=-180,-90,1252164.27125,1252254.27125&WIDTH=256&HEIGHT=256 REQUEST=GetMap SERVICE=WMS VERSION=1.1.1 LAYERS=MinT_SFC SRS=EPSG:900913 BBOX=-180,-10018844.17,10018574.17,-90 FORMAT=image/png TRANSPARENT=true HEIGHT=256 WIDTH=256
  • 17. The Centre for Australian OpenLayers PyDAP + WMS response How to get there? NetCDF
  • 18. The Centre for Australian PyDAP 2 parts: OPeNDAP server, OPeNDAP client Client • “Lazy loading” of data from any OPeNDAP server into numpy (incl. slices, subsets) • Don't have to care about file format of original data Server • WSGI app • Handlers (input): NetCDF, HDF5, SQL, CSV, remote!, ... • Responses (output): DAS/DDS/DODS, HTML, ASCII, WMS, KML, XLS, ...
  • 19. The Centre for Australian PyDAP
  • 20. The Centre for Australian PyDAP pip install pydap pydap.handlers.netcdf pydap.responses.wms paster create -t pydap myserver cp mydata.nc myserver/data/ # starts a server like http://test.pydap.org/ # run server with 4 workers, better for serving up map tiles gunicorn_paster -w 4 -b 127.0.0.1:8001 myserver/server.ini
  • 21. The Centre for Australian PyDAP
  • 22. The Centre for Australian PyDAP
  • 23. The Centre for Australian PyDAP
  • 24. The Centre for Australian Projections 101 Mapping libraries can reproject points and vectors, but not map tiles... Base layers and overlays need to be requested in the same projection!
  • 25. The Centre for Australian Projections 101 CRS EPSG:4326 EPSG:3857 (aka EPSG:900913) Example of Geographic coordinate system (represents a globe/part of a globe) Projected coordinate system, “Spherical Mercator” (represents a map) Used by “GIS enthusiasts”, Metacarta “almost all free and commercial tile providers” (Google, OSM, Yahoo, Bing) Coords as Lat-lons in decimal degrees “Metres” PyDAP WMS can serve map tiles in √ OpenLayers supports by default √ √ Leaflet supports by default √ But... issue #1207 “EPSG 4326 Support Broken for TileLayers” and... CloudMade doesn't provide WMS. √
  • 26. The Centre for Australian Option 1: Render overlays in EPSG:3857 Base layer Overlays PyDAP WMS 4326 OSM Google Yahoo Bing 3857 Cascading WMS 3857
  • 27. The Centre for Australian Option 2: Pick base layer in EPSG:4326 Base layer Overlays MetaCarta PyDAP WMS 4326 4326 Cascading WMS 4326 OSM Google Yahoo Bing 3857
  • 28. The Centre for Australian Cascading WMS • MapServer • C • MIT license • GeoServer + GeoWebCache • Java • GPL, LGPL licenses • http://maps.opengeo.org/geowebcache/demo • Includes OpenStreetMap, NASA “Blue Marble”
  • 29. The Centre for Australian Putting it all together
  • 30. The Centre for Australian
  • 31. The Centre for Australian template.html
  • 32. The Centre for Australian Back to the notebook
  • 33. The Centre for Australian Other options – GeoDjango? First impression - seems to be a lot more about vector layers than gridded data No particular mention of netcdf, gridded data, WMS
  • 34. The Centre for Australian The future – HTML5 backend for matplotlib?
  • 35. The Centre for Australian Credits With thanks to: Nathan Faggian, for the original leavis, and willingness to share his ideas Leafvis – a WMS-ish app, DIY map tile rendering. https://github.com/nfaggian/leafvis And also: Roberto De Almeida James Sofra Danielle Madeley Roald de Wit Credits Map tiles photo: “Carcassonne” by Tom & Katrien, licensed CC-BY-SA. http://www.flickr.com/photos/inferis/283379928/ PyDAP slide: by PyCon 2007 talk by Roberto De Almeida. http://www.scribd.com/doc/2864/PyCon-2007
  • 36. The Centre for Australian Weather and Climate Research A partnership between CSIRO and the Bureau of Meteorology Brianna Laugher Email: b.laugher@bom.gov.au Web: www.cawcr.gov.au Slides & code: https://github.com/pfctdayelise/dapbook Thank you www.cawcr.gov.au