mt_metadata.transfer_functions.io.edi package

Subpackages

Submodules

mt_metadata.transfer_functions.io.edi.edi module

Updated 2021 to used mt_metadata type metadata and how spectra are read.

class mt_metadata.transfer_functions.io.edi.edi.EDI(fn=None, **kwargs)[source]

Bases: object

This class is for .edi files, mainly reading and writing. Has been tested on Winglink and Phoenix output .edi’s, which are meant to follow the archaic EDI format put forward by SEG. Can read impedance, Tipper and/or spectra data.

The Edi class contains a class for each major section of the .edi file.

Frequency and components are ordered from highest to lowest frequency.

Parameters:

fn (string or pathlib.Path) – full path to .edi file to be read in. default is None. If an .edi file is input, it is automatically read in and attributes of Edi are filled

Change Latitude:
>>> from mt_metadata.transfer_functions.io.edi import EDI
>>> edi_obj = EDI(fn=r"/home/mt/mt01.edi")
>>> # change the latitude
>>> edi_obj.lat = 45.7869
>>> new_edi_fn = edi_obj.write()
property elev

Elevation in elevation units

property ex_metadata
property ey_metadata
property fn
property hx_metadata
property hy_metadata
property hz_metadata
property lat

latitude in decimal degrees

property lon

longitude in decimal degrees

property period
read(fn=None, get_elevation=False)[source]

Read in an edi file and fill attributes of each section’s classes. Including:

  • Header

  • Info

  • Measurement

  • Data

  • z, z_err

  • t, t_err

Note

Automatically detects if data is in spectra format. All data read in is converted to impedance and Tipper.

Parameters:

fn (string) – full path to .edi file to be read in default is None

Example:
>>> from mt_metadata.transfer_functions.io.edi import EDI
>>> edi_obj = EDI
>>> edi_obj.read(fn=r"/home/mt/mt01.edi")
property rrhx_metadata
property rrhy_metadata
property station

station name

property station_metadata
property survey_metadata
write(new_edi_fn=None, longitude_format='LON', latlon_format='dms')[source]

Write a new edi file from either an existing .edi file or from data input by the user into the attributes of Edi.

Parameters:
  • new_edi_fn (string) – full path to new edi file. default is None, which will write to the same file as the input .edi with as: r”/home/mt/mt01_1.edi”

  • 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:

full path to new edi file

Return type:

string

Example:
>>> import mtpy.core.edi as mtedi
>>> edi_obj = mtedi.Edi(fn=r"/home/mt/mt01/edi")
>>> edi_obj.Header.dataid = 'mt01_rr'
>>> n_edi_fn = edi_obj.write_edi_file()

Module contents

class mt_metadata.transfer_functions.io.edi.EDI(fn=None, **kwargs)[source]

Bases: object

This class is for .edi files, mainly reading and writing. Has been tested on Winglink and Phoenix output .edi’s, which are meant to follow the archaic EDI format put forward by SEG. Can read impedance, Tipper and/or spectra data.

The Edi class contains a class for each major section of the .edi file.

Frequency and components are ordered from highest to lowest frequency.

Parameters:

fn (string or pathlib.Path) – full path to .edi file to be read in. default is None. If an .edi file is input, it is automatically read in and attributes of Edi are filled

Change Latitude:
>>> from mt_metadata.transfer_functions.io.edi import EDI
>>> edi_obj = EDI(fn=r"/home/mt/mt01.edi")
>>> # change the latitude
>>> edi_obj.lat = 45.7869
>>> new_edi_fn = edi_obj.write()
property elev

Elevation in elevation units

property ex_metadata
property ey_metadata
property fn
property hx_metadata
property hy_metadata
property hz_metadata
property lat

latitude in decimal degrees

property lon

longitude in decimal degrees

property period
read(fn=None, get_elevation=False)[source]

Read in an edi file and fill attributes of each section’s classes. Including:

  • Header

  • Info

  • Measurement

  • Data

  • z, z_err

  • t, t_err

Note

Automatically detects if data is in spectra format. All data read in is converted to impedance and Tipper.

Parameters:

fn (string) – full path to .edi file to be read in default is None

Example:
>>> from mt_metadata.transfer_functions.io.edi import EDI
>>> edi_obj = EDI
>>> edi_obj.read(fn=r"/home/mt/mt01.edi")
property rrhx_metadata
property rrhy_metadata
property station

station name

property station_metadata
property survey_metadata
write(new_edi_fn=None, longitude_format='LON', latlon_format='dms')[source]

Write a new edi file from either an existing .edi file or from data input by the user into the attributes of Edi.

Parameters:
  • new_edi_fn (string) – full path to new edi file. default is None, which will write to the same file as the input .edi with as: r”/home/mt/mt01_1.edi”

  • 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:

full path to new edi file

Return type:

string

Example:
>>> import mtpy.core.edi as mtedi
>>> edi_obj = mtedi.Edi(fn=r"/home/mt/mt01/edi")
>>> edi_obj.Header.dataid = 'mt01_rr'
>>> n_edi_fn = edi_obj.write_edi_file()