mt_metadata.transfer_functions.io.edi.metadata.define_measurement

Classes

DefineMeasurement

DefineMeasurement class holds information about the measurement. This

Module Contents

class mt_metadata.transfer_functions.io.edi.metadata.define_measurement.DefineMeasurement(**data)

Bases: mt_metadata.base.MetadataBase

DefineMeasurement class holds information about the measurement. This includes how each channel was setup. The main block contains information on the reference location for the station. This is a bit of an archaic part and was meant for a multiple station .edi file. This section is also important if you did any forward modeling with Winglink cause it only gives the station location in this section. The other parts are how each channel was collected. An example define measurement section looks like:

>=DEFINEMEAS

    MAXCHAN=7
    MAXRUN=999
    MAXMEAS=9999
    UNITS=M
    REFTYPE=CART
    REFLAT=-30:12:49.4693
    REFLONG=139:47:50.87
    REFELEV=0

>HMEAS ID=1001.001 CHTYPE=HX X=0.0 Y=0.0 Z=0.0 AZM=0.0
>HMEAS ID=1002.001 CHTYPE=HY X=0.0 Y=0.0 Z=0.0 AZM=90.0
>HMEAS ID=1003.001 CHTYPE=HZ X=0.0 Y=0.0 Z=0.0 AZM=0.0
>EMEAS ID=1004.001 CHTYPE=EX X=0.0 Y=0.0 Z=0.0 X2=0.0 Y2=0.0
>EMEAS ID=1005.001 CHTYPE=EY X=0.0 Y=0.0 Z=0.0 X2=0.0 Y2=0.0
>HMEAS ID=1006.001 CHTYPE=HX X=0.0 Y=0.0 Z=0.0 AZM=0.0
>HMEAS ID=1007.001 CHTYPE=HY X=0.0 Y=0.0 Z=0.0 AZM=90.0
Parameters:

fn (string) – full path to .edi file to read in.

Attributes

Description

Default

In .edi

fn

Full path to edi file read in

None

no

maxchan

Maximum number of channels measured

None

yes

maxmeas

Maximum number of measurements

9999

yes

maxrun

Maximum number of measurement runs

999

yes

meas_####

HMeasurement or EMEasurment object defining the measurement made [1]__

None

yes

refelev

Reference elevation (m)

None

yes

reflat

Reference latitude [2]

None

yes

refloc

Reference location

None

yes

reflon

Reference longituted [2]__

None

yes

reftype

Reference coordinate system

‘cart’

yes

units

Units of length

m

yes

_define_meas_keys

Keys to include in define_measurment section.

[3]__

no

maxchan: Annotated[int, Field(default=999, description='maximum number of channels', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['16']})]
maxrun: Annotated[int, Field(default=999, description='maximum number of runs', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['999']})]
maxmeas: Annotated[int, Field(default=7, description='maximum number of measurements', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['999']})]
reftype: Annotated[str | None, Field(default='cartesian', description='Type of offset from reference center point.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['cartesian', 'cart']})]
refloc: Annotated[str | None, Field(default=None, description='Description of location reference center point.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['here']})]
reflat: Annotated[float, Field(default=0, description='Latitude of reference center point.', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['0']})]
reflon: Annotated[float, Field(default=0, description='Longitude reference center point.', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['0']})]
refelev: Annotated[float, Field(default=0, description='Elevation reference center point.', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['0']})]
units: Annotated[str | None, Field(default='m', description='In the EDI standards this is the elevation units.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['m']})]
measurements: Annotated[dict[str, mt_metadata.transfer_functions.io.edi.metadata.EMeasurement | mt_metadata.transfer_functions.io.edi.metadata.HMeasurement], Field(default_factory=dict, description="Dictionary of measurements with keys as channel types (e.g., 'hx', 'hy', 'ex', 'ey', etc.) and values as EMeasurement or HMeasurement objects.", alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["{'hx': EMeasurement(...), 'hy': HMeasurement(...)}"]})]
classmethod validate_units(value)
classmethod validate_position(value, info)
property channel_ids: dict[str, str]
get_measurement_lists(edi_lines)

get measurement list including measurement setup

edi_lines

lines from the edi file to parse

Type:

str

read_measurement(edi_lines)

read the define measurment section of the edi file

should be a list with lines for:

  • maxchan

  • maxmeas

  • maxrun

  • refloc

  • refelev

  • reflat

  • reflon

  • reftype

  • units

  • dictionaries for >XMEAS with keys:

    • id

    • chtype

    • x

    • y

    • axm

    • acqchn

write_measurement(longitude_format='LON', latlon_format='degrees')

write_measurement writes the define measurement section of the edi file.

Parameters:
  • longitude_format (str, optional) – longitude format [ “LONG” | “LON” ] , by default “LON”

  • latlon_format (str, optional) – position format [ “dd” | “ degrees” ], by default “degrees” for decimal degrees If you want to write the position in degrees, use “ degrees” for the latlon_format. This will write the position in the format of HH:MM:SS.ss for the latitude and longitude. If you want to write the position in decimal degrees, use “dd” for the latlon_format.

Returns:

list of lines for the define measurement section or an empty list if no measurements are defined.

Return type:

list[str]

Raises:

ValueError – If a value cannot be converted to a float or if the longitude format is not recognized.

from_metadata(channel)

from_metadata converts a channel object into a measurement object and sets the attributes for the measurement object.

Parameters:

channel (Electric | Magnetic | Auxiliary) – The channel object to convert into a measurement object.

property channels_recorded: list[str]

Get the channels recorded