Coder Social home page Coder Social logo

utah-geological-survey / wellapplication Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 8.0 3.75 MB

Tools used to manipulate hydrograph data; Solinst xles to pandas dataframe; hydrograph analysis; hydrology; Gannt Charts; Piper diagrams; hydrogeology; wells; groundwater; USGS data; WQP data;

License: MIT License

Python 100.00%
usgs usgs-data groundwater pandas water transducers pandas-dataframe xle hydrology hydrogeology

wellapplication's People

Contributors

inkenbrandt avatar kinverarity1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wellapplication's Issues

Python 3 compatibility

Python 3 should work with all modules except Transpose. Working on fixing xml parsing errors with xmltodict

restructure usgs.py into classes

Make this set of functions more modular. Break apart functions into smaller pieces. Try to follow some of the structure laid out for MesoPy to better build rest requests and better handle http errors.

piper is jacked

Center plot of piper plot not showing proper distribution of points. Some issue in how ion combos are calculated.

wa.avgMeths.projx error

wa.avgMeths.projx

_proj.pyx in _proj.Proj.__cinit__ (_proj.c:1190)()

RuntimeError: ('Invalid argument', u'occurred at index 0')

42     inProj = Proj(init='epsg:4326') #WGS84

remove requests dependency

Current usgs scripts require request library.

The calls are simple and can be replaced with urllib, a standard library in python.

See this part of the usgs.py file for an example.

import urllib
params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
print f.read()

This task will also require use of the standard json library.

`dateTime` heading error in usgs nwis class

---------------------------------------------------------------------------`
KeyError                                  Traceback (most recent call last)

<ipython-input-5-1abfc7093eba> in plotfits(HUC, SITE, fileloc)
     28 
     29     # Grab USGS data for comparison
---> 30     nw = wa.nwis('dv',SITE,'sites', startDT='2003-01-01')
     31     data = nw.data
     32     Label = nw.sites.station_nm[0].title()

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\wellapplication\usgs.pyc in __init__(self, service, values, loc_type, **kwargs)
     48         self.end_date = str(datetime.today().year) + '-' + str(datetime.today().month).zfill(2) + '-' + str(
     49             datetime.today().day).zfill(2)
---> 50         self.sites, self.data = self.get_nwis(**kwargs)
     51 
     52     @staticmethod

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\wellapplication\usgs.pyc in get_nwis(self, **kwargs)
    126 
    127             df = pd.DataFrame(dt[i]['values'][0]['value'])
--> 128             df.index = pd.to_datetime(df.pop('dateTime'))
    129             df.value = df.value.astype(float)
    130             df.index.name = 'datetime'

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\pandas\core\generic.pyc in pop(self, item)
    523         Return item and drop from frame. Raise KeyError if not found.
    524         """
--> 525         result = self[item]
    526         del self[item]
    527         try:

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\pandas\core\frame.pyc in __getitem__(self, key)
   2057             return self._getitem_multilevel(key)
   2058         else:
-> 2059             return self._getitem_column(key)
   2060 
   2061     def _getitem_column(self, key):

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\pandas\core\frame.pyc in _getitem_column(self, key)
   2064         # get column
   2065         if self.columns.is_unique:
-> 2066             return self._get_item_cache(key)
   2067 
   2068         # duplicate columns & possible reduce dimensionality

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\pandas\core\generic.pyc in _get_item_cache(self, item)
   1384         res = cache.get(item)
   1385         if res is None:
-> 1386             values = self._data.get(item)
   1387             res = self._box_item_values(item, values)
   1388             cache[item] = res

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\pandas\core\internals.pyc in get(self, item, fastpath)
   3539 
   3540             if not isnull(item):
-> 3541                 loc = self.items.get_loc(item)
   3542             else:
   3543                 indexer = np.arange(len(self.items))[isnull(self.items)]

c:\users\paulinkenbrandt\documents\github\env\lib\site-packages\pandas\indexes\base.pyc in get_loc(self, key, method, tolerance)
   2134                 return self._engine.get_loc(key)
   2135             except KeyError:
-> 2136                 return self._engine.get_loc(self._maybe_cast_indexer(key))
   2137 
   2138         indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:4443)()

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:4289)()

pandas\src\hashtable_class_helper.pxi in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:13733)()

pandas\src\hashtable_class_helper.pxi in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:13687)()

KeyError: 'dateTime'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.