pyrolite.util.time

pyrolite.util.time.listify(df, axis=1)[source]

Consdense text information across columns into a single list.

Parameters
  • df (pandas.DataFrame) – Dataframe (or slice of dataframe) to condense along axis.

  • axis (int) – Axis to condense along.

pyrolite.util.time.age_name(agenamelist, prefixes=['Lower', 'Middle', 'Upper'], suffixes=['Stage', 'Series'])[source]

Condenses an agename list to a specific agename, given a subset of ambiguous_names.

Parameters
  • agenamelist (list) – List of name components (i.e. [Eon, Era, Period, Epoch])

  • prefixes (list) – Name components which occur prior to the higher order classification (e.g. "Upper Triassic").

  • suffixes (list) – Name components which occur after the higher order classification (e.g. "Cambrian Series 2").

pyrolite.util.time.import_colors(filename=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/pyrolite/checkouts/main/pyrolite/data/timescale/timecolors.csv'), delim='/')[source]

Import a list of timescale names with associated colors.

pyrolite.util.time.timescale_reference_frame(filename=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/pyrolite/checkouts/main/pyrolite/data/timescale/geotimescale_202210.csv'), info_cols=['Start', 'End', 'Aliases'], color_info=None)[source]

Rearrange the text-based timescale dataframe. Utility function for timescale class.

Parameters
  • filename (str | pathlib.Path) – File from which to generate the timescale information.

  • info_cols (list) – List of columns beyond hierarchial group labels (e.g. Eon, Era..).

Returns

Dataframe containing timescale information.

Return type

pandas.DataFrame

class pyrolite.util.time.Timescale(filename=None)[source]
build()[source]

Build the timescale from data within file.

text2age(entry, nulls=[None, 'None', 'none', nan, 'NaN'])[source]

Converts a text-based age to the corresponding age range (in Ma).

String-based entries return (max_age, min_age). Collection-based entries return a list of tuples.

Parameters

entry (str) – String name, or series of string names, for geological age range.

Returns

Tuple or list of tuples.

Return type

tuple | list (tuple)

named_age(age, level='Specific', **kwargs)[source]

Converts a numeric age (in Ma) to named age at a specific level.

Parameters
  • age (float) – Numeric age in Ma.

  • level (str, {'Eon', 'Era', 'Period', 'Superepoch', 'Epoch', 'Age', 'Specific'}) – Level of specificity.

Returns

String representation for the entry.

Return type

str