asascience-open/pyoos — pull request #1 by CowanSM (2013-02-19 20:47:44+00:00)
Title: NERRS Functionality

Can create a Station object from nerrs by doing the following:

```
from pyoos.collectors.nerrs import NerrsWSDL

nerrs = NerrsWSDL()
station = nerrs.get_station(station_code, **kwargs)
```
Known kwargs:
```
site_id: the site id (id) of a station; basically a collection of stations - this may speed up request time as it limits the amount of info returned from NERRS
min_date: earliest date to query
max_date: latest date to query
observed_property: if you want only a specific measurement (like 'Temp')
test: boolean indicating whether or not the function should use local files instead of querying from url
```

To get a list of station_codes (uid for a station), you can do the following:
```
nerrs = NerrsWSDL()
list_of_stations = nerrs.get_metadata()

for st in list_of_stations:
print st.code
```

Most NERRS functions have 'test' as an optional argument, this will mean that the function will try to read from a local file as opposed to going to the NERRS wsdl source. Local files are written when the DEBUG flag in nerrs.py is set to True and 'test' is not sent (or sent False) to the function. After an initial run of each function, with DEBUG set to True, then subsequent calls to the same function (with the same arguments) with 'test' set to True should allow the functions to read from the local files. If 'test' is set to True and needed local files do not exist (either because DEBUG is False or no initial run was made), the functions will fail.