mth5.io.zen package

Submodules

mth5.io.zen.coil_response module

Read an amtant.cal file provided by Zonge.

Apparently, the file includes the 6th and 8th harmonic of the given frequency, which is a fancy way of saying f x 6 and f x 8.

class mth5.io.zen.coil_response.CoilResponse(calibration_file=None, angular_frequency=False)[source]

Bases: object

property calibration_file
file_exists()[source]

Check to make sure the file exists

Returns

True if it does, False if it does not

Return type

boolean

get_coil_response_fap(coil_number)[source]

Read an amtant.cal file provided by Zonge.

Apparently, the file includes the 6th and 8th harmonic of the given frequency, which is a fancy way of saying f * 6 and f * 8.

Parameters

coil_number (int or string) – ANT4 4 digit serial number

Returns

Frequency look up table

Return type

mt_metadata.timeseries.filters.FrequencyResponseTableFilter

has_coil_number(coil_number)[source]

Test if coil number is in the antenna file

Parameters

coil_number (int or string) – ANT4 serial number

Returns

True if the coil is found, False if it is not

Return type

boolean

read_antenna_file(antenna_calibration_file=None)[source]

Read in the Antenna file to frequency, amplitude, phase of the proper harmonics (6, 8)

Note

Phase is measureed in milli-radians and will be converted

to radians.

Parameters

antenna_calibration_file (string or Path) – path to antenna.cal file provided by Zonge

mth5.io.zen.z3d_collection module

Z3DCollection

An object to hold Z3D file information to make processing easier.

Created on Sat Apr 4 12:40:40 2020

@author: peacock

class mth5.io.zen.z3d_collection.Z3DCollection(file_path=None, **kwargs)[source]

Bases: Collection

An object to deal with a collection of Z3D files. Metadata and information are contained with in Pandas DataFrames for easy searching.

assign_run_names(df, zeros=3)[source]
Returns

DESCRIPTION

Return type

TYPE

get_calibrations(antenna_calibration_file)[source]

Get coil calibrations from the antenna.cal file

Parameters

antenna_calibration_file (TYPE) – DESCRIPTION

Returns

DESCRIPTION

Return type

TYPE

to_dataframe(sample_rates=[256, 4096], run_name_zeros=4, calibration_path=None)[source]

Get general z3d information and put information in a dataframe

Parameters

z3d_fn_list (list) – List of files Paths to z3d files

Returns

Dataframe of z3d information

Return type

Pandas.DataFrame

Example
>>> zc_obj = zc.Z3DCollection(r"/home/z3d_files")
>>> z3d_fn_list = zc.get_z3d_fn_list()
>>> z3d_df = zc.get_z3d_info(z3d_fn_list)
>>> # write dataframe to a file to use later
>>> z3d_df.to_csv(r"/home/z3d_files/z3d_info.csv")

mth5.io.zen.z3d_header module

Zen Header

  • Tools for reading and writing files for Zen and processing software

  • Tools for copying data from SD cards

  • Tools for copying schedules to SD cards

Created on Tue Jun 11 10:53:23 2013 Updated August 2020 (JP)

copyright

Jared Peacock (jpeacock@usgs.gov)

license

MIT

class mth5.io.zen.z3d_header.Z3DHeader(fn=None, fid=None, **kwargs)[source]

Bases: object

Read in the header information of a Z3D file and make each metadata entry an attirbute.

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Attributes

Definition

_header_len

lenght of header in bits (512)

ad_gain

gain of channel

ad_rate

sampling rate in Hz

alt

altitude of the station (not reliable)

attenchannelsmask

not sure

box_number

ZEN box number

box_serial

ZEN box serial number

channel

channel number of the file

channelserial

serial number of the channel board

duty

duty cycle of the transmitter

fpga_buildnum

build number of one of the boards

gpsweek

GPS week

header_str

full header string

lat

latitude of station

logterminal

not sure

long

longitude of the station

main_hex_buildnum

build number of the ZEN box in hexidecimal

numsats

number of gps satelites

period

period of the transmitter

tx_duty

transmitter duty cycle

tx_freq

transmitter frequency

version

version of the firmware

Example
>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DHeader()
>>> header_obj.read_header()
convert_value(key_string, value_string)[source]

convert the value to the appropriate units given the key

property data_logger

Data logger name as ZEN{box_number}

read_header(fn=None, fid=None)[source]

Read the header information into appropriate attributes

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Example

>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DHeader()
>>> header_obj.read_header()

mth5.io.zen.z3d_metadata module

Created on Wed Aug 24 11:35:59 2022

@author: jpeacock

class mth5.io.zen.z3d_metadata.Z3DMetadata(fn=None, fid=None, **kwargs)[source]

Bases: object

Will read in the metadata information of a Z3D file and make each metadata entry an attirbute.The attributes are left in capitalization of the Z3D file.

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Attributes

Definition

_header_length

length of header in bits (512)

_metadata_length

length of metadata blocks (512)

_schedule_metadata_len

length of schedule meta data (512)

board_cal

board calibration np.ndarray()

cal_ant

antenna calibration

cal_board

board calibration

cal_ver

calibration version

ch_azimuth

channel azimuth

ch_cmp

channel component

ch_length

channel length (or # of coil)

ch_number

channel number on the ZEN board

ch_xyz1

channel xyz location (not sure)

ch_xyz2

channel xyz location (not sure)

coil_cal

coil calibration np.ndarray (freq, amp, phase)

fid

file object

find_metadata

boolean of finding metadata

fn

full path to Z3D file

gdp_operator

operater of the survey

gdp_progver

program version

job_by

job preformed by

job_for

job for

job_name

job name

job_number

job number

m_tell

location in the file where the last metadata block was found.

rx_aspace

electrode spacing

rx_sspace

not sure

rx_xazimuth

x azimuth of electrode

rx_xyz0

not sure

rx_yazimuth

y azimuth of electrode

survey_type

type of survey

unit_length

length units (m)

Example
>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DMetadata()
>>> header_obj.read_metadata()
read_metadata(fn=None, fid=None)[source]

read meta data

Parameters
  • fn (string) – full path to file, optional if already initialized.

  • fid (file) – open file object, optional if already initialized.

mth5.io.zen.z3d_schedule module

Created on Wed Aug 24 11:24:57 2022

@author: jpeacock

class mth5.io.zen.z3d_schedule.Z3DSchedule(fn=None, fid=None, **kwargs)[source]

Bases: object

Will read in the schedule information of a Z3D file and make each metadata entry an attirbute. The attributes are left in capitalization of the Z3D file.

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Attributes

Definition

AutoGain

Auto gain for the channel

Comment

Any comments for the schedule

Date

Date of when the schedule action was started YYYY-MM-DD

Duty

Duty cycle of the transmitter

FFTStacks

FFT stacks from the transmitter

Filename

Name of the file that the ZEN gives it

Gain

Gain of the channel

Log

Log the data [ Y | N ]

NewFile

Create a new file [ Y | N ]

Period

Period of the transmitter

RadioOn

Turn on the radio [ Y | N ]

SR

Sampling Rate in Hz

SamplesPerAcq

Samples per aquisition for transmitter

Sleep

Set the box to sleep [ Y | N ]

Sync

Sync with GPS [ Y | N ]

Time

Time the schedule action started HH:MM:SS (GPS time)

_header_len

length of header in bits (512)

_schedule_metadata_len

length of schedule metadata in bits (512)

fid

file object of the file

fn

file name to read in

meta_string

string of the schedule

Example
>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DSchedule()
>>> header_obj.read_schedule()
read_schedule(fn=None, fid=None)[source]

read meta data string

mth5.io.zen.zen module

Zen

  • Tools for reading and writing files for Zen and processing software

  • Tools for copying data from SD cards

  • Tools for copying schedules to SD cards

Created on Tue Jun 11 10:53:23 2013 Updated August 2020 (JP)

copyright

Jared Peacock (jpeacock@usgs.gov)

license

MIT

class mth5.io.zen.zen.Z3D(fn=None, **kwargs)[source]

Bases: object

Deals with the raw Z3D files output by zen. :param **fn**: full path to .Z3D file to be read in :type **fn**: string

Attributes

Description

Default Value

_block_len

length of data block to read in as chunks faster reading

65536

_counts_to_mv_conversion

conversion factor to convert counts to mv

9.53674316406e-10

_gps_bytes

number of bytes for a gps stamp

16

_gps_dtype

data type for a gps stamp

see below

_gps_epoch

starting date of GPS time format is a tuple

(1980, 1, 6, 0,

0, 0, -1, -1, 0)

_gps_f0

first gps flag in raw binary

_gps_f1

second gps flag in raw binary

_gps_flag_0

first gps flag as an int32

2147483647

_gps_flag_1

second gps flag as an int32

-2147483648

_gps_stamp_length

bit length of gps stamp

64

_leap_seconds

leap seconds, difference between UTC time and GPS time. GPS time is ahead by this much

16

_week_len

week length in seconds

604800

df

sampling rate of the data

256

fn

Z3D file name

None

gps_flag

full gps flag

_gps_f0+_gps_f1

gps_stamps

np.ndarray of gps stamps

None

header

Z3DHeader object

Z3DHeader

metadata

Z3DMetadata

Z3DMetadata

schedule

Z3DSchedule

Z3DSchedule

time_series

np.ndarra(len_data)

None

units

units in which the data is in

counts

zen_schedule

time when zen was set to run

None

  • gps_dtype is formated as np.dtype([(‘flag0’, np.int32),

    (‘flag1’, np.int32), (‘time’, np.int32), (‘lat’, np.float64), (‘lon’, np.float64), (‘num_sat’, np.int32), (‘gps_sens’, np.int32), (‘temperature’, np.float32), (‘voltage’, np.float32), (‘num_fpga’, np.int32), (‘num_adc’, np.int32), (‘pps_count’, np.int32), (‘dac_tune’, np.int32), (‘block_len’, np.int32)])

Example
>>> import mtpy.usgs.zen as zen
>>> zt = zen.Zen3D(r"/home/mt/mt00/mt00_20150522_080000_256_EX.Z3D")
>>> zt.read_z3d()
>>> ------- Reading /home/mt/mt00/mt00_20150522_080000_256_EX.Z3D -----
    --> Reading data took: 0.322 seconds
    Scheduled time was 2015-05-22,08:00:16 (GPS time)
    1st good stamp was 2015-05-22,08:00:18 (GPS time)
    difference of 2.00 seconds
    found 6418 GPS time stamps
    found 1642752 data points
>>> zt.plot_time_series()
property azimuth

azimuth of instrument setup

property channel_metadata

Channel metadata

property channel_number
property channel_response
check_start_time()[source]

check to make sure the scheduled start time is similar to the first good gps stamp

property coil_number

coil number

property coil_response

Make the coile response into a FAP filter

Phase must be in radians

property component

channel

convert_counts_to_mv(data)[source]

convert the time series from counts to millivolts

convert_gps_time()[source]

convert gps time integer to relative seconds from gps_week

convert_mv_to_counts(data)[source]

convert millivolts to counts assuming no other scaling has been applied

property counts2mv_filter

Create a counts2mv coefficient filter

Note

Needs to be 1/channel factor because we divided the instrument response from the data.

property dipole_filter
property dipole_length

dipole length

property elevation

elevation in meters

property end
property file_size
property fn
get_UTC_date_time(gps_week, gps_time)[source]

get the actual date and time of measurement as UTC.

Parameters
  • gps_week (int) – integer value of gps_week that the data was collected

  • gps_time (int) – number of seconds from beginning of gps_week

Returns

mth5.utils.mttime.MTime

get_gps_stamp_index(ts_data, old_version=False)[source]

locate the time stamps in a given time series.

Looks for gps_flag_0 first, if the file is newer, then makes sure the next value is gps_flag_1

Returns

list of gps stamps indicies

get_gps_time(gps_int, gps_week=0)[source]

from the gps integer get the time in seconds.

Parameters
  • gps_int (int) – integer from the gps time stamp line

  • gps_week (int) – relative gps week, if the number of seconds is larger than a week then a week is subtracted from the seconds and computed from gps_week += 1

Returns

gps_time as number of seconds from the beginning of the relative gps week.

property latitude

latitude in decimal degrees

property longitude

longitude in decimal degrees

property n_samples
read_all_info()[source]

Read header, schedule, and metadata

read_z3d(z3d_fn=None)[source]

read in z3d file and populate attributes accordingly

  1. Read in the entire file as chunks as np.int32.

  2. Extract the gps stamps and convert accordingly. Check to make sure gps time stamps are 1 second apart and incrementing as well as checking the number of data points between stamps is the same as the sampling rate.

  3. Converts gps_stamps[‘time’] to seconds relative to header.gps_week

    Note we skip the first two gps stamps because there is something wrong with the data there due to some type of buffering. Therefore the first GPS time is when the time series starts, so you will notice that gps_stamps[0][‘block_len’] = 0, this is because there is nothing previous to this time stamp and so the ‘block_len’ measures backwards from the corresponding time index.

  4. Put the data chunks into Pandas data frame that is indexed by time

Example

>>> from mth5.io import zen
>>> z_obj = zen.Z3D(r"home/mt_data/zen/mt001.z3d")
>>> z_obj.read_z3d()
property run_metadata

Run metadata

property sample_rate

sampling rate

property start
property station

station name

property station_metadata

station metadta

to_channelts()[source]

fill time series object

trim_data()[source]

apparently need to skip the first 2 seconds of data because of something to do with the SD buffer

This method will be deprecated after field testing

validate_gps_time()[source]

make sure each time stamp is 1 second apart

validate_time_blocks()[source]

validate gps time stamps and make sure each block is the proper length

property zen_response

Zen response, not sure the full calibration comes directly from the Z3D file, so skipping for now. Will have to read a Zen##.cal file to get the full calibration. This shouldn’t be a big issue cause it should roughly be the same for all channels and since the TF is computing the ratio they will cancel out. Though we should look more into this if just looking at calibrate time series.

property zen_schedule

zen schedule data and time

exception mth5.io.zen.zen.ZenGPSError[source]

Bases: Exception

error for gps timing

exception mth5.io.zen.zen.ZenInputFileError[source]

Bases: Exception

error for input files

exception mth5.io.zen.zen.ZenSamplingRateError[source]

Bases: Exception

error for different sampling rates

mth5.io.zen.zen.read_z3d(fn, logger_file_handler=None)[source]

generic tool to read z3d file

Module contents

class mth5.io.zen.CoilResponse(calibration_file=None, angular_frequency=False)[source]

Bases: object

property calibration_file
file_exists()[source]

Check to make sure the file exists

Returns

True if it does, False if it does not

Return type

boolean

get_coil_response_fap(coil_number)[source]

Read an amtant.cal file provided by Zonge.

Apparently, the file includes the 6th and 8th harmonic of the given frequency, which is a fancy way of saying f * 6 and f * 8.

Parameters

coil_number (int or string) – ANT4 4 digit serial number

Returns

Frequency look up table

Return type

mt_metadata.timeseries.filters.FrequencyResponseTableFilter

has_coil_number(coil_number)[source]

Test if coil number is in the antenna file

Parameters

coil_number (int or string) – ANT4 serial number

Returns

True if the coil is found, False if it is not

Return type

boolean

read_antenna_file(antenna_calibration_file=None)[source]

Read in the Antenna file to frequency, amplitude, phase of the proper harmonics (6, 8)

Note

Phase is measureed in milli-radians and will be converted

to radians.

Parameters

antenna_calibration_file (string or Path) – path to antenna.cal file provided by Zonge

class mth5.io.zen.Z3D(fn=None, **kwargs)[source]

Bases: object

Deals with the raw Z3D files output by zen. :param **fn**: full path to .Z3D file to be read in :type **fn**: string

Attributes

Description

Default Value

_block_len

length of data block to read in as chunks faster reading

65536

_counts_to_mv_conversion

conversion factor to convert counts to mv

9.53674316406e-10

_gps_bytes

number of bytes for a gps stamp

16

_gps_dtype

data type for a gps stamp

see below

_gps_epoch

starting date of GPS time format is a tuple

(1980, 1, 6, 0,

0, 0, -1, -1, 0)

_gps_f0

first gps flag in raw binary

_gps_f1

second gps flag in raw binary

_gps_flag_0

first gps flag as an int32

2147483647

_gps_flag_1

second gps flag as an int32

-2147483648

_gps_stamp_length

bit length of gps stamp

64

_leap_seconds

leap seconds, difference between UTC time and GPS time. GPS time is ahead by this much

16

_week_len

week length in seconds

604800

df

sampling rate of the data

256

fn

Z3D file name

None

gps_flag

full gps flag

_gps_f0+_gps_f1

gps_stamps

np.ndarray of gps stamps

None

header

Z3DHeader object

Z3DHeader

metadata

Z3DMetadata

Z3DMetadata

schedule

Z3DSchedule

Z3DSchedule

time_series

np.ndarra(len_data)

None

units

units in which the data is in

counts

zen_schedule

time when zen was set to run

None

  • gps_dtype is formated as np.dtype([(‘flag0’, np.int32),

    (‘flag1’, np.int32), (‘time’, np.int32), (‘lat’, np.float64), (‘lon’, np.float64), (‘num_sat’, np.int32), (‘gps_sens’, np.int32), (‘temperature’, np.float32), (‘voltage’, np.float32), (‘num_fpga’, np.int32), (‘num_adc’, np.int32), (‘pps_count’, np.int32), (‘dac_tune’, np.int32), (‘block_len’, np.int32)])

Example
>>> import mtpy.usgs.zen as zen
>>> zt = zen.Zen3D(r"/home/mt/mt00/mt00_20150522_080000_256_EX.Z3D")
>>> zt.read_z3d()
>>> ------- Reading /home/mt/mt00/mt00_20150522_080000_256_EX.Z3D -----
    --> Reading data took: 0.322 seconds
    Scheduled time was 2015-05-22,08:00:16 (GPS time)
    1st good stamp was 2015-05-22,08:00:18 (GPS time)
    difference of 2.00 seconds
    found 6418 GPS time stamps
    found 1642752 data points
>>> zt.plot_time_series()
property azimuth

azimuth of instrument setup

property channel_metadata

Channel metadata

property channel_number
property channel_response
check_start_time()[source]

check to make sure the scheduled start time is similar to the first good gps stamp

property coil_number

coil number

property coil_response

Make the coile response into a FAP filter

Phase must be in radians

property component

channel

convert_counts_to_mv(data)[source]

convert the time series from counts to millivolts

convert_gps_time()[source]

convert gps time integer to relative seconds from gps_week

convert_mv_to_counts(data)[source]

convert millivolts to counts assuming no other scaling has been applied

property counts2mv_filter

Create a counts2mv coefficient filter

Note

Needs to be 1/channel factor because we divided the instrument response from the data.

property dipole_filter
property dipole_length

dipole length

property elevation

elevation in meters

property end
property file_size
property fn
get_UTC_date_time(gps_week, gps_time)[source]

get the actual date and time of measurement as UTC.

Parameters
  • gps_week (int) – integer value of gps_week that the data was collected

  • gps_time (int) – number of seconds from beginning of gps_week

Returns

mth5.utils.mttime.MTime

get_gps_stamp_index(ts_data, old_version=False)[source]

locate the time stamps in a given time series.

Looks for gps_flag_0 first, if the file is newer, then makes sure the next value is gps_flag_1

Returns

list of gps stamps indicies

get_gps_time(gps_int, gps_week=0)[source]

from the gps integer get the time in seconds.

Parameters
  • gps_int (int) – integer from the gps time stamp line

  • gps_week (int) – relative gps week, if the number of seconds is larger than a week then a week is subtracted from the seconds and computed from gps_week += 1

Returns

gps_time as number of seconds from the beginning of the relative gps week.

property latitude

latitude in decimal degrees

property longitude

longitude in decimal degrees

property n_samples
read_all_info()[source]

Read header, schedule, and metadata

read_z3d(z3d_fn=None)[source]

read in z3d file and populate attributes accordingly

  1. Read in the entire file as chunks as np.int32.

  2. Extract the gps stamps and convert accordingly. Check to make sure gps time stamps are 1 second apart and incrementing as well as checking the number of data points between stamps is the same as the sampling rate.

  3. Converts gps_stamps[‘time’] to seconds relative to header.gps_week

    Note we skip the first two gps stamps because there is something wrong with the data there due to some type of buffering. Therefore the first GPS time is when the time series starts, so you will notice that gps_stamps[0][‘block_len’] = 0, this is because there is nothing previous to this time stamp and so the ‘block_len’ measures backwards from the corresponding time index.

  4. Put the data chunks into Pandas data frame that is indexed by time

Example

>>> from mth5.io import zen
>>> z_obj = zen.Z3D(r"home/mt_data/zen/mt001.z3d")
>>> z_obj.read_z3d()
property run_metadata

Run metadata

property sample_rate

sampling rate

property start
property station

station name

property station_metadata

station metadta

to_channelts()[source]

fill time series object

trim_data()[source]

apparently need to skip the first 2 seconds of data because of something to do with the SD buffer

This method will be deprecated after field testing

validate_gps_time()[source]

make sure each time stamp is 1 second apart

validate_time_blocks()[source]

validate gps time stamps and make sure each block is the proper length

property zen_response

Zen response, not sure the full calibration comes directly from the Z3D file, so skipping for now. Will have to read a Zen##.cal file to get the full calibration. This shouldn’t be a big issue cause it should roughly be the same for all channels and since the TF is computing the ratio they will cancel out. Though we should look more into this if just looking at calibrate time series.

property zen_schedule

zen schedule data and time

class mth5.io.zen.Z3DCollection(file_path=None, **kwargs)[source]

Bases: Collection

An object to deal with a collection of Z3D files. Metadata and information are contained with in Pandas DataFrames for easy searching.

assign_run_names(df, zeros=3)[source]
Returns

DESCRIPTION

Return type

TYPE

get_calibrations(antenna_calibration_file)[source]

Get coil calibrations from the antenna.cal file

Parameters

antenna_calibration_file (TYPE) – DESCRIPTION

Returns

DESCRIPTION

Return type

TYPE

to_dataframe(sample_rates=[256, 4096], run_name_zeros=4, calibration_path=None)[source]

Get general z3d information and put information in a dataframe

Parameters

z3d_fn_list (list) – List of files Paths to z3d files

Returns

Dataframe of z3d information

Return type

Pandas.DataFrame

Example
>>> zc_obj = zc.Z3DCollection(r"/home/z3d_files")
>>> z3d_fn_list = zc.get_z3d_fn_list()
>>> z3d_df = zc.get_z3d_info(z3d_fn_list)
>>> # write dataframe to a file to use later
>>> z3d_df.to_csv(r"/home/z3d_files/z3d_info.csv")
class mth5.io.zen.Z3DHeader(fn=None, fid=None, **kwargs)[source]

Bases: object

Read in the header information of a Z3D file and make each metadata entry an attirbute.

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Attributes

Definition

_header_len

lenght of header in bits (512)

ad_gain

gain of channel

ad_rate

sampling rate in Hz

alt

altitude of the station (not reliable)

attenchannelsmask

not sure

box_number

ZEN box number

box_serial

ZEN box serial number

channel

channel number of the file

channelserial

serial number of the channel board

duty

duty cycle of the transmitter

fpga_buildnum

build number of one of the boards

gpsweek

GPS week

header_str

full header string

lat

latitude of station

logterminal

not sure

long

longitude of the station

main_hex_buildnum

build number of the ZEN box in hexidecimal

numsats

number of gps satelites

period

period of the transmitter

tx_duty

transmitter duty cycle

tx_freq

transmitter frequency

version

version of the firmware

Example
>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DHeader()
>>> header_obj.read_header()
convert_value(key_string, value_string)[source]

convert the value to the appropriate units given the key

property data_logger

Data logger name as ZEN{box_number}

read_header(fn=None, fid=None)[source]

Read the header information into appropriate attributes

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Example

>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DHeader()
>>> header_obj.read_header()
class mth5.io.zen.Z3DMetadata(fn=None, fid=None, **kwargs)[source]

Bases: object

Will read in the metadata information of a Z3D file and make each metadata entry an attirbute.The attributes are left in capitalization of the Z3D file.

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Attributes

Definition

_header_length

length of header in bits (512)

_metadata_length

length of metadata blocks (512)

_schedule_metadata_len

length of schedule meta data (512)

board_cal

board calibration np.ndarray()

cal_ant

antenna calibration

cal_board

board calibration

cal_ver

calibration version

ch_azimuth

channel azimuth

ch_cmp

channel component

ch_length

channel length (or # of coil)

ch_number

channel number on the ZEN board

ch_xyz1

channel xyz location (not sure)

ch_xyz2

channel xyz location (not sure)

coil_cal

coil calibration np.ndarray (freq, amp, phase)

fid

file object

find_metadata

boolean of finding metadata

fn

full path to Z3D file

gdp_operator

operater of the survey

gdp_progver

program version

job_by

job preformed by

job_for

job for

job_name

job name

job_number

job number

m_tell

location in the file where the last metadata block was found.

rx_aspace

electrode spacing

rx_sspace

not sure

rx_xazimuth

x azimuth of electrode

rx_xyz0

not sure

rx_yazimuth

y azimuth of electrode

survey_type

type of survey

unit_length

length units (m)

Example
>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DMetadata()
>>> header_obj.read_metadata()
read_metadata(fn=None, fid=None)[source]

read meta data

Parameters
  • fn (string) – full path to file, optional if already initialized.

  • fid (file) – open file object, optional if already initialized.

class mth5.io.zen.Z3DSchedule(fn=None, fid=None, **kwargs)[source]

Bases: object

Will read in the schedule information of a Z3D file and make each metadata entry an attirbute. The attributes are left in capitalization of the Z3D file.

Parameters
  • fn (string or pathlib.Path) – full path to Z3D file

  • fid (file) – file object ex. open(Z3Dfile, ‘rb’)

Attributes

Definition

AutoGain

Auto gain for the channel

Comment

Any comments for the schedule

Date

Date of when the schedule action was started YYYY-MM-DD

Duty

Duty cycle of the transmitter

FFTStacks

FFT stacks from the transmitter

Filename

Name of the file that the ZEN gives it

Gain

Gain of the channel

Log

Log the data [ Y | N ]

NewFile

Create a new file [ Y | N ]

Period

Period of the transmitter

RadioOn

Turn on the radio [ Y | N ]

SR

Sampling Rate in Hz

SamplesPerAcq

Samples per aquisition for transmitter

Sleep

Set the box to sleep [ Y | N ]

Sync

Sync with GPS [ Y | N ]

Time

Time the schedule action started HH:MM:SS (GPS time)

_header_len

length of header in bits (512)

_schedule_metadata_len

length of schedule metadata in bits (512)

fid

file object of the file

fn

file name to read in

meta_string

string of the schedule

Example
>>> import mtpy.usgs.zen as zen
>>> Z3Dfn = r"/home/mt/mt01/mt01_20150522_080000_256_EX.Z3D"
>>> header_obj = zen.Z3DSchedule()
>>> header_obj.read_schedule()
read_schedule(fn=None, fid=None)[source]

read meta data string

mth5.io.zen.read_z3d(fn, logger_file_handler=None)[source]

generic tool to read z3d file