pybacktrack.SeaLevel
- class pybacktrack.SeaLevel(sea_level_filename)
Class to calculate integrated sea levels (relative to present day) over a time period.
- __init__(sea_level_filename)
Load sea level curve (linear segments) from file.
- Parameters:
sea_level_filename (str) – Text file with first column containing ages (Ma) and a corresponding second column of sea levels (m).
Methods
__init__(sea_level_filename)Load sea level curve (linear segments) from file.
create_from_bundled_model(sea_level_model_name)Create a SeaLevel instance from a bundled sea level model name.
Create a SeaLevel instance from a user-provided model or from a bundled model.
get_average_level(begin_time, end_time)Return the average sea level over the specified time period.
- static create_from_bundled_model(sea_level_model_name)
Create a SeaLevel instance from a bundled sea level model name.
- Parameters:
sea_level_model_name (string) – Name of a bundled sea level model. Bundled sea level models include
Miller2024_SealevelCurve,Haq2024_Hybrid_SealevelCurve,Haq2024_Hybrid_SealevelCurve_Longterm,Haq87_SealevelCurveandHaq87_SealevelCurve_Longterm.- Returns:
The bundled sea level model.
- Return type:
- Raises:
ValueError – If
sea_level_model_nameis not the name of a bundled sea level model.
Notes
Added in version 1.2.
- static create_from_model_or_bundled_model_name(sea_level_model_or_bundled_model_name)
Create a SeaLevel instance from a user-provided model or from a bundled model.
- Parameters:
sea_level_model_or_bundled_model_name (string) – Either a user-provided model specified as a text filename containing sea level curve (see
pybacktrack.SeaLevel.__init__()), or name of a bundled model (seepybacktrack.SeaLevel.create_from_bundled_model()), .- Returns:
The sea level model loaded from a user-provided model or from a bundled model.
- Return type:
Notes
Added in version 1.4.
- get_average_level(begin_time, end_time)
Return the average sea level over the specified time period.
- Parameters:
begin_time (float) – The begin time (in Ma). Should be larger than (or equal to)
end_time.end_time (float) – The end time (in Ma). Should be smaller than (or equal to)
begin_time.
- Returns:
Average sea level (in metres).
- Return type:
float
- Raises:
ValueError – If
end_timeis larger thanbegin_time.
Notes
The average sea level is obtained by integrating sea level curve over the specified time period and then dividing by time period.
However, if
begin_timeandend_timeare equal then this just returns the interpolated sea level at that time (clamped to the nearest boundary if that time is outside the time range of the sea level model).Changed in version 1.5: No longer returns zero when
begin_timeequalsend_time.