Package: pyoos
Note: Pyoos is very much a work in progress and should considered
experimental until a 1.0 release is made!Pyoos attempts to fill the need for a high level data collection library
for met/ocean data publically available through many different websites
and webservices.Pyoos will collect and parse the following data services into thePaeganDiscrete Geometry CDM:IOOS SWE SOS 1.0 Servicesex.NcSOSinstance:sos.maracoos.org/stable/sos/wflow700-agg.ncmlex.IOOS 52Ninstance:ioossos.axiomalaska.com/52n-sos-ioos-stableNERRS Observations - SOAPNDBC Observations - SOSCO-OPS Observations - SOSSTORET Water Quality - WqxOutbound via REST (waterqualitydata.us)USGS NWIS Water Quality - WqxOutbound via REST (waterqualitydata.us)USGS Instantaneous Values - WaterML via RESTNWS AWC Observations - XML via REST (http://www.aviationweather.gov)HADS (http://www.nws.noaa.gov/oh/hads/- limited to 7 day rolling
window of data)Common InterfaceFiltering dataGeoFilter by bbox# (minx, miny, maxx, maxy)collector.filter(bbox=(-74,30,-70,38))TimeFilter from a datetime (the ‘start’ parameter)fromdateimeimportdateime,timedeltacollector.filter(start=datetime.utcnow()-timedelta(hours=1))Filter until a datetime (the ‘end’ parameter)fromdateimeimportdateimecollector.filter(end=datetime.utcnow())Filter a datetime range (both ‘start’ and ‘end’ parameters)fromdateimeimportdateime,timedeltacollector.filter(start=datetime.utcnow-timedelta(hours=24),end=datetime.utcnow())Feature(s)It is highly dependent on the data provider how they identify unique
features/stations/objects.
Pyoos does its best job to figure out what you are passing in. For
example,
you may pass WMO ID’s to the NDBC collector and Pyoos will request the
correct complete URN to the NDBC SOS.Retrieve a list of unique features available to filtercollector.list_features()Filter by unique feature# Any iterable of stringscollector.filter(features=["21KY-BSW004"])Variable(s)Pyoos does its best job to format any string into the correct format
for the actual request. For example,
you may pass typical standard_name string from CF-1.6 to the NDBC
collector and Pyoos will turn it into a complete MMI URI.Retreive a list of unique variables available to filtercollector.list_variables()Filter by variable name# Any iterable of stringscollector.filter(variables=["sea_water_temperature"])Clear active filterscollector.clear()Filter ChainingYou may chain manyfiltercalls together (it returns a collector
object)collection.filter(bbox=(-74,30,-70,38)).filter(end=datetime.utcnow())You may also combine many filter types into one call tofiltercollection.filter(bbox=(-74,30,-70,38),end=datetime.utcnow())Get DataAs Paegan CDM objectscollector.collect()As raw response from providercollector.raw()Specific functionalityEach collector may implement a set of functions specific to that
collection. Please see the Wiki for an explanation of this type of
functionality.SetupYou are usingvirtualenv, right?Installvirtualenv-burritoCreate virtualenv named “pyoos-dev”:mkvirtualenv-pyour_python_binarypyoos-devStart using your new virtualenv:workonpyoos-devInstallationPyoos requires python 2.7.x and is available on PyPI.The best way to install Pyoos is through pip:pipinstallpyoosPyoos requires the following python libraries which will be downloaded
and installed throughpip:Paegan>=0.9.9numpy>=1.7.0scipynetCDF4>=1.0.2Shapely>=1.2.15pytzpython-dateutil>=1.5OWSLib (install from git withpip installgit+http://github.com/geopython/OWSLib.git)requestsFiona==0.16.1beautifulsoup4==4.2.1lxml>=3.2.0If your NetCDF4 and HDF5 libraries are in non-typical locations, you
will need to pass the locations to thepipcommand:NETCDF4_DIR=pathHDF5_DIR=pathpipinstallpyoosThere seems to be a problem installing numpy throughpipdependency
chains so you may need to install numpy before doing any of the above:pipinstallnumpy==1.7.0RoadmapDevelopment of a standardized Metadata concept, possibly through
SensorML and/or ISO 19115-2Use CasesSubmit a PR with your use case!TroubleshootingThere is a Google Groups mailing list for pyoos:https://groups.google.com/forum/#!forum/pyoosIf you are having trouble getting any of the pyoos functionality to
work, try running the tests:gitclonegit@github.com:asascience-open/pyoos.gitcdpyoospythonsetup.pytestContributorsKyle Wilcoxkyle@axiomdatascience.comSean Cowanscowan@asascience.comAlex Crosbyacrosby@asascience.comDave Fosterdave@axiomdatascience.comFilipe Pires Alvarenga Fernandesocefpaf@gmail.comCopyright and licenceCopyright (C) 2012-2016 RPS ASAThis file is part of Pyoos.Pyoos is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or
(at your option) any later version.Pyoos is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.You should have received a copy of the GNU Lesser General Public
License
along with Pyoos. If not, seehttp://www.gnu.org/licenses/.