Siphon Documentation

Siphon Documentation
Release 0.4.0+0.g201423b.dirty
Unidata
April 04, 2016
Contents
1
Documentation
2
Contact Us
31
3
Other Resources
33
4
License
35
5
Related Projects
37
Python Module Index
3
39
i
ii
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
Siphon is a collection of Python utilities for downloading data from Unidata data technologies. Siphon’s current
functionality focuses on access to data hosted on a THREDDS Data Server.
Siphon is still in an early stage of development, and as such no APIs are considered stable. While we won’t break
things just for fun, many things may still change as we work through design issues.
We support Python 2.7 as well as Python >= 3.3.
Contents
1
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
2
Contents
CHAPTER 1
Documentation
1.1 Installation Guide
1.1.1 Requirements
Siphon supports Python 2.7 as well as Python >= 3.2. Python 3.4 is the recommended version.
Siphon requires the following packages:
• requests >= 1.2
• numpy >= 1.8.0
• protobuf >= 3.0.0a3
Installation Instructions for NumPy can be found at: http://www.scipy.org/scipylib/download.html
1.1.2 Installation
The easiest way to install Siphon is through pip:
pip install siphon
The source code can also be grabbed from GitHub. From the base of the source directory, run:
python setup.py install
This will build and install Siphon into your current Python installation.
1.1.3 Examples
The Siphon source comes with a set of example IPython notebooks in the examples/notebooks directory. These
can also be converted to standalone scripts (provided IPython is installed) using:
python setup.py examples
These examples are also seen within the documentation in the Siphon Examples.
3
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
1.2 The Siphon API
1.2.1 siphon.catalog
This module contains code to support reading and parsing catalog files from a THREDDS Data Server (TDS). They
help identifying the latest dataset and finding proper URLs to access the data.
class siphon.catalog.CatalogRef(base_url, element_node)
An object for holding Catalog References obtained from a THREDDS Client Catalog.
name
str
The name of the CatalogRef element
href
str
url to the CatalogRef‘s THREDDS Client Catalog
title
str
Title of the CatalogRef element
__init__(base_url, element_node)
Initialize the catalogRef object.
Parameters
• base_url (str) – URL to the base catalog that owns this reference
• element_node (Element) – An Element representing a catalogRef node
follow()
Follow the catalog reference, returning a new TDSCatalog
Returns The referenced catalog
Return type TDSCatalog
class siphon.catalog.CompoundService(service_node)
An object for holding information about compound services.
name
str
The name of the compound service
service_type
str
The service type (for this object, service type will always be “COMPOUND”)
services
list[SimpleService]
A list of SimpleService objects
__init__(service_node)
Initialize a CompoundService object.
Parameters service_node (Element) – An Element representing a compound service
node
4
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
class siphon.catalog.Dataset(element_node, catalog_url=’‘)
An object for holding Datasets obtained from a THREDDS Client Catalog.
name
str
The name of the Dataset element
url_path
str
url to the accessible dataset
access_urls
dict[str, str]
A dictionary of access urls whose keywords are the access service types defined in the catalog (for example,
“OPENDAP”, “NetcdfSubset”, “WMS”, etc.
__init__(element_node, catalog_url=’‘)
Initialize the Dataset object.
Parameters
• element_node (Element) – An Element representing a Dataset node
• catalog_url (str) – The top level server url
make_access_urls(catalog_url, all_services, metadata=None)
Make fully qualified urls for the access methods enabled on the dataset.
Parameters
• catalog_url (str) – The top level server url
• all_services (List[SimpleService]) – list of SimpleService objects associated with the dataset
• metadata (TDSCatalogMetadata) – Metadata from the TDSCatalog
resolve_url(catalog_url)
Resolve the url of the dataset when reading latest.xml
Parameters catalog_url (str) – The catalog url to be resolved
class siphon.catalog.SimpleService(service_node)
An object for holding information about an access service enabled on a dataset.
name
str
The name of the service
service_type
str
The service type (i.e. “OPENDAP”, “NetcdfSubset”, “WMS”, etc.)
access_urls
dict[str, str]
A dictionary of access urls whose keywords are the access service types defined in the catalog (for example,
“OPENDAP”, “NetcdfSubset”, “WMS”, etc.)
__init__(service_node)
Initialize the Dataset object.
1.2. The Siphon API
5
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
Parameters service_node (Element) – An Element representing a service node
class siphon.catalog.TDSCatalog(catalog_url)
An object for holding information from a THREDDS Client Catalog.
catalog_url
str
The url path of the catalog to parse.
base_tds_url
str
The top level server address
datasets
dict[str, Dataset]
A dictionary of Dataset objects, whose keys are the name of the dataset’s name
services
List
A list of SimpleService listed in the catalog
catalog_refs
dict[str, CatalogRef]
A dictionary of CatalogRef objects whose keys are the name of the catalog ref title.
__init__(catalog_url)
Initialize the TDSCatalog object.
Parameters catalog_url (str) – The URL of a THREDDS client catalog
siphon.catalog.get_latest_access_url(catalog_url, access_method)
Get the data access url, using a specified access method, to the latest data available from a top level dataset
catalog (url). Currently only supports the existence of one “latest” dataset.
Parameters
• catalog_url (str) – The URL of a top level data catalog
• access_method (str) – desired data access method (i.e. “OPENDAP”, “NetcdfSubset”, “WMS”, etc)
Returns access_url – Data access URL to be used to access the latest data available from a given
catalog using the specified access_method. Typically a single string, but not always.
Return type str
1.2.2 siphon.metadata
This module contains code to support reading and parsing metadata elements from a THREDDS Data Server (TDS)
Client catalog.
class siphon.metadata.TDSCatalogMetadata(element, metadata_in=None)
An object for holding information contained in the catalog Metadata tag.
metadata
dict[str, object]
The dictionary containing the metadata entries
6
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
__init__(element, metadata_in=None)
Initialize a TDSCatalogMetadata object.
Parameters
• element (Element) – An Element representing a metadata node
• metadata_in (dict[str, object], optional) – Parent metadata to inherit,
if appropriate. Defaults to None.
1.2.3 siphon.ncss_dataset
This module contains code to support reading and parsing the dataset.xml documents from the THREDDS Data Server
(TDS) netCDF Subset Service.
class siphon.ncss_dataset.NCSSDataset(element)
An object for holding information contained in the dataset.xml NCSS document.
In general, if a dataset.xml NCSS document is missing the information needed to construct an attribute, that
attribute will not show up as part of the NCSSDataset object.
Note that only gridded ncss datasets may contain the attributes gridsets, axes, coordinate_transforms, and
lat_lon_box.
variables
dict[str, str]
A dictionary of variables
time_span
dict[str, datetime.datetime]
A dictionary holding the beginning and ending iso time strings which define the temporal bounds
of the dataset
featureDataset [dict[str, str]] A dictionary containing the type [”grid”, “point”] and location [”url”] of
the dataset
accept_list
dict[str, list[str]]
A dictionary holding the types of valid returns of the dataset by access method [Grid, GridAsPoint, PointFeatureCollection]
gridsets
dict[str, set[str]]
A dictionary of gridSets contained within the dataset
axes
dict[str, object]
A dictionary of coordinate axes
coordinate_transforms
dict[str, object]
A dictionary of coordinate transforms
lat_lon_box
dict[str, float]
1.2. The Siphon API
7
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
A dictionary holding the north, south, east, and west latitude and longitude bounds of the dataset (in
degree_east, degree_north)
__init__(element)
Initialize a NCSSDataset object.
Parameters element (Element) – An Element representing the top level node of an NCSS
dataset.xml doc
1.2.4 siphon.http_util
This module contains utility code to support making requests using HTTP.
exception siphon.http_util.BadQueryError
Exception raised when a query fails.
class siphon.http_util.DataQuery
An object representing a query for data from a THREDDS server.
This object provides a clear API to formulate a query for data, including a spatial query, a time query, and
possibly some variables or other parameters. These objects provide a dictionary-like interface, (items() and
__iter__()) sufficient to be passed to functions expecting a dictionary representing a URL query. Instances
of this object can also be turned into a string, which will yield a properly escaped string for a URL.
__iter__()
Returns an iterator of the various items (name=value pairs) that compose the query.
Returns items – Sequence of tuples of name, value representing the query.
Return type iterator
__repr__()
Format query as a urlencoded string.
__str__()
Format query as a urlencoded string.
add_query_parameter(**kwargs)
Add arbitrary query element (name=value) to the request.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
Parameters kwargs (one or more strings passed as keyword arguments)
– Names and values of parameters to add to the query
Returns self – Returns self for chaining calls
Return type DataQuery
all_times()
Add a request for all times to the query
This adds a request for all times (temporal=all). This modifies the query in-place, but returns self so that
multiple queries can be chained together on one line.
This replaces any existing temporal queries that have been set.
Returns self – Returns self for chaining calls
Return type DataQuery
items()
Returns an iterator of the various items (name=value pairs) that compose the query.
8
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
Returns items – Sequence of tuples of name, value representing the query.
Return type iterator
lonlat_box(west, east, south, north)
Add a latitude/longitude bounding box to the query.
This adds a request for a spatial bounding box, bounded by (‘north’, ‘south’) for latitude and (‘east’,
‘west’) for the longitude. This modifies the query in-place, but returns self so that multiple queries can be
chained together on one line.
This replaces any existing spatial queries that have been set.
Parameters
• west (float) – The bounding longitude to the west, in degrees east of the prime meridian
• east (float) – The bounding longitude to the east, in degrees east of the prime meridian
• south (float) – The bounding latitude to the south, in degrees north of the equator
• north (float) – The bounding latitude to the north, in degrees north of the equator
Returns self – Returns self for chaining calls
Return type DataQuery
lonlat_point(lon, lat)
Add a latitude/longitude point to the query.
This adds a request for a (lon, lat) point. This modifies the query in-place, but returns self so that multiple
queries can be chained together on one line.
This replaces any existing spatial queries that have been set.
Parameters
• lon (float) – The longitude to request
• lat (float) – The latitude to request
Returns self – Returns self for chaining calls
Return type DataQuery
time(time)
Add a request for a specific time to the query.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
This replaces any existing temporal queries that have been set.
Parameters time (datetime.datetime) – The time to request
Returns self – Returns self for chaining calls
Return type DataQuery
time_range(start, end)
Add a request for a time range to the query.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
This replaces any existing temporal queries that have been set.
1.2. The Siphon API
9
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
Parameters
• start (datetime.datetime) – The start of the requested time range
• end (datetime.datetime) – The end of the requested time range
Returns self – Returns self for chaining calls
Return type DataQuery
variables(*var_names)
Specify one or more variables for the query.
This function ensures that variable names are not repeated.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
Parameters var_names (one or more strings) – One or more names of variables to
request
Returns self – Returns self for chaining calls
Return type DataQuery
class siphon.http_util.HTTPEndPoint(url)
An object representing an endpoint on a server that is accessed using HTTP.
This provides a simple way to point to a URL, formulate appropriate queries and validate them, parse metadata
as appropriate, and parse returns from requests.
get(path, params=None)
Make a GET request, optionally including a parameters, to a path.
The path of the request is the full URL.
Parameters
• path (str) – The URL to request
• params (DataQuery, optional) – The query to pass when making the request
Returns resp – The server’s response to the request
Return type requests.Response
Raises HTTPError – If the server returns anything other than a 200 (OK) code
See also:
get_query(), get()
get_path(path, query=None)
Make a GET request, optionally including a query, to a relative path.
The path of the request includes a path on top of the base URL assigned to the endpoint.
Parameters
• path (str) – The path to request, relative to the endpoint
• query (DataQuery, optional) – The query to pass when making the request
Returns resp – The server’s response to the request
Return type requests.Response
10
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
See also:
get_query(), get(), url_path()
get_query(query)
Make a GET request, including a query, to the endpoint
The path of the request is to the base URL assigned to the endpoint.
Parameters query (DataQuery) – The query to pass when making the request
Returns resp – The server’s response to the request
Return type requests.Response
See also:
get_path(), get()
query()
Create a new query object
Returns a new DataQuery instance appropriate for this endpoint.
The default implementation returns a DataQuery instance. Subclasses can override to return a subclass
specific to this endpoint.
Returns valid – Whether query is valid.
Return type bool
url_path(path)
Assemble the full url to a path.
Given a path relative to the base URL, assemble the full URL.
Parameters path (str) – The path, relative to the endpoint
Returns url – The full URL to path
Return type str
See also:
get_path()
validate_query(query)
Validate a query
Determines whether a query is well-formed. This includes checking for all required parameters, as well as
checking parameters for valid values.
The default implementation does nothing. It is presumed that subclasses implement this to do more detailed
checking as appropriate.
Parameters query (DataQuery (or subclass)) –
Returns valid – Whether query is valid.
Return type bool
class siphon.http_util.UTC
siphon.http_util.create_http_session()
Create a new HTTP session with our user-agent set.
Returns session – The created session
Return type requests.Session
1.2. The Siphon API
11
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
See also:
urlopen()
siphon.http_util.parse_iso_date(s)
Parse a string containing an ISO-8601 formatted date
Parameters s (str) – The string to be parsed
Returns dt – The results of parsing the string
Return type datetime.datetime
siphon.http_util.urlopen(url, **kwargs)
GET a file-like object for a URL using HTTP.
This is a thin wrapper around requests.Session.get() that returns a file-like object wrapped around the
resulting content.
Parameters
• url (str) – The URL to request
• kwargs (arbitrary keyword arguments) – Additional keyword arguments to
pass to requests.Session.get().
Returns fobj – A file-like interface to the content in the response
Return type file-like object
See also:
requests.Session.get()
1.2.5 siphon.ncss
This module contains code to support making data requests to the NetCDF subset service (NCSS) on a THREDDS
Data Server (TDS). This includes forming proper queries as well as parsing the returned data.
class siphon.ncss.NCSS(url)
Wraps access to the NetCDF Subset Service (NCSS) on a THREDDS server.
Simplifies access via HTTP to the NCSS endpoint. Parses the metadata, provides data download and parsing
based on the appropriate query.
metadata
NCSSDataset
Contains the result of parsing the NCSS endpoint’s dataset.xml. This has information about the time and
space coverage, as well as full information about all of the variables.
variables
set(str)
Names of all variables available in this dataset
unit_handler
callable
Function to handle units that come with CSV/XML data. Should be a callable that takes a list of string
values and unit str (can be None), and returns the desired representation of values. Defaults to ignoring
units and returning numpy.array().
12
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
get_data(query)
Fetch parsed data from a THREDDS server using NCSS
Requests data from the NCSS endpoint given the parameters in query and handles parsing of the returned
content based on the mimetype.
Parameters query (NCSSQuery) – The parameters to send to the NCSS endpoint
Returns
• Parsed data response from the server. Exact format depends on the format of the
• response.
See also:
get_data_raw()
get_data_raw(query)
Fetch raw data from a THREDDS server using NCSS
Requests data from the NCSS endpoint given the parameters in query and returns the raw bytes of the
response.
Parameters query (NCSSQuery) – The parameters to send to the NCSS endpoint
Returns content – The raw, un-parsed, data returned by the server
Return type bytes
See also:
get_data()
query()
Returns a new query for NCSS
Returns query – The newly created query
Return type NCSSQuery
static unit_handler(data, units=None)
Default unit handler, which ignores units and just returns numpy.array()
validate_query(query)
Validate a query
Determines whether query is well-formed. This includes checking for all required parameters, as well as
checking parameters for valid values.
Parameters query (NCSSQuery) – The query to validate
Returns valid – Whether query is valid.
Return type bool
class siphon.ncss.NCSSQuery
An object representing a query to the NetCDF Subset Service (NCSS).
Expands on the queries supported by DataQuery to add queries specific to NCSS.
accept(fmt)
Set format for data returned from NCSS.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
Parameters fmt (str) – The format to send to the server.
1.2. The Siphon API
13
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
Returns self – Returns self for chaining calls
Return type NCSSQuery
add_lonlat(value=True)
Sets whether NCSS should add latitude/longitude to returned data.
This is only used on grid requests. Used to make returned data CF-compliant. This modifies the query
in-place, but returns self so that multiple queries can be chained together on one line.
Parameters value (bool, optional) – Whether to add latitude/longitude information.
Defaults to True.
Returns self – Returns self for chaining calls
Return type NCSSQuery
projection_box(min_x, min_y, max_x, max_y)
Add a bounding box in projected (native) coordinates to the query.
This adds a request for a spatial bounding box, bounded by (min_x, max_x) for x direction and (min_y,
max_y) for the y direction. This modifies the query in-place, but returns self so that multiple queries can
be chained together on one line.
This replaces any existing spatial queries that have been set.
Parameters
• min_x (float) – The left edge of the bounding box
• min_y (float) – The bottom edge of the bounding box
• max_x (float) – The right edge of the bounding box
• max_y (float) – The top edge of the bounding box
Returns self – Returns self for chaining calls
Return type NCSSQuery
strides(time=None, spatial=None)
Set time and/or spatial (horizontal) strides.
This is only used on grid requests. Used to skip points in the returned data. This modifies the query
in-place, but returns self so that multiple queries can be chained together on one line.
Parameters
• time (int, optional) – Stride for times returned. Defaults to None, which is equivalent to 1.
• spatial (int, optional) – Stride for horizontal grid. Defaults to None, which is
equivalent to 1.
Returns self – Returns self for chaining calls
Return type NCSSQuery
vertical_level(level)
Set vertical level for which data should be retrieved.
The value depends on the coordinate values for the vertical dimension of the requested variable.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
Parameters level (float) – The value of the desired level
14
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
Returns self – Returns self for chaining calls
Return type NCSSQuery
class siphon.ncss.ResponseRegistry
Allows registering of functions to be called based on the mimetype in the response headers.
siphon.ncss.combine_dicts(l)
Combine a list of dictionaries into single one
siphon.ncss.default_unit_handler(data, units=None)
Default unit handler, which ignores units and just returns numpy.array()
siphon.ncss.squish(l)
If list contains only 1 element, return it instead
1.2.6 siphon.radarserver
This module contains code to support making data requests to the radar data query service (radar server) on a
THREDDS Data Server (TDS). This includes forming proper queries as well as parsing the returned catalog.
class siphon.radarserver.RadarQuery
An object representing a query to the THREDDS radar server.
Expands on the queries supported by DataQuery to add queries specific to the radar data query service.
stations(*stns)
Specify one or more stations for the query.
This modifies the query in-place, but returns self so that multiple queries can be chained together on one
line.
This replaces any existing spatial queries that have been set.
Parameters stns (one or more strings) – One or more names of variables to request
Returns self – Returns self for chaining calls
Return type RadarQuery
class siphon.radarserver.RadarServer(url)
Wraps access to the THREDDS radar query service (radar server).
Simplifies access via HTTP to the radar server endpoint. Parses the metadata, provides query catalog results
download and parsing based on the appropriate query.
metadata
TDSCatalogMetadata
Contains the result of parsing the radar server endpoint’s dataset.xml. This has information about the time
and space coverage, as well as full information about all of the variables.
variables
set(str)
Names of all variables available in this dataset
stations
dict[str, Station]
Mapping of station ID to a Station, which is a namedtuple containing the station’s id, name, latitude,
longitude, and elevation.
1.2. The Siphon API
15
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
__init__(url)
Create a RadarServer instance.
Parameters url (str) – The base URL for the endpoint
get_catalog(query)
Fetch a parsed THREDDS catalog from the radar server
Requests a catalog of radar data files data from the radar server given the parameters in query and returns
a TDSCatalog instance.
Parameters query (RadarQuery) – The parameters to send to the radar server
Returns catalog – The catalog of matching data files
Return type TDSCatalog
Raises BadQueryError – When the query cannot be handled by the server
See also:
get_catalog_raw()
get_catalog_raw(query)
Fetch THREDDS catalog XML from the radar server
Requests a catalog of radar data files data from the radar server given the parameters in query and returns
the raw XML.
Parameters query (RadarQuery) – The parameters to send to the radar server
Returns catalog – The XML of the catalog of matching data files
Return type bytes
See also:
get_catalog()
query()
Returns a new query for the radar server
Returns The new query
Return type RadarQuery
validate_query(query)
Validate a query
Determines whether query is well-formed. This includes checking for all required parameters, as well as
checking parameters for valid values.
Parameters query (RadarQuery) – The query to validate
Returns valid – Whether query is valid.
Return type bool
class siphon.radarserver.Station(id, elevation, latitude, longitude, name)
__getnewargs__()
Return self as a plain tuple. Used by copy and pickle.
__getstate__()
Exclude the OrderedDict from pickling
16
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
__repr__()
Return a nicely formatted representation string
elevation
Alias for field number 1
id
Alias for field number 0
latitude
Alias for field number 2
longitude
Alias for field number 3
name
Alias for field number 4
siphon.radarserver.get_radarserver_datasets(server)
Get datasets from a THREDDS radar server’s top-level catalog.
This is a helper function to construct the appropriate catalog URL from the server URL, fetch the catalog, and
return the contained catalog references.
Parameters server (string) – The base URL to the THREDDS server
Returns datasets – Mapping of dataset name to the catalog reference
Return type dict[str, CatalogRef]
siphon.radarserver.parse_station_table(root)
Parse station list XML file
siphon.radarserver.parse_xml_station(elem)
Create a Station instance from an XML tag
• genindex
• modindex
1.3 Siphon Examples
1.3.1 Basic Usage
Notebook
This is currently a placeholder for a better example
from __future__ import print_function
from siphon.catalog import TDSCatalog
cat = TDSCatalog('http://thredds.ucar.edu/thredds/catalog.xml')
print(list(cat.catalog_refs.keys()))
['Forecast Model Data', 'Unidata case studies', 'Forecast Products and Analyses', 'Observation Data',
1.3. Siphon Examples
17
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
1.3.2 NCSS Cartopy Example
Notebook
Using Siphon to query the NetCDF Subset Service and plotting it to a map
This example uses Siphon’s NCSS class to provide temperature data for contouring a basic map using Cartopy
First we construct a TDSCatalog instance pointing to our dataset of interest, in this case TDS’ “Best” virtual dataset
for the GFS global 0.25 degree collection of GRIB files. This will give us a good resolution for our map. This catalog
contains a single dataset.
from siphon.catalog import TDSCatalog
best_gfs = TDSCatalog('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/'
'Global_0p25deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p25deg/Best')
print(list(best_gfs.datasets))
['Best GFS Quarter Degree Forecast Time Series']
We pull out this dataset and look at the access urls.
best_ds = list(best_gfs.datasets.values())[0]
best_ds.access_urls
{'CdmRemote': 'http://thredds.ucar.edu/thredds/cdmremote/grib/NCEP/GFS/Global_0p25deg/Best',
'ISO': 'http://thredds.ucar.edu/thredds/iso/grib/NCEP/GFS/Global_0p25deg/Best',
'NCML': 'http://thredds.ucar.edu/thredds/ncml/grib/NCEP/GFS/Global_0p25deg/Best',
'NetcdfSubset': 'http://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Global_0p25deg/Best',
'OPENDAP': 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p25deg/Best',
'UDDC': 'http://thredds.ucar.edu/thredds/uddc/grib/NCEP/GFS/Global_0p25deg/Best',
'WCS': 'http://thredds.ucar.edu/thredds/wcs/grib/NCEP/GFS/Global_0p25deg/Best',
'WMS': 'http://thredds.ucar.edu/thredds/wms/grib/NCEP/GFS/Global_0p25deg/Best'}
Note the NetcdfSubset entry, which we will use with our NCSS class.
from siphon.ncss import NCSS
ncss = NCSS(best_ds.access_urls['NetcdfSubset'])
We can then use the ncss object to create a new query object, which facilitates asking for data from the server.
query = ncss.query()
We construct a query asking for data corresponding to a latitude and longitude box where 43 lat is the northern extent,
35 lat is the southern extent, -111 long is the western extent and -100 is the eastern extent. We request the data for the
current time.
We also ask for NetCDF version 4 data, for the variable ‘temperature_surface’. This request will return all surface
temperatures for points in our bounding box for a single time, nearest to that requested. Note the string representation
of the query is a properly encoded query string.
from datetime import datetime
query.lonlat_box(north=43, south=35, east=-100, west=-111).time(datetime.utcnow())
query.accept('netcdf4')
query.variables('Temperature_surface')
var=Temperature_surface&time=2016-04-04T21%3A41%3A12.148123&east=-100&west=-111&south=35&north=43&acc
18
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
We now request data from the server using this query. The NCSS class handles parsing this NetCDF data (using
the netCDF4 module). If we print out the variable names, we see our requested variable, as well as the coordinate
variables (needed to properly reference the data).
data = ncss.get_data(query)
print(list(data.variables))
['Temperature_surface', 'reftime1', 'time1', 'lat', 'lon']
We’ll pull out the useful variables for temperature, latitude, and longitude, and time (which is the time, in hours since
the forecast run).
temp_var = data.variables['Temperature_surface']
# Time variables can be renamed in GRIB collections. Best to just pull it out of the
# coordinates attribute on temperature
time_name = temp_var.coordinates.split()[1]
time_var = data.variables[time_name]
lat_var = data.variables['lat']
lon_var = data.variables['lon']
Now we make our data suitable for plotting.
import numpy as np
from netCDF4 import num2date
# Get the actual data values and remove any size 1 dimensions
temp_vals = temp_var[:].squeeze()
lat_vals = lat_var[:].squeeze()
lon_vals = lon_var[:].squeeze()
# Convert the number of hours since the reference time to an actual date
time_val = num2date(time_var[:].squeeze(), time_var.units)
# Convert temps to Fahrenheit from Kelvin
temp_vals = temp_vals * 1.8 - 459.67
# Combine 1D latitude and longitudes into a 2D grid of locations
lon_2d, lat_2d = np.meshgrid(lon_vals, lat_vals)
Now we can plot these up using matplotlib and cartopy.
%matplotlib inline
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
# Create a new figure
fig = plt.figure(figsize=(15, 12))
# Add the map and set the extent
ax = plt.axes(projection=ccrs.PlateCarree())
ax.set_extent([-100., -111., 35, 43])
# Add state boundaries to plot
states_provinces = cfeature.NaturalEarthFeature(
category='cultural',
name='admin_1_states_provinces_lines',
scale='50m',
facecolor='none')
1.3. Siphon Examples
19
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
ax.add_feature(states_provinces, edgecolor='black', linewidth=2)
# Contour temperature at each lat/long
cf = ax.contourf(lon_2d, lat_2d, temp_vals, 200, transform=ccrs.PlateCarree(), zorder=0,
cmap='coolwarm')
# Plot a colorbar to show temperature and reduce the size of it
plt.colorbar(cf, ax=ax, fraction=0.032)
# Make a title with the time value
ax.set_title(u'Temperature forecast (\u00b0F) for {0:%d %B %Y %H:%MZ}'.format(time_val),
fontsize=20)
# Plot markers for each lat/long to show grid points for 0.25 deg GFS
ax.plot(lon_2d.flatten(), lat_2d.flatten(), marker='o', color='black', markersize=2,
alpha=0.3, transform=ccrs.Geodetic(), zorder=2, linestyle='none');
1.3.3 NCSS Example
Notebook
Using Siphon to query the NetCDF Subset Service
First we construct a TDSCatalog instance pointing to our dataset of interest, in this case TDS’ “Best” virtual dataset
for the GFS global 0.5 degree collection of GRIB files. We see this catalog contains a single dataset.
20
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
from siphon.catalog import TDSCatalog
best_gfs = TDSCatalog('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p5deg/catalog.xm
best_gfs.datasets
{'Best GFS Half Degree Forecast Time Series': <siphon.catalog.Dataset at 0x108cbde10>}
We pull out this dataset and look at the access urls.
best_ds = list(best_gfs.datasets.values())[0]
best_ds.access_urls
{'CdmRemote': 'http://thredds.ucar.edu/thredds/cdmremote/grib/NCEP/GFS/Global_0p5deg/Best',
'ISO': 'http://thredds.ucar.edu/thredds/iso/grib/NCEP/GFS/Global_0p5deg/Best',
'NCML': 'http://thredds.ucar.edu/thredds/ncml/grib/NCEP/GFS/Global_0p5deg/Best',
'NetcdfSubset': 'http://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Global_0p5deg/Best',
'OPENDAP': 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p5deg/Best',
'UDDC': 'http://thredds.ucar.edu/thredds/uddc/grib/NCEP/GFS/Global_0p5deg/Best',
'WCS': 'http://thredds.ucar.edu/thredds/wcs/grib/NCEP/GFS/Global_0p5deg/Best',
'WMS': 'http://thredds.ucar.edu/thredds/wms/grib/NCEP/GFS/Global_0p5deg/Best'}
Note the NetcdfSubset entry, which we will use with our NCSS class.
from siphon.ncss import NCSS
ncss = NCSS(best_ds.access_urls['NetcdfSubset'])
We can then use the ncss object to create a new query object, which facilitates asking for data from the server.
query = ncss.query()
We construct a query asking for data corresponding to latitude 40N and longitude 105W, for the current time. We
also ask for NetCDF version 4 data, for the variables ‘Temperature_isobaric’ and ‘Relative_humidity_isobaric’. This
request will return all vertical levels for a single point and single time. Note the string representation of the query is a
properly encoded query string.
from datetime import datetime
query.lonlat_point(-105, 40).time(datetime.utcnow())
query.accept('netcdf4')
query.variables('Temperature_isobaric', 'Relative_humidity_isobaric')
var=Temperature_isobaric&var=Relative_humidity_isobaric&time=2015-06-17T16%3A48%3A36.440540&longitude
We now request data from the server using this query. The NCSS class handles parsing this NetCDF data (using the
netCDF4 module). If we print out the variable names, we see our requested variables, as well as a few others (more
metadata information)
data = ncss.get_data(query)
list(data.variables.keys())
['isobaric3',
'Temperature_isobaric',
'Relative_humidity_isobaric',
'station_name',
'station_description',
'latitude',
'longitude',
'time']
We’ll pull out the variables we want to use, as well as the pressure values (from the isobaric3 variable).
1.3. Siphon Examples
21
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
temp = data.variables['Temperature_isobaric']
relh = data.variables['Relative_humidity_isobaric']
press = data.variables['isobaric3']
press_vals = press[:].squeeze()
Now we can plot these up using matplotlib.
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1, figsize=(9, 8))
ax.plot(temp[:].squeeze(), press_vals, 'r', linewidth=2)
ax.set_xlabel(temp.standard_name + ' (%s)' % temp.units)
ax.set_ylabel(press.standard_name + ' (%s)' % press.units)
# Create second plot with shared y-axis
ax2 = plt.twiny(ax)
ax2.plot(relh[:].squeeze(), press_vals, 'g', linewidth=2)
ax2.set_xlabel(relh.standard_name + ' (%s)' % relh.units)
ax.set_ylim(press_vals.max(), press_vals.min())
ax.grid(True)
22
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
1.3.4 NCSS Timeseries Examples
Notebook
Using Siphon to query the NetCDF Subset Service for a timeseries
First we construct a TDSCatalog instance pointing to our dataset of interest, in this case TDS’ “Best” virtual dataset
for the GFS global 0.5 degree collection of GRIB files. We see this catalog contains a single dataset.
from siphon.catalog import TDSCatalog
best_gfs = TDSCatalog('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p5deg/catalog.xm
best_gfs.datasets
{'Best GFS Half Degree Forecast Time Series': <siphon.catalog.Dataset at 0x1084f4dd8>}
We pull out this dataset and look at the access urls.
best_ds = list(best_gfs.datasets.values())[0]
best_ds.access_urls
{'CdmRemote': 'http://thredds.ucar.edu/thredds/cdmremote/grib/NCEP/GFS/Global_0p5deg/Best',
'ISO': 'http://thredds.ucar.edu/thredds/iso/grib/NCEP/GFS/Global_0p5deg/Best',
'NCML': 'http://thredds.ucar.edu/thredds/ncml/grib/NCEP/GFS/Global_0p5deg/Best',
'NetcdfSubset': 'http://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Global_0p5deg/Best',
'OPENDAP': 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p5deg/Best',
'UDDC': 'http://thredds.ucar.edu/thredds/uddc/grib/NCEP/GFS/Global_0p5deg/Best',
'WCS': 'http://thredds.ucar.edu/thredds/wcs/grib/NCEP/GFS/Global_0p5deg/Best',
'WMS': 'http://thredds.ucar.edu/thredds/wms/grib/NCEP/GFS/Global_0p5deg/Best'}
Note the NetcdfSubset entry, which we will use with our NCSS class.
from siphon.ncss import NCSS
ncss = NCSS(best_ds.access_urls['NetcdfSubset'])
We can then use the ncss object to create a new query object, which facilitates asking for data from the server.
query = ncss.query()
We construct a query asking for data corresponding to latitude 40N and longitude 105W, for the next 7 days. We also
ask for NetCDF version 4 data, for the variable ‘Temperature_isobaric’, at the vertical level of 100000 Pa (approximately surface). This request will return all times in the range for a single point. Note the string representation of the
query is a properly encoded query string.
from datetime import datetime, timedelta
now = datetime.utcnow()
query.lonlat_point(-105, 40).vertical_level(100000).time_range(now, now + timedelta(days=7))
query.variables('Temperature_isobaric').accept('netcdf')
var=Temperature_isobaric&time_end=2015-06-24T17%3A21%3A38.750638&time_start=2015-06-17T17%3A21%3A38.7
We now request data from the server using this query. The NCSS class handles parsing this NetCDF data (using the
netCDF4 module). If we print out the variable names, we see our requested variables, as well as a few others (more
metadata information)
data = ncss.get_data(query)
list(data.variables.keys())
1.3. Siphon Examples
23
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
['isobaric3',
'Temperature_isobaric',
'station_name',
'station_description',
'latitude',
'longitude',
'time']
We’ll pull out the temperature and time variables.
temp = data.variables['Temperature_isobaric']
time = data.variables['time']
The time values are in hours relative to the start of the entire model collection. Fortunately, the netCDF4 module has
a helper function to convert these numbers into Python datetime objects. We can see the first 5 element output by
the function look reasonable.
from netCDF4 import num2date
time_vals = num2date(time[:].squeeze(), time.units)
time_vals[:5]
array([datetime.datetime(2015,
datetime.datetime(2015,
datetime.datetime(2015,
datetime.datetime(2015,
datetime.datetime(2015,
6,
6,
6,
6,
6,
17,
17,
18,
18,
18,
18, 0),
21, 0),
0, 0),
3, 0),
6, 0)], dtype=object)
Now we can plot these up using matplotlib, which has ready-made support for datetime objects.
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1, figsize=(9, 8))
ax.plot(time_vals, temp[:].squeeze(), 'r', linewidth=2)
ax.set_ylabel(temp.standard_name + ' (%s)' % temp.units)
ax.set_xlabel('Forecast Time (UTC)')
ax.grid(True)
24
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
1.3.5 Radar Server Level 3
Notebook
Using Siphon to get NEXRAD Level 3 data from a TDS
First, point to the top-level thredds radar server accessor to find what datasets are available.
from siphon.radarserver import RadarServer, get_radarserver_datasets
ds = get_radarserver_datasets('http://thredds.ucar.edu/thredds/')
print(list(ds.keys()))
['NEXRAD Level III Radar for Case Study CCS039', 'TDWR Level III Radar from IDD', 'NEXRAD Level II Ra
Now create an instance of RadarServer to point to the appropriate radar server access URL. This is pulled from the
catalog reference url.
1.3. Siphon Examples
25
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
url = ds['NEXRAD Level III Radar from IDD'].follow().catalog_url
rs = RadarServer(url)
Look at the variables available in this dataset
rs.variables
{'DAA',
'DHR',
'DOD',
'DPA',
'DPR',
'DSD',
'DSP',
'DTA',
'DU3',
'DU6',
'DVL',
'EET',
'HHC',
'N0C',
'N0H',
'N0K',
'N0M',
'N0Q',
'N0R',
'N0S',
'N0U',
'N0V',
'N0X',
'N0Z',
'N1C',
'N1H',
'N1K',
'N1M',
'N1P',
'N1Q',
'N1S',
'N1U',
'N1X',
'N2C',
'N2H',
'N2K',
'N2M',
'N2Q',
'N2S',
'N2U',
'N2X',
'N3C',
'N3H',
'N3K',
'N3M',
'N3Q',
'N3S',
'N3U',
'N3X',
'NAC',
'NAH',
'NAK',
26
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
'NAM',
'NAQ',
'NAU',
'NAX',
'NBC',
'NBH',
'NBK',
'NBM',
'NBQ',
'NBU',
'NBX',
'NCR',
'NET',
'NMD',
'NST',
'NTP',
'NVL',
'NVW',
'OHA',
'PTA'}
Create a new query object to help request the data. Using the chaining methods, ask for data from radar FTG (Denver)
for now for the product N0Q, which is reflectivity data for the lowest tilt. We see that when the query is represented
as a string, it shows the encoded URL.
from datetime import datetime
query = rs.query()
query.stations('FTG').time(datetime.utcnow()).variables('N0Q')
var=N0Q&time=2015-07-15T22%3A50%3A49.691861&stn=FTG
We can use the RadarServer instance to check our query, to make sure we have required parameters and that we have
chosen valid station(s) and variable(s)
rs.validate_query(query)
True
Make the request, which returns an instance of TDSCatalog. This handles parsing the catalog
catalog = rs.get_catalog(query)
We can look at the datasets on the catalog to see what data we found by the query. We find one NIDS file in the return
catalog.datasets
{'Level3_FTG_N0Q_20150715_2247.nids': <siphon.catalog.Dataset at 0x10b831e48>}
We can pull that dataset out of the dictionary and look at the available access URLs. We see URLs for OPeNDAP,
CDMRemote, and HTTPServer (direct download).
ds = list(catalog.datasets.values())[0]
ds.access_urls
{'CdmRemote': 'http://thredds.ucar.edu/thredds/cdmremote/nexrad/level3/IDD/N0Q/FTG/20150715/Level3_FT
'HTTPServer': 'http://thredds.ucar.edu/thredds/fileServer/nexrad/level3/IDD/N0Q/FTG/20150715/Level3_
'OPENDAP': 'http://thredds.ucar.edu/thredds/dodsC/nexrad/level3/IDD/N0Q/FTG/20150715/Level3_FTG_N0Q_
We’ll use the CDMRemote reader in Siphon and pass it the appropriate access URL.
1.3. Siphon Examples
27
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
from siphon.cdmr import Dataset
data = Dataset(ds.access_urls['CdmRemote'])
The CDMRemote reader provides an interface that is almost identical to the usual python NetCDF interface. We pull
out the variables we need for azimuth and range, as well as the data itself.
rng = data.variables['gate'][:] / 1000.
az = data.variables['azimuth'][:]
ref = data.variables['BaseReflectivityDR'][:]
Then convert the polar coordinates to Cartesian
import numpy as np
x = rng * np.sin(np.deg2rad(az))[:, None]
y = rng * np.cos(np.deg2rad(az))[:, None]
ref = np.ma.array(ref, mask=np.isnan(ref))
Finally, we plot them up using matplotlib.
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1, figsize=(9, 8))
ax.pcolormesh(x, y, ref)
ax.set_aspect('equal', 'datalim')
ax.set_xlim(-460, 460)
ax.set_ylim(-460, 460)
<IPython.core.display.Javascript object>
(-460, 460)
1.4 Developer’s Guide
1.4.1 Requirements
• pytest
• flake8
• sphinx >= 1.3
• sphinx-rtd-theme >= 0.1.7
• IPython >= 3.1
• pandoc (not a python package)
Conda
Settings up a development environment in Siphon is as easy as (from the base of the repository):
conda env create
conda develop -n devel .
The environment.yml contains all of the configuration needed to easily set up the environment, called devel.
The second line sets up conda to run directly out of the git repository.
28
Chapter 1. Documentation
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
1.4.2 Making Changes
The changes to the Siphon source (and documentation) should be made via GitHub pull requests against master,
even for those with administration rights. While it’s tempting to make changes directly to master and push them up,
it is better to make a pull request so that others can give feedback. If nothing else, this gives a chance for the automated
tests to run on the PR. This can eliminate “brown paper bag” moments with buggy commits on the master branch.
During the Pull Request process, before the final merge, it’s a good idea to rebase the branch and squash together
smaller commits. It’s not necessary to flatten the entire branch, but it can be nice to eliminate small fixes and get the
merge down to logically arranged commit. This can also be used to hide sins from history–this is the only chance,
since once it hits master, it’s there forever!
1.4.3 Versioning
To manage identifying the version of the code, Siphon relies upon versioneer. versioneer takes the current version of the source from git tags and any additional commits. For development, the version will have a string like
0.1.1+76.g136e37b.dirty, which comes from git describe. This version means that the current code is
76 commits past the 0.1.1 tag, on git hash 136e37b, with local changes on top (indicated by dirty). For a release,
or non-git repo source dir, the version will just come from the most recent tag (i.e. v0.1.1).
To make a new version, simply add a new tag with a name like vMajor.Minor.Bugfix and push to GitHub.
Github will add a new release with a source archive.zip file. Running
python setup.py sdist
will build a new source distribution with the appropriately generated version file as well. This will also create a new
stable set of documentation.
versioneer is installed in the base of the repository. To update, install the latest copy using pip install
versioneer. Then recreate the _version.py file using:
python setup.py versioneer
1.4.4 Testing
Unit tests are the lifeblood of the project, as it ensures that we can continue to add and change the code and stay
confident that things have not broken. Running the tests requires pytest, which is easily available through conda
or pip. Running the tests can be done via either:
python setup.py test
or
py.test
Using py.test also gives you the option of passing a path to the directory with tests to run, which can speed running
only the tests of interest when doing development. For instance, to only run the tests in the siphon/cdmr directory,
use:
py.test siphon/cdmr
1.4.5 Code Style
Siphon uses the Python code style outlined in PEP8. For better or worse, this is what the majority of the Python world
uses. The one deviation is that line length limit is 95 characters. 80 is a good target, but some times longer lines are
1.4. Developer’s Guide
29
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
needed.
While the authors are no fans of blind adherence to style and so-called project “clean-ups” that go through and correct
code style, Siphon has adopted this style from the outset. Therefore, it makes sense to enforce this style as code is
added to keep everything clean and uniform. To this end, part of the automated testing for Siphon checks style. To
check style locally within the source directory you can use the flake8 tool. Running it from the root of the source
directory is as easy as:
flake8 siphon
1.4.6 Documentation
Siphon’s documentation is built using sphinx >= 1.3. API documentation is automatically generated from
docstrings, written using the NumPy docstring standard. There are also example IPython notebooks in the
examples/notebooks directory. Using IPython’s API, these are automatically converted to restructured text
for inclusion in the documentation. The examples can also be converted to standalone scripts using:
python setup.py examples
The documentation is hosted by Read the Docs. The docs are built automatically from master as well as for
the tagged versions on github. master is used for the latest documentation, and the latest tagged version is
used for the stable documentation. To see what the docs will look like on RTD, you also need to install the
sphinx-rtd-theme package.
1.4.7 Other Tools
Continuous integration is performed by Travis CI. This service runs the unit tests on all support versions, as well as
runs against the minimum package versions. flake8 is also run against the code to check formatting. Travis is also
used to build the documentation and to run the examples to ensure they stay working.
Test coverage is monitored by Coveralls.io.
Landscape.io is used to track code quality using the prospector tool.
1.4.8 Releasing
To create a new release:
1. Go to the GitHub page and make a new release. The tag should be a sensible version number, like v1.0.0. Add
a name (can just be the version) and add some notes on what the big changes are.
2. Do a pull locally to grab the new tag. This will ensure that versioneer will give you the proper version.
3. (optional) Perform a git clean -f -x -d from the root of the repository. This will delete everything not
tracked by git, but will also ensure clean source distribution. MANIFEST.in is set to include/exclude mostly
correctly, but could miss some things.
4. Run python setup.py sdist bdist_wheel (this requires wheel is installed).
5. Upload using twine: twine upload dist/*, assuming the dist/ directory contains only files for this
release. This upload process will include any changes to the README as well as any updated flags from
setup.py.
6. Tagging a new version on GitHub should also update the stable docs on Read the Docs.
30
Chapter 1. Documentation
CHAPTER 2
Contact Us
• For questions and discussion about Siphon, join Unidata’s python-users mailing list
• The source code is available on GitHub
• Bug reports and feature requests should be directed to the GitHub issue tracker
31
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
32
Chapter 2. Contact Us
CHAPTER 3
Other Resources
• The materials for Unidata’s annual Python training workshop includes some tutorials on using Siphon.
33
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
34
Chapter 3. Other Resources
CHAPTER 4
License
Siphon is available under the terms of the open source MIT license.
35
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
36
Chapter 4. License
CHAPTER 5
Related Projects
• netCDF4-python is the officially blessed Python API for netCDF
• metpy is toolkit for using Python in meteorology applications
37
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
38
Chapter 5. Related Projects
Python Module Index
s
siphon.catalog, 4
siphon.http_util, 8
siphon.metadata, 6
siphon.ncss, 12
siphon.ncss_dataset, 7
siphon.radarserver, 15
39
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
40
Python Module Index
Index
Symbols
coordinate_transforms (siphon.ncss_dataset.NCSSDataset
attribute), 7
__getnewargs__() (siphon.radarserver.Station method),
create_http_session()
(in module siphon.http_util), 11
16
__getstate__() (siphon.radarserver.Station method), 16
D
__init__() (siphon.catalog.CatalogRef method), 4
__init__() (siphon.catalog.CompoundService method), 4 DataQuery (class in siphon.http_util), 8
Dataset (class in siphon.catalog), 4
__init__() (siphon.catalog.Dataset method), 5
datasets (siphon.catalog.TDSCatalog attribute), 6
__init__() (siphon.catalog.SimpleService method), 5
default_unit_handler() (in module siphon.ncss), 15
__init__() (siphon.catalog.TDSCatalog method), 6
__init__()
(siphon.metadata.TDSCatalogMetadata
E
method), 6
__init__() (siphon.ncss_dataset.NCSSDataset method), 8 elevation (siphon.radarserver.Station attribute), 17
__init__() (siphon.radarserver.RadarServer method), 15
__iter__() (siphon.http_util.DataQuery method), 8
F
__repr__() (siphon.http_util.DataQuery method), 8
follow() (siphon.catalog.CatalogRef method), 4
__repr__() (siphon.radarserver.Station method), 16
__str__() (siphon.http_util.DataQuery method), 8
G
get() (siphon.http_util.HTTPEndPoint method), 10
get_catalog() (siphon.radarserver.RadarServer method),
accept() (siphon.ncss.NCSSQuery method), 13
16
accept_list (siphon.ncss_dataset.NCSSDataset attribute), get_catalog_raw()
(siphon.radarserver.RadarServer
7
method), 16
access_urls (siphon.catalog.Dataset attribute), 5
get_data() (siphon.ncss.NCSS method), 12
access_urls (siphon.catalog.SimpleService attribute), 5
get_data_raw() (siphon.ncss.NCSS method), 13
add_lonlat() (siphon.ncss.NCSSQuery method), 14
get_latest_access_url() (in module siphon.catalog), 6
add_query_parameter()
(siphon.http_util.DataQuery get_path() (siphon.http_util.HTTPEndPoint method), 10
method), 8
get_query() (siphon.http_util.HTTPEndPoint method), 11
all_times() (siphon.http_util.DataQuery method), 8
get_radarserver_datasets()
(in
module
axes (siphon.ncss_dataset.NCSSDataset attribute), 7
siphon.radarserver), 17
gridsets (siphon.ncss_dataset.NCSSDataset attribute), 7
A
B
BadQueryError, 8
base_tds_url (siphon.catalog.TDSCatalog attribute), 6
C
catalog_refs (siphon.catalog.TDSCatalog attribute), 6
catalog_url (siphon.catalog.TDSCatalog attribute), 6
CatalogRef (class in siphon.catalog), 4
combine_dicts() (in module siphon.ncss), 15
CompoundService (class in siphon.catalog), 4
H
href (siphon.catalog.CatalogRef attribute), 4
HTTPEndPoint (class in siphon.http_util), 10
I
id (siphon.radarserver.Station attribute), 17
items() (siphon.http_util.DataQuery method), 8
41
Siphon Documentation, Release 0.4.0+0.g201423b.dirty
L
siphon.ncss_dataset (module), 7
lat_lon_box
(siphon.ncss_dataset.NCSSDataset
at- siphon.radarserver (module), 15
squish() (in module siphon.ncss), 15
tribute), 7
Station (class in siphon.radarserver), 16
latitude (siphon.radarserver.Station attribute), 17
stations (siphon.radarserver.RadarServer attribute), 15
longitude (siphon.radarserver.Station attribute), 17
stations() (siphon.radarserver.RadarQuery method), 15
lonlat_box() (siphon.http_util.DataQuery method), 9
strides() (siphon.ncss.NCSSQuery method), 14
lonlat_point() (siphon.http_util.DataQuery method), 9
M
T
make_access_urls() (siphon.catalog.Dataset method), 5
metadata (siphon.metadata.TDSCatalogMetadata attribute), 6
metadata (siphon.ncss.NCSS attribute), 12
metadata (siphon.radarserver.RadarServer attribute), 15
TDSCatalog (class in siphon.catalog), 6
TDSCatalogMetadata (class in siphon.metadata), 6
time() (siphon.http_util.DataQuery method), 9
time_range() (siphon.http_util.DataQuery method), 9
time_span (siphon.ncss_dataset.NCSSDataset attribute),
7
title (siphon.catalog.CatalogRef attribute), 4
N
name (siphon.catalog.CatalogRef attribute), 4
name (siphon.catalog.CompoundService attribute), 4
name (siphon.catalog.Dataset attribute), 5
name (siphon.catalog.SimpleService attribute), 5
name (siphon.radarserver.Station attribute), 17
NCSS (class in siphon.ncss), 12
NCSSDataset (class in siphon.ncss_dataset), 7
NCSSQuery (class in siphon.ncss), 13
U
P
V
parse_iso_date() (in module siphon.http_util), 12
parse_station_table() (in module siphon.radarserver), 17
parse_xml_station() (in module siphon.radarserver), 17
projection_box() (siphon.ncss.NCSSQuery method), 14
validate_query()
(siphon.http_util.HTTPEndPoint
method), 11
validate_query() (siphon.ncss.NCSS method), 13
validate_query()
(siphon.radarserver.RadarServer
method), 16
variables (siphon.ncss.NCSS attribute), 12
variables (siphon.ncss_dataset.NCSSDataset attribute), 7
variables (siphon.radarserver.RadarServer attribute), 15
variables() (siphon.http_util.DataQuery method), 10
vertical_level() (siphon.ncss.NCSSQuery method), 14
Q
query() (siphon.http_util.HTTPEndPoint method), 11
query() (siphon.ncss.NCSS method), 13
query() (siphon.radarserver.RadarServer method), 16
unit_handler (siphon.ncss.NCSS attribute), 12
unit_handler() (siphon.ncss.NCSS static method), 13
url_path (siphon.catalog.Dataset attribute), 5
url_path() (siphon.http_util.HTTPEndPoint method), 11
urlopen() (in module siphon.http_util), 12
UTC (class in siphon.http_util), 11
R
RadarQuery (class in siphon.radarserver), 15
RadarServer (class in siphon.radarserver), 15
resolve_url() (siphon.catalog.Dataset method), 5
ResponseRegistry (class in siphon.ncss), 15
S
service_type
(siphon.catalog.CompoundService
attribute), 4
service_type (siphon.catalog.SimpleService attribute), 5
services (siphon.catalog.CompoundService attribute), 4
services (siphon.catalog.TDSCatalog attribute), 6
SimpleService (class in siphon.catalog), 5
siphon.catalog (module), 4
siphon.http_util (module), 8
siphon.metadata (module), 6
siphon.ncss (module), 12
42
Index