Giter VIP home page Giter VIP logo

datatools's Introduction

datatools

A suite of tools for data processing, plotting, and exploration

gps_tools.py - Import GAMIT/GLOBK post-process GNSS station positions to python. Specifically for glaciological applications using the OnIce class that will preform coordinate transformations to along-flow/across-flow directions, calculate ice velocities, etc.

diurnal.py - Find minimuma and maxima extrema values for diurnally varying timeseries data.

DOI Archival, July 2022, for script assocaited with publication Mejia et al., 2022.

Features:

  • PredictExtrema: allows you to enter in a daterange of good data, the extrema picks during this timeperiod will be the center of windows when picking extrema for the entire timeseries.
  • Does not cut off picks for an arbitrary midnight value, using a 24-hour window that encompasses minimum and maximum picks.
  • Allows you to require either the minimua or maxima occur first.

melt_model.py - Read in automatic weather station data and prepare for the implements the enhanced-temperature index model by Pellicciotti et al., 2005.

  • Calculate daily albedo values during solar noon
  • Adjust incoming or reflected solar radiation data for repeated shadowing of sensors
  • Calculate hourly melt rates using the enhanced temperature-index model Future functionality: remove restrictions on input data (allow implementation as a function)
  • Script implementation example with figures (jupyter notebook) can be found here Mejia et al., 2021.

These scripts have been developed to aid in data analysis throughout my dissertation work studying how meltwater impacts the ice dyanmics of the Greenland Ice Sheet. The class DiurnalExtrema has specific inputs to customize and predict when diurnal extrema will occur so that noise in the timeseries data set has a minimial impact on extrema picks.

All scripts are actively being refined and improved. Updates will add functionality.

datatools's People

Contributors

jzmejia avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

datatools's Issues

datatools.constants is missing when importing gpstools.py

Hi Jess! when I import gpstools i get the error message that datatools.constants is missing on line 24. Its to import seconds_per_day,
I fixed this issue by commenting the line 24 in gpstools, but I don't know if this is going to affect other functions.

nonzero value error in _bool_is_same -> series inputs

Passing a series (empty) to is same. Need work around

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-39-6176c7133a7e> in <module>
      1 eorm_vel = c_rolling(c_rolling(eorm17.vel,'6H',min_periods=100)['2017-8-5':'2017-8-20'],'6H').dropna()
      2 
----> 3 eorm17_diurnal = DiurnalExtrema(eorm_vel,generate_figure=True)

~/WorkingDir/GrIS/X_PYTHON-CODES/datatools/diurnal.py in __init__(self, timeseries, minfirst, maxnextday, predictTiming, window, threshold, generate_figure, stn, **kwargs)
    161         self.diurnal_vals = []
    162 
--> 163         self.df = self.find_diurnal_extrema()
    164         if self.generate_figure:
    165             self.plot()

~/WorkingDir/GrIS/X_PYTHON-CODES/datatools/diurnal.py in find_diurnal_extrema(self)
    227             else:
    228                 # find diurnal minimum
--> 229                 minVal, minTime = self.get_real_extrema(
    230                     self.timeseries, day, 'min')
    231                 if self.minfirst and self.maxnextday:

~/WorkingDir/GrIS/X_PYTHON-CODES/datatools/diurnal.py in get_real_extrema(self, ts, window, min_or_max)
    374             extremaTuple = self.get_extrema(
    375                 ts[window[0]:window[1]], min_or_max)
--> 376             if not on_boundary(ts, window, extremaTuple, min_or_max):
    377                 extremaTuple = (None, None)
    378         return extremaTuple

~/WorkingDir/GrIS/X_PYTHON-CODES/datatools/diurnal.py in on_boundary(timeseries, window, extrema_tuple, val_type)
    525                 bound = get_index_of_bound(
    526                     timeseries, window, start_or_end[idx])
--> 527             if _bool_is_same(bound, extrema_time):
    528                 boundary_ok = bool_check_around_bound(timeseries, bound,
    529                                                       extrema_tuple, val_type)

~/WorkingDir/GrIS/X_PYTHON-CODES/datatools/diurnal.py in _bool_is_same(val1, val2)
    417 
    418 def _bool_is_same(val1, val2):
--> 419     return True if val1 == val2 else False
    420 
    421 

~/WorkingDir/GrIS/X_PYTHON-CODES/move/lib/python3.8/site-packages/pandas/core/generic.py in __nonzero__(self)
   1327 
   1328     def __nonzero__(self):
-> 1329         raise ValueError(
   1330             f"The truth value of a {type(self).__name__} is ambiguous. "
   1331             "Use a.empty, a.bool(), a.item(), a.any() or a.all()."

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

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.