EDI stands for Electrical Data Interchange. The Edi class read and write an EDI file(*.edi) file as the standard MT/EMAP Data Interchange. It does the basic tensors operations. Each section of the EDI file belongs to a class object, thus the elements of each section are attributes for easy access. Edi is outputted following the SEG documentation.

class watex.edi.Edi(verbose=0)[source]#

Bases: object

Electrical Data Interchange class.

Each section of the .edi file belongs to a class object, thus the elements of each section are attributes for easy access. Edi is outputted following the SEG documentation and rules of EMAP (Electromagnetic Array Profiling) and MT sections [1].

Ediclass is for especialy dedicated to .edi files, mainly reading and writing which are meant to follow the archaic EDI format put forward by SEG. Can read impedance, Tipper but not spectra. To read spectra format please consult MTpy documentation https://mtpy2.readthedocs.io/en/develop/ The Edi class contains a class for each major section of the .edi file.

Parameters:

edifile (str,) – Full path to SEG-EDI file.

MTEMAP#

MT section or EMAP DataSection class, contains basic information on the data collected . Can read MT and EMAP section

Type:

watex.edi.MTEMAP

DefineMeasurement#

DefineMeasurement class, contains information on how the data was collected.

Type:

watex.edi.DefineMeasurement

HeaD#

Head class, contains metadata on where, when, and who collected the data Information class.

Type:

watex.edi.Head

Info#

contains information on how the data was processed and how the transfer functions where estimated.

Type:

watex.edi.Info

Z#

Z class, contains the impedance data

Type:

watex.external.z.Z

_block_size#

number of data in one line.

Type:

int, defaut=7

_data_header_com#

header string for each of the data section.

Type:

str, Default=’>!****{0}****!’

_bloc_num_format#

string format of data, Default is’ 16.6e’

Type:

str, Default=’ 16.6e’

_t_comps#

components for tipper blocks

Type:

list,

_z_comps#

components for impedance blocks

Type:

list

_res_comps#

resistivities components

Type:

list

_phs_comps#

phase components

Type:

list

Notes

Frequency and components are ordered from highest to lowest frequency.

References

[1]

Wight, D.E., Drive, B., 1988. MT/EMAP Data Interchange Standard, 1rt ed. Society of Exploration Geophysicists, Texas 7831, USA.

Examples

>>> from watex.edi import Edi
>>> e=Edi().fit('data/edis/new_E1_1.edi')
>>> e.Z.phase [0, 0, 1]
Out[6]: 26.42546593360611
property dataid#
property elev#
fit(edifile)[source]#

fit edifile and populate attribute to each data section of edi.

Parameters:

edifile (str,) – full path to edifile

Returns:

``self`` – returns self for chaining methods.

Return type:

watex.edi.Edi instanciated object

property inspect#

Inspect object whether is fitted or not

interpolateZ(new_freq_array, interp_type='slinear', bounds_error=True, period_buffer=None)[source]#

Interpolate the impedance tensor onto different frequencies.

Parameters:
  • new_freq_array (np.ndarray) – a 1-d array of frequencies to interpolate on to. Must be with in the bounds of the existing frequency range, anything outside and an error will occur.

  • period_buffer – maximum ratio of a data period and the closest interpolation period. Any points outside this ratio will be excluded from the interpolated impedance array.

Returns:

a new impedance object with the corresponding frequencies and components.

Return type:

watex.core.z.Z

Interpolate:
>>> import watex.edi as CSedi
>>> edi_fn = r"/home/edi_files/cs_01.edi"
>>> edi_obj = CSedi.Edi(edi_fn)
>>> # create a new frequency range to interpolate onto
>>> new_freq = np.logspace(-3, 3, 24)
>>> new_z_object= edi_obj.interpolate(new_freq)
>>> edi_obj.write_new_edifile(new_edi_fn=r"/home/edi_files/cs_01_interp.edi",
>>> ...                   new_Z_obj=new_z_object,
>>> ...                   )
property lat#
property lon#
property processingsoftware#
property station#
write_edifile(edifile=None, new_edifilename=None, datatype=None, savepath=None, filtered_array=None, prefix_edi='new_')[source]#

Method to write edifiles from data setting oin attribute of Edi or from existing file. Can write also EMAP data are filled attribute of EDI.

Parameters:
  • edifile (str, Path-like object) – Full path to the edi-file. Should be the old EDI expected to be rewritten.

  • new_edifilename (str, Optional) – new edifile name .If None , will write edi using station_name plus type of survey (MT of EMAP) plus year of writing as< S00_emap.2021.edi> or <S00_mt.2021.edi>

  • datatype (str,) – type of file , “mt” or “emap” if None , program will detect which file is provided . If datatype is set , program will be force to rewrite edi into given format.

  • savepath (str, optional) – Path to save edifile. If None save to your current work directory

  • filtered_array (Array-like of shape (nfreq, 2, 2)) – write filtered array especially if EDI edifile is EMAP section data,if add filter is provided , will recompute rho.

Returns:

new_edifile – full path to the new edifile

Return type:

str,

Examples

>>> from watex.edi import Edi
>>> e=Edi().fit('data/edis/new_E1_1.edi').write_edifile ()
write_new_edifile(new_edi_fn=None, new_Z=None, **kws)[source]#

write a new edi file if things have changed. Note if new_Z is not None, they are not changed in Edi object, you need to change them manually if you want them to be changed. Similarly, the new function name does not change the Edi object edi_filename attribute but does change Edi.edi_object.edi_filename attribute.

Parameters:
  • edi_fn – full path to new edi file

  • new_Z (watex.core.z.Z) – new Z object

  • new_Tipper (watex.core.z.Tipper) – new Tipper object

Returns edi_fn:

full path to edi file written

Rtype edi_fn:

string