pybacktrack.read_well_file
- pybacktrack.read_well_file(well_filename, lithologies, *, bottom_age_column=0, bottom_depth_column=1, lithology_column=2, other_columns=None, well_attributes=None)
Reads a text file with each row representing a stratigraphic unit.
- Parameters:
well_filename (str) – Name of well text file.
lithologies (dict) – Dictionary mapping lithology names to
pybacktrack.Lithologyobjects.well_bottom_age_column (int, optional) – The column of well file containing bottom age. Defaults to 0.
well_bottom_depth_column (int, optional) – The column of well file containing bottom depth. Defaults to 1.
well_lithology_column (int, optional) – The column of well file containing lithology(s). Defaults to 2.
other_columns (dict, optional) – Dictionary of extra columns (besides age, depth and lithology(s)). Each dict value should be a column index (to read from file), and each associated dict key should be a string that will be the name of an attribute (added to each
pybacktrack.StratigraphicUnitobject in the returnedpybacktrack.Well) containing the value read. For example, backstripping will addmin_water_depthandmax_water_depthattributes (whenpybacktrack.backstrip_well()orpybacktrack.backstrip_and_write_well()has been called, which in turn calls this function).well_attributes (dict, optional) – Attributes to read from well file metadata and store in returned
pybacktrack.Wellobject. If specified then must be a dictionary mapping each metadata name to a 2-tuple containing attribute name and a function to convert attribute string to attribute value. For example, {‘SiteLongitude’ : (‘longitude’, float), ‘SiteLatitude’ : (‘latitude’, float)} will look for metadata name ‘SiteLongitude’ and store a float value in Well.longitude (or None if not found), etc. Each metadata not found in well file will store None in the associated attribute ofpybacktrack.Wellobject.
- Returns:
Well read from file.
- Return type:
- Raises:
ValueError – If
lithology_columnis not the largest column number (must be last column).
Notes
Each attribute to read (eg, bottom_age, bottom_depth, etc) has a column index to direct which column it should be read from.
If file contains
SurfaceAge = <age>in commented (#) lines then the top age of the youngest stratigraphic unit will have that age, otherwise it defaults to 0Ma (present day).Changed in version 1.5: Some arguments (after
*) are now keyword-only (ie, can no longer be specified as positional arguments).