pybacktrack.convert_stratigraphic_depth_to_age_files

pybacktrack.convert_stratigraphic_depth_to_age_files(input_filename, output_filename, depth_to_age_model, reverse_output_columns=False)

Converts stratigraphic depth to age by reading depth rows (in first column) from input file and writing rows containing both age and depth to output file.

Parameters:
  • input_filename (string) – Name of input text file containing the depth values. A single depth value is obtained from each row by indexing the first column.

  • output_filename (string) – Name of output text file containing age and depth values. Each row of output file contains an age value and its associated depth value (with order depending on reverse_output_columns).

  • depth_to_age_model (function) – The model to use when converting stratigraphic depth to age. A callable function accepting a single non-negative depth parameter (in metres), and returning age (in Ma) or None to exclude from output.

  • reverse_output_columns (bool, optional) – Determines order of age and depth columns in output file. If True then output depth age, otherwise output age depth.

Raises:
  • ValueError – If cannot read depth value, as a floating-point number, from input file in the first column.

  • ValueError – If stratigraphic depths are not monotonically increasing.

Notes

Added in version 1.5.