on_common_axis (pyleoclim.utils.tsutils.on_common_axis)
- pyleoclim.utils.tsutils.on_common_axis(x1, y1, x2, y2, method='interpolation', step=None, start=None, stop=None)[source]
Places two timeseries on a common axis
Note this function assumes that the time representation and units are the same (e.g., BP vs CE)
- Parameters
x1 (array) – x-axis values of the first timeseries
y1 (array) – y-axis values of the first timeseries
x2 (array) – x-axis values of the second timeseries
y2 (array) – y-axis values of the second timeseries
method (str) – Which method to use to get the timeseries on the same x axis. Valid entries: ‘interpolation’ (default, linear interpolation), ‘bin’, ‘None’. ‘None’ only cuts the timeseries to the common period but does not attempt to generate a common time axis
step (float) – The interpolation step. Default is mean resolution of lowest resolution series
start (float) – where/when to start. Default is the maximum of the minima of the two timeseries
stop (float) – Where/when to stop. Default is the minimum of the maxima of the two timeseries
- Returns
xi1, xi2 (array) – The interpolated x-axis
interp_values1, interp_values2 (array) – the interpolated y-values