mt_metadata.transfer_functions.io.edi.metadata package

Subpackages

Submodules

mt_metadata.transfer_functions.io.edi.metadata.data_section module

Created on Sat Dec 4 18:52:52 2021

@author: jpeacock

class mt_metadata.transfer_functions.io.edi.metadata.data_section.DataSection(**kwargs)[source]

Bases: Base

DataSection contains the small metadata block that describes which channel is which. A typical block looks like:

>=MTSECT

    ex=1004.001
    ey=1005.001
    hx=1001.001
    hy=1002.001
    hz=1003.001
    nfreq=14
    sectid=par28ew
    nchan=None
    maxblks=None
Parameters:

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

Attributes

Description

Default

In .edi

ex

ex channel id number

None

yes

ey

ey channel id number

None

yes

hx

hx channel id number

None

yes

hy

hy channel id number

None

yes

hz

hz channel id number

None

yes

nfreq

number of frequencies

None

yes

sectid

section id, should be the same as the station name -> Header.dataid

None

yes

maxblks

maximum number of data blocks

None

yes

nchan

number of channels

None

yes

_kw_list

list of key words to put in metadata

[1]_

no

get_data(edi_lines)[source]

read in the data of the file, will detect if reading spectra or impedance.

match_channels(ch_ids)[source]
Parameters:

ch_ids (TYPE) – DESCRIPTION.

Return type:

None.

read_data(edi_lines)[source]

read data section

write_data(data_list=None, over_dict=None)[source]

write a data section

mt_metadata.transfer_functions.io.edi.metadata.define_measurement module

Created on Sat Dec 4 17:25:11 2021

@author: jpeacock

class mt_metadata.transfer_functions.io.edi.metadata.define_measurement.DefineMeasurement(**kwargs)[source]

Bases: Base

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

property channel_ids
property channels_recorded

Get the channels recorded

from_metadata(channel)[source]

create a measurement class from metadata

Parameters:

channel (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

get_measurement_dict()[source]

get a dictionary for the xmeas parts

get_measurement_lists(edi_lines)[source]

get measurement list including measurement setup

read_measurement(edi_lines)[source]

read the define measurment section of the edi file

should be a list with lines for:

  • maxchan

  • maxmeas

  • maxrun

  • refelev

  • reflat

  • reflon

  • reftype

  • units

  • dictionaries for >XMEAS with keys:

    • id

    • chtype

    • x

    • y

    • axm

    • acqchn

property refelev
property reflat
property reflon
property reflong
write_measurement(measurement_list=None, longitude_format='LON', latlon_format='dd')[source]

write the define measurement block as a list of strings

mt_metadata.transfer_functions.io.edi.metadata.emeasurement module

Created on Sat Dec 4 16:21:06 2021

@author: jpeacock

class mt_metadata.transfer_functions.io.edi.metadata.emeasurement.EMeasurement(**kwargs)[source]

Bases: Base

Metadata Key

Description

Example

id

Required: True

Units: None

Type: float

Style: number

Default: 0.0

Channel number, could be location.channel_number.

1

chtype

Required: True

Units: None

Type: string

Style: controlled vocabulary

Default: None

channel type, should start with an ‘e’

ex

x

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of negative sensor relative center point in north direction

100.0

x2

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of positive sensor relative center point in north direction

100.0

y

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of negative sensor relative center point in east direction

100.0

y2

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of positive sensor relative center point in east direction

100.0

z

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of negative sensor relative center point in depth

100.0

z2

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of positive sensor relative center point in depth

100.0

azm

Required: True

Units: degrees

Type: float

Style: number

Default: 0.0

orientation of the sensor relative to coordinate system, clockwise positive.

100.0

acqchan

Required: True

Units: None

Type: string

Style: free form

Default: None

description of acquired channel

100.0

property azimuth
property channel_number
property dipole_length
write_meas_line()[source]

write string :return: DESCRIPTION :rtype: TYPE

mt_metadata.transfer_functions.io.edi.metadata.header module

Created on Sat Dec 4 12:09:13 2021

@author: jpeacock

class mt_metadata.transfer_functions.io.edi.metadata.header.Header(**kwargs)[source]

Bases: Location

property acqdate
property elev
property enddate
property filedate
get_header_list(edi_lines)[source]

Get the header information from the .edi file in the form of a list, where each item is a line in the header section.

Parameters:

edi_lines (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

property lat
property lon
property long
property progdate
read_header(edi_lines)[source]

read a header information from a list of lines containing header information.

Parameters:

edi_lines (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

write_header(longitude_format='LON', latlon_format='dms', required=True)[source]

Write header information to a list of lines.

Parameters:
  • header_list (list) – should be read from an .edi file or input as [‘key_01=value_01’, ‘key_02=value_02’]

  • longitude_format (string) – whether to write longitude as LON or LONG. options are ‘LON’ or ‘LONG’, default ‘LON’

  • latlon_format (string) – format of latitude and longitude in output edi, degrees minutes seconds (‘dms’) or decimal degrees (‘dd’)

Returns header_lines:

list of lines containing header information

mt_metadata.transfer_functions.io.edi.metadata.hmeasurement module

Created on Sat Dec 4 16:21:06 2021

@author: jpeacock

class mt_metadata.transfer_functions.io.edi.metadata.hmeasurement.HMeasurement(**kwargs)[source]

Bases: Base

Metadata Key

Description

Example

id

Required: True

Units: None

Type: float

Style: number

Default: 0.0

Channel number, could be location.channel_number.

1

chtype

Required: True

Units: None

Type: string

Style: controlled vocabulary

Default: None

channel type, should start with an ‘h’ or ‘b’

hx

x

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of sensor relative center point in north direction

100.0

y

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of sensor relative center point in east direction

100.0

z

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of sensor relative center point in depth

100.0

azm

Required: True

Units: degrees

Type: float

Style: number

Default: 0.0

orientation of the sensor relative to coordinate system, clockwise positive.

100.0

dip

Required: True

Units: degrees

Type: float

Style: number

Default: 0.0

orientation of the sensor relative to horizontal = 0

100.0

acqchan

Required: True

Units: None

Type: string

Style: free form

Default: None

description of acquired channel

100.0

property channel_number
write_meas_line()[source]

write string :return: DESCRIPTION :rtype: TYPE

mt_metadata.transfer_functions.io.edi.metadata.information module

Created on Sat Dec 4 14:13:37 2021

@author: jpeacock

class mt_metadata.transfer_functions.io.edi.metadata.information.Information(fn=None, edi_lines=None)[source]

Bases: Base

Contain, read, and write info section of .edi file

not much to really do here, but just keep it in the same format that it is read in as, except if it is in phoenix format then split the two paragraphs up so they are sequential.

get_info_list(edi_lines)[source]

get a list of lines from the info section

Parameters:

edi_lines (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

parse_info()[source]

Try to parse the info section into useful information. :return: DESCRIPTION :rtype: TYPE

read_info(edi_lines)[source]

read information section of the .edi file

write_info(info_list=None)[source]

write out information

Module contents

class mt_metadata.transfer_functions.io.edi.metadata.DataSection(**kwargs)[source]

Bases: Base

DataSection contains the small metadata block that describes which channel is which. A typical block looks like:

>=MTSECT

    ex=1004.001
    ey=1005.001
    hx=1001.001
    hy=1002.001
    hz=1003.001
    nfreq=14
    sectid=par28ew
    nchan=None
    maxblks=None
Parameters:

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

Attributes

Description

Default

In .edi

ex

ex channel id number

None

yes

ey

ey channel id number

None

yes

hx

hx channel id number

None

yes

hy

hy channel id number

None

yes

hz

hz channel id number

None

yes

nfreq

number of frequencies

None

yes

sectid

section id, should be the same as the station name -> Header.dataid

None

yes

maxblks

maximum number of data blocks

None

yes

nchan

number of channels

None

yes

_kw_list

list of key words to put in metadata

[1]_

no

get_data(edi_lines)[source]

read in the data of the file, will detect if reading spectra or impedance.

match_channels(ch_ids)[source]
Parameters:

ch_ids (TYPE) – DESCRIPTION.

Return type:

None.

read_data(edi_lines)[source]

read data section

write_data(data_list=None, over_dict=None)[source]

write a data section

class mt_metadata.transfer_functions.io.edi.metadata.DefineMeasurement(**kwargs)[source]

Bases: Base

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

property channel_ids
property channels_recorded

Get the channels recorded

from_metadata(channel)[source]

create a measurement class from metadata

Parameters:

channel (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

get_measurement_dict()[source]

get a dictionary for the xmeas parts

get_measurement_lists(edi_lines)[source]

get measurement list including measurement setup

read_measurement(edi_lines)[source]

read the define measurment section of the edi file

should be a list with lines for:

  • maxchan

  • maxmeas

  • maxrun

  • refelev

  • reflat

  • reflon

  • reftype

  • units

  • dictionaries for >XMEAS with keys:

    • id

    • chtype

    • x

    • y

    • axm

    • acqchn

property refelev
property reflat
property reflon
property reflong
write_measurement(measurement_list=None, longitude_format='LON', latlon_format='dd')[source]

write the define measurement block as a list of strings

class mt_metadata.transfer_functions.io.edi.metadata.EMeasurement(**kwargs)[source]

Bases: Base

Metadata Key

Description

Example

id

Required: True

Units: None

Type: float

Style: number

Default: 0.0

Channel number, could be location.channel_number.

1

chtype

Required: True

Units: None

Type: string

Style: controlled vocabulary

Default: None

channel type, should start with an ‘e’

ex

x

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of negative sensor relative center point in north direction

100.0

x2

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of positive sensor relative center point in north direction

100.0

y

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of negative sensor relative center point in east direction

100.0

y2

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of positive sensor relative center point in east direction

100.0

z

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of negative sensor relative center point in depth

100.0

z2

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of positive sensor relative center point in depth

100.0

azm

Required: True

Units: degrees

Type: float

Style: number

Default: 0.0

orientation of the sensor relative to coordinate system, clockwise positive.

100.0

acqchan

Required: True

Units: None

Type: string

Style: free form

Default: None

description of acquired channel

100.0

property azimuth
property channel_number
property dipole_length
write_meas_line()[source]

write string :return: DESCRIPTION :rtype: TYPE

class mt_metadata.transfer_functions.io.edi.metadata.HMeasurement(**kwargs)[source]

Bases: Base

Metadata Key

Description

Example

id

Required: True

Units: None

Type: float

Style: number

Default: 0.0

Channel number, could be location.channel_number.

1

chtype

Required: True

Units: None

Type: string

Style: controlled vocabulary

Default: None

channel type, should start with an ‘h’ or ‘b’

hx

x

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of sensor relative center point in north direction

100.0

y

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of sensor relative center point in east direction

100.0

z

Required: True

Units: meters

Type: float

Style: number

Default: 0.0

location of sensor relative center point in depth

100.0

azm

Required: True

Units: degrees

Type: float

Style: number

Default: 0.0

orientation of the sensor relative to coordinate system, clockwise positive.

100.0

dip

Required: True

Units: degrees

Type: float

Style: number

Default: 0.0

orientation of the sensor relative to horizontal = 0

100.0

acqchan

Required: True

Units: None

Type: string

Style: free form

Default: None

description of acquired channel

100.0

property channel_number
write_meas_line()[source]

write string :return: DESCRIPTION :rtype: TYPE

class mt_metadata.transfer_functions.io.edi.metadata.Header(**kwargs)[source]

Bases: Location

property acqdate
property elev
property enddate
property filedate
get_header_list(edi_lines)[source]

Get the header information from the .edi file in the form of a list, where each item is a line in the header section.

Parameters:

edi_lines (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

property lat
property lon
property long
property progdate
read_header(edi_lines)[source]

read a header information from a list of lines containing header information.

Parameters:

edi_lines (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

write_header(longitude_format='LON', latlon_format='dms', required=True)[source]

Write header information to a list of lines.

Parameters:
  • header_list (list) – should be read from an .edi file or input as [‘key_01=value_01’, ‘key_02=value_02’]

  • longitude_format (string) – whether to write longitude as LON or LONG. options are ‘LON’ or ‘LONG’, default ‘LON’

  • latlon_format (string) – format of latitude and longitude in output edi, degrees minutes seconds (‘dms’) or decimal degrees (‘dd’)

Returns header_lines:

list of lines containing header information

class mt_metadata.transfer_functions.io.edi.metadata.Information(fn=None, edi_lines=None)[source]

Bases: Base

Contain, read, and write info section of .edi file

not much to really do here, but just keep it in the same format that it is read in as, except if it is in phoenix format then split the two paragraphs up so they are sequential.

get_info_list(edi_lines)[source]

get a list of lines from the info section

Parameters:

edi_lines (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

parse_info()[source]

Try to parse the info section into useful information. :return: DESCRIPTION :rtype: TYPE

read_info(edi_lines)[source]

read information section of the .edi file

write_info(info_list=None)[source]

write out information