Datetime parameters for Get_values request

23 views
Skip to first unread message

Cuyler Frisby

unread,
Aug 8, 2013, 7:24:39 PM8/8/13
to ul...@googlegroups.com
In the Ulmo online documentation (http://ulmo.readthedocs.org/en/latest/api.html#module-ulmo.cuahsi.his_central), it says that the get_values request takes start date and end date as parameters. However, when implementing this, I receive an error which states that the get_values function only takes 3 parameters (wsdl_url, site_code, variable_code).  Is this documentation out of date? Will the ability to search using datetime parameters be returned to ulmo?

Thanks,

Cuyler Frisby

Dharhas Pothina

unread,
Aug 9, 2013, 1:37:28 PM8/9/13
to ul...@googlegroups.com

---
not sure why but this went directly to Cuyler rather than the mailing list when I hit reply.... forwarding to list.
---


Hi Cuyler,

In general it will help if you also email a snippet of code you tried that didn't work. In this case I suspect you didn't specify start and end dates properly.

if you look at the documentation you have: ulmo.cuahsi.wof.get_values(wsdl_url, site_code, variable_code=None, start=None, end=None)

This means that wsdl_url and site_code are required variables that have to be specified in that order. The other three are 'named' variables which can either be specified in that exact order OR as is the more standard case you use their names and then the order doesn't matter. The None values in the description above are the default values used if you do not specify those parameters.

i.e

data = ulmo.cuahsi.wof.get_values("http://river.sdsc.edu/wateroneflow/NWIS/DailyValues.asmx?WSDL", "NWISDV:08158000", "NWISDV:00060/DataType=Average", "01/01/2000", "12/31/2000")

or

data = ulmo.cuahsi.wof.get_values("http://river.sdsc.edu/wateroneflow/NWIS/DailyValues.asmx?WSDL", "NWISDV:08158000", variable_code="NWISDV:00060/DataType=Average", start="01/01/2000", end="12/31/2000")

look like we do have a bug though since variable_code is listed as an optional parameter but if you don't specify it you get an error. I'll add that to the github issues as a bug report.

btw the above is just an example, if you are getting USGS NWIS data it is better to use the ulmo.nwis module that hits the USGS directly rather than the CUAHSI WOF services that are reflected through CUAHSI servers. The ulmo.nwis module has a few more features that are useful when dealing with NWIS data.

- dharhas






--
You received this message because you are subscribed to the Google Groups "ulmo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ulmo+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


mayorga

unread,
Aug 12, 2013, 11:02:55 AM8/12/13
to ul...@googlegroups.com
Hi Cuyler,

Are you using a very recent version of ulmo (0.6 or higher)? The start and end date arguments were added to the his_central wof get_values request in version 0.6 a few weeks ago. The online doc is up to date.

Cheers,
-Emilio

Cuyler Frisby

unread,
Aug 12, 2013, 1:28:05 PM8/12/13
to ul...@googlegroups.com
I updated ulmo to the most recent version and everything is working for me now. Thanks!

Cuyler


--
You received this message because you are subscribed to the Google Groups "ulmo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ulmo+uns...@googlegroups.com.
To post to this group, send email to ul...@googlegroups.com.
Visit this group at http://groups.google.com/group/ulmo.
Reply all
Reply to author
Forward
0 new messages