The Head class parses and serializes the header
metadata of SEG-EDI files. It normalizes common variations
in field names (for example LON → LONG) and supports
latitude/longitude given either in decimal degrees or DMS
strings (with or without cardinal letters).
Parameters:
edi_header_list (sequence of str, optional) – Raw lines that belong to the >HEAD section. If
provided, they are parsed immediately via
read().
**kwargs – Attribute overrides (for example dataid,
acqby, coordsys). Unknown keys become
dynamic attributes.
filedate (acqdate, enddate,) – Acquisition start/end dates and the file timestamp.
filedate defaults to current UTC.
loc (country, state, county, prospect,) – Descriptive location metadata.
elev (lat, long,) – Coordinates as decimal degrees and elevation in the
current :pyattr:`units`. DMS inputs are converted to
decimal when reading; writers emit DMS strings.
units ({'m', 'ft'}) – Elevation units (default 'm').
progdate (stdvers, progvers,) – EDI standard version, program version, and revision
date. progvers defaults to pyCSAMT<version>.
coordsys (str) – Coordinate system description (default
'GeomagneticNorth').
declination (float or None) – Geomagnetic declination in degrees.
The Info class collects survey-level metadata and
processing provenance. It supports both classic
KEY=VALUE blocks and spectra-style free-text INFO
blocks. Non-KV lines are preserved in
:pyattr:`info_text` and are written back unmodified.
Parameters:
edi_info_list (sequence of str, optional) – Raw KEY=VALUE lines for the INFO block. If
provided, they are parsed immediately via
read(). Non-KV lines should be passed via
:pyattr:`info_text` or supplied through
from_file().
verbose (int, optional) – Verbosity level forwarded to the base component.
logger (logging.Logger, optional) – Logger instance to use for diagnostics.
info_text (sequence of str, optional) – Free-text lines from spectra-style INFO blocks that
should be preserved.
**kwargs – Attribute overrides; unknown keys are accepted.
Variables:
maxinfo (int) – Maximum number of textual entries (default 999).
Source (Source) – Survey provenance (project, survey, site name, and
creation date).
If there are no KEY=VALUE items (e.g., spectra-style free-text INFO),
this method simply leaves metadata at defaults and returns without error.
Any non-KV lines should be provided via info_text
(from_file handles this).
The Heads helper wraps a parsed
Head and Info pair and provides simple
I/O helpers to extract or write both blocks together. It
is useful when a workflow wants to treat the top matter
of an EDI file as a single unit.
Parameters:
head (Head, optional) – Parsed header. One will be created by
from_file() when reading from disk.
info (Info, optional) – Parsed INFO. One will be created by
from_file() when reading from disk.
HeadMixin adds convenience constructors for reading
the >HEAD block without forcing the host to inherit
from Head directly. This is primarily used by
higher-level SEG components that contain a header but
are not themselves Head objects.
InfoMixin adds convenience constructors for reading
the >INFO block while keeping the host class focused
on its domain logic. It forwards calls to
Info and returns an Info instance.