filter() vs collect() parameters

7 views
Skip to first unread message

dan

unread,
Feb 5, 2014, 11:02:20 AM2/5/14
to py...@googlegroups.com
I am trying to document the various kwargs that filter() and collect() can use and have a question about the 'features' parameter for filter().
At first glance, I thought it was to specify the station(s) of interest, however Emilio pointed out that the collect() call requires the 'offerings' parameter.

I seem to be able to issue a collect(offerings=['somestation']) call where the filter() does not use 'features' and I receive the correct data based on the other filter parameters.

What is 'features' parameter used for?


dan

unread,
Feb 5, 2014, 11:12:20 AM2/5/14
to py...@googlegroups.com
I've started some basic documentation for the IoosSweSos object here: https://github.com/asascience-open/pyoos/wiki/IoosSweSos-first-pass-documentation

More than likely some errors, I've just been rooting around in the code trying to piece this together,

Kyle Wilcox

unread,
Feb 5, 2014, 11:18:50 AM2/5/14
to dan, py...@googlegroups.com
Yes these collectors need more documentation, thanks for digging in.

See the code for setting the features:

The Collector is a generic class that supports all data sources.  Every single source has to fit into it (think outside of SOS).  For SOS, a "feature" is a procedure.  See the code here:

For other collectors, a "feature" is a unique identifier.  See the USGS collector that uses the "features" as the station ids for its service:


An SOS offering can not be abstracted out to the Collector class.  It is unique to SOS type collectors.  You can see here the offering should be passed into the collect() function as a name argument: https://github.com/asascience-open/pyoos/blob/master/pyoos/collectors/ioos/swe_sos.py#L60


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

Dave Foster

unread,
Feb 5, 2014, 11:37:45 AM2/5/14
to Kyle Wilcox, dan, py...@googlegroups.com

IMO the offering bit is a bit hidden/clunky - if you forget to set it, you just get some blank assertion text way down in OWSLib.  I think the IoosSosSwe.collect method should either assert there about needing to set it (also providing the known offerings in the text) or maybe just log.warn and use a default, like network-all, or whatever's first.

This is the correct location as it's required by SOS and no other collectors.

Emilio Mayorga

unread,
Feb 5, 2014, 3:24:27 PM2/5/14
to Dave Foster, Kyle Wilcox, dan, py...@googlegroups.com
Dan: thanks for starting that github doc. That's great!

Kyle: thanks for those details. Very useful.

Dave: I totally agree with you; the fact that offering is required for the SOS collector is hard to figure out, unless you go through the body of the code.

Cheers,
-Emilio
Reply all
Reply to author
Forward
0 new messages