Skip to content

Commit

Permalink
New utility file and function for generic, useful data reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliom authored and daf committed Oct 8, 2014
1 parent 73c8e30 commit 91807d3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pyoos/utils/dataorg.py
@@ -0,0 +1,14 @@

def flatten_element(p):
"""
Convenience function to return record-style time series representation
from elements ('p') members in station element.
member['standard'] is a standard_name parameter name, typically CF based.
Ideally, member['value'] should already be floating point value,
so it's ready to use.
Useful with most pyoos collectors.
"""
rd = {'time': p.time}
for member in p.members:
rd[member['standard']] = member['value']
return rd

0 comments on commit 91807d3

Please sign in to comment.