Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bin and gkernel documentation #347

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pyleoclim/utils/tsutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def simple_stats(y, axis=None):
def bin(x, y, bin_size=None, start=None, stop=None, evenly_spaced = True, statistic = 'mean', bins=None):
""" Bin the values

The behavior of bins, as defined either by start, stop and step or by the bins argument, is to have all bins
except the last one be half open. That is if bins are defined as bins = [1,2,3,4], bins will be [1,2), [2,3), [3,4].
This is the default behaviour of scipy.stats.binned_statistic (upon which this function is built).

Parameters
----------

Expand Down Expand Up @@ -187,6 +191,10 @@ def bin(x, y, bin_size=None, start=None, stop=None, evenly_spaced = True, statis
def gkernel(t,y, h = 3.0, step=None,start=None,stop=None, step_style = 'max', evenly_spaced=True, bins=None):
'''Coarsen time resolution using a Gaussian kernel

The behavior of bins, as defined either by start, stop and step (or step_style) or by the bins argument, is to have all bins
except the last one be half open. That is if bins are defined as bins = [1,2,3,4], bins will be [1,2), [2,3), [3,4].
This is the default behaviour of our binning functionality (upon which this function is based).

Parameters
----------
t : 1d array
Expand Down