Stratigraphy functions

The package makes available functions relating to computing things based on stratigraphy.

The functions are defined in deltametrics.strat.

Compute stratigraphy routines

compute_boxy_stratigraphy_volume(elev, prop)

Process t-x-y data volume to boxy stratigraphy volume.

compute_boxy_stratigraphy_coordinates(elev)

Process t-x-y data volume to boxy stratigraphy coordinates.

Stratigraphy statistics functions

compute_trajectory()

Show 1d profile at point.

compute_compensation(line1, line2)

Compute compensation statistic betwen two lines.

Quick-stratigraphy attributes classes

The “quick” stratigraphy attributes provide a common API that is accessed by DataCube, DataSectionVariable and DataPlanformVariable methods. There are two methods of computing quick stratigraphy, with MeshStratigraphyAttributes as the default.

MeshStratigraphyAttributes(elev, **kwargs)

Attribute set for mesh stratigraphy information, emebdded into a DataCube.

BoxyStratigraphyAttributes()

Attribute set for boxy stratigraphy information, emebdded into a DataCube.

BaseStratigraphyAttributes(style)

Low-level stratigraphy utility functions

The functions outlined in this section are the main functions that do the actual work of computing stratigraphy and preservation, throughout DeltaMetrics. These functions may be useful if you are trying to use parts of DeltaMetrics, but need to customize something for your own use-case.

deltametrics.strat._compute_elevation_to_preservation(elev)

Compute the preserved elevations of stratigraphy.

Given elevation data alone, we can compute the preserved stratal surfaces. These surfaces depend on the timeseries of bed elevation at any spatial location. We determine preservation by marching backward in time, determining when was the most recent time that the bed elevation was equal to a given elevation.

This function is declared as private and not part of the public API, however some users may find it helpful. The function is heavily utlized internally. Function inputs and outputs are standard numpy ndarray, so that these functions can accept data from an arbitrary source.

Parameters

elev (ndarray or xr.core.dataarray.DataArray) – The t-x-y volume of elevation data to determine stratigraphy.

Returns

  • strata (ndarray) – A t-x-y ndarry of stratal surface elevations.

  • psvd (ndarray) – A t-x-y boolean ndarry of whether a (t,x,y) point of instantaneous time is preserved in any of the final stratal surfaces. To determine whether time from a given timestep is preserved, use psvd.nonzero()[0] - 1.

deltametrics.strat._compute_preservation_to_time_intervals(psvd)

Compute the preserved timesteps.

The output from _compute_elevation_to_preservation records whether an instance of time, defined exactly at the data interval, is recorded in the stratigraphy (here, “recorded” does not include stasis). This differs from determining which time-intervals are preserved in the stratigraphy, because the deposits reflect the conditions between the save intervals.

While this computation is simply an offset-by-one indexing (psvd[1:, ...]), the function is implemented explicitly and utilized internally for consistency.

Note

True in the preserved time-interval array does not necessarily indicate that an entire timestep was preserved, but rather that some portion of this time-interval (up to the entire interval) is recorded.

Parameters

psvd (ndarray) – Boolean ndarray indicating the preservation of instances of time. Time is expected to be the 0th axis.

Returns

psvd_intervals – Boolean ndarray indicating the preservation of time-intervals, including partial intervals.

Return type

ndarray

deltametrics.strat._compute_preservation_to_cube(strata, z)

Compute the cube-data coordinates to strata coordinates.

Given elevation preservation data (e.g., data from _compute_elevation_to_preservation), compute the coordinate mapping from t-x-y data to z-x-y preserved stratigraphy.

While stratigraphy is time-dependent, preservation at any spatial x-y location is independent of any other location. Thus, the computation is vectorized to sweep through all “stratigraphic columns” simultaneously. The operation works by beginning at the highest elevation of the stratigraphic volume, and sweeping down though all elevations with an x-y “plate”. The plate indicates whether sediments are preserved below the current iteration elevation, at each x-y location.

Once the iteration elevation is less than the strata surface at any x-y location, there will always be sediments preserved below it, at every elevation. We simply need to determine which time interval these sediments record. Then we store this time indicator into the sparse array.

So, in the end, coordinates in resultant boxy stratigraphy are linked to t-x-y coordinates in the data source, by building a mapping that can be utilized repeatedly from a single stratigraphy computation.

This function is declared as private and not part of the public API, however some users may find it helpful. The function is heavily utlized internally. Function inputs and outputs are standard numpy ndarray, so that these functions can accept data from an arbitrary source.

Parameters
  • strata (ndarray) – A t-x-y ndarry of stratal surface elevations. Can be computed by _compute_elevation_to_preservation.

  • z – Vertical coordinates of stratigraphy. Note that z does not need to have regular intervals.

Returns

  • strat_coords (ndarray) – An N x 3 array of z-x-y coordinates where information is preserved in the boxy stratigraphy. Rows in strat_coords correspond with rows in data_coords.

  • data_coords (ndarray) – An N x 3 array of t-x-y coordinates where information is to be extracted from the data array. Rows in data_coords correspond with rows in strat_coords.

deltametrics.strat._determine_strat_coordinates(elev, z=None, dz=None, nz=None)

Return a valid Z array for stratigraphy based on inputs.

This helper function enables support for user specified dz, nz, or z in many functions. The logic for determining how to handle these mutually exclusive inputs is placed in this function, to ensure consistent behavior across all classes/methods internally.

Note

At least one of the optional parameters must be supplied. Precedence when multiple arguments are supplied is z, dz, nz.

Parameters
  • elev (ndarray) – An up-to-three-dimensional array with timeseries of elevation values, where elevation is expected to along the zeroth axis.

  • z (ndarray, optional) – Array of Z values to use, returned unchanged if supplied.

  • dz (float, optional) – Interval in created Z array. Z array is created as np.arange(np.min(elev), np.max(elev)+dz, step=dz).

  • nz (int, optional) – Number of intervals in z. Z array is created as np.linspace(np.min(elev), np.max(elev), num=nz, endpoint=True).