module gwlocs

This module contains the object GwLocs

class acequia.gwlocs.GwLocs(filedir=None, pathlist=None, filetype=None, groups=None)

Manage multiple groundwater heads series from one well location

Parameters
  • filedir (str) – directory with source files

  • pathlist (list, optional) – list of sourcefile names (without path)

  • filetype (['.csv','.json'], optional) – source file type

  • groups (list, optional) – list of location names, sublists are allowed (see examples)

sourcetable()

return list of location and heads series names

gwseries(self, loc=None)

return list of GwSeries objects

Examples

Create GwLocs object:

>>>locs = GwLocs(filedir=<jsondir>)

Return table of locations and series:

>>>tbl = locs.loctable()

Return al series for location B16D0037:

>>>gws = GwLocs.gwseries(loc=’B16D0037’)

Return list of GwSeries objects for locations in list:

>>>names = [‘B16D0037’,’B27G0237’,[‘B28D1635’,’B28B1388’],’B28B1389’]

>>>for loc in GwLocs(filedir=<jsondir>,groups=names):

print(f’{names[i]} group size is {len(gws)}’)

Explicitly iterate over locations:

>>>locs = GwLocs(filedir=<jsondir>,groups=names)

>>>for i in range(len(locs)):

gws = next(locs)

print(f’{names[i]} group size is {len(gws)}’)

filetable()

Return table of source files for all series

gwseries(loc=None)

Return list of GwSeries objects with location name <loc>

Parameters

loc (str) – name of location

Returns

Return type

list of GwSeries objects

Notes

When parameter loc is a list of locations names, GwSeries objects for all these locations will be returned.