deltametrics.plan.compute_surface_deposit_time

deltametrics.plan.compute_surface_deposit_time(data, surface_idx=-1, **kwargs)

Compute the time of last deposition for a single time.

This method computes the timing of last deposition for each location for a given time_index. This is done by finding the last time the bed elevation was outside of a “stasis tolerance” length scale at each location. Therefore, the function requires the spacetime dataset of bed elevation, at a minimum, up to the point in time of interest.

Warning

only works for indices (not times) as implemented.

Parameters:
  • data (DataCube, ndarray, DataArray) – Input data to compute the surface deposit time from. Must be DataCube or a array-like (ndarray or DataArray) containing bed elevation history, at a minimum, up until the time of interest.

  • surface_idx (int) – The index along the time dimension of the array (dim0) to compute the surface deposit time for. This number cannot be greater than data.shape[0].

  • **kwargs – Keyword arguments passed to supporting function _compute_surface_deposit_time_from_etas. Hint: you may want to control the stasis_tol parameter.

Returns:

sfc_time – The time of the surface.

Return type:

ndarray

Examples

golf = dm.sample_data.golf()
sfc_time = dm.plan.compute_surface_deposit_time(golf, surface_idx=-1)

fig, ax = plt.subplots()
im = ax.imshow(sfc_time)
dm.plot.append_colorbar(im, ax=ax)
plt.show()

(png, hires.png)

../_images/deltametrics-plan-compute_surface_deposit_time-1.png

The keyword argument stasis_tol is an important control on the resultant calculation.

fig, ax = plt.subplots(1, 3, figsize=(10, 3))
for i, tol in enumerate([1e-16, 0.01, 0.1]):
    i_sfc_date = dm.plan.compute_surface_deposit_time(
        golf, surface_idx=-1, stasis_tol=tol)
    im = ax[i].imshow(i_sfc_date)
    plt.colorbar(im, ax=ax[i], shrink=0.4)
    ax[i].set_title(f'stasis_tol={tol}')
plt.show()

(png, hires.png)

../_images/deltametrics-plan-compute_surface_deposit_time-2.png