Z-Files
Z-files are the output format of the EMTF procesing code written by Gary Egbert. This includes mulit-station (.zmm), remote reference (.zrr), and single station (.zss) files.
The metadata is minimal, but self describes where the station is located and the azimuths and dips of each channel.
The data are represented as transfer function estimates, residual covariances, and inverse signal power covariances from which data errors are calculated.
[1]:
from mt_metadata import TF_ZMM
from mt_metadata.transfer_functions import TF
from mt_metadata.transfer_functions.io.zfiles import ZMM
[2]:
tf_object = TF(fn=TF_ZMM)
tf_object.read()
z_object = ZMM(fn=TF_ZMM)
Z Header
The metadata is minimal but is enough to self describe a station’s location and setup.
[3]:
print("\n".join(z_object.write_header()))
TRANSFER FUNCTIONS IN MEASUREMENT COORDINATES
********* WITH FULL ERROR COVARIANCE ********
station: 300
coordinate 34.727 -115.735 declination 13.10
number of channels 5 number of frequencies 38
orientations and tilts of each channel
1 0.00 0.00 300 Hx
2 90.00 0.00 300 Hy
3 0.00 0.00 300 Hz
4 0.00 0.00 300 Ex
5 90.00 0.00 300 Ey
[4]:
print(tf_object)
Station: 300
--------------------------------------------------
Survey: 0
Project: None
Acquired by: None
Acquired date: 1980-01-01
Latitude: 34.727
Longitude: -115.735
Elevation: 948.159
Declination:
Value: 13.1
Model: WMM
Coordinate System: geographic
Impedance: True
Tipper: True
N Periods: 38
Period Range:
Min: 1.16364E+00 s
Max: 1.09227E+04 s
Frequency Range:
Min: 9.15527E-05 Hz
Max: 8.59372E-01 Hz
Statistical Estimates
A z file includes the covariance estimates. The residual covariance (sigma_e
) and the inverse signal power covariance (sigma_s
)
Note: in the below example the elements are moved around because of channel order. Z is (‘hz’, ‘ex’, ‘ey’), where TF is (‘ex’, ‘ey’, ‘hz’)
[5]:
print(z_object.sigma_e[0])
tf_object.residual_covariance[0]
[[ 8.142e-05+0.j -6.596e-05+0.0002254j 1.458e-04+0.0009467j]
[-6.596e-05-0.0002254j 1.604e-02+0.j 2.293e-02+0.005487j ]
[ 1.458e-04-0.0009467j 2.293e-02-0.005487j 2.056e-01+0.j ]]
[5]:
<xarray.DataArray 'residual_covariance' (output: 3, input: 3)> array([[ 1.60399992e-02+0.j , 2.29300000e-02+0.005487j , -6.59599973e-05-0.0002254j], [ 2.29300000e-02-0.005487j , 2.05599993e-01+0.j , 1.45800004e-04-0.0009467j], [-6.59599973e-05+0.0002254j, 1.45800004e-04+0.0009467j, 8.14200030e-05+0.j ]]) Coordinates: period float64 1.164 * output (output) <U2 'ex' 'ey' 'hz' * input (input) <U2 'ex' 'ey' 'hz' Attributes: survey: 0 project: None id: 300 name: None latitude: 34.727 longitude: -115.735 elevation: 948.158935547 declination: 13.1 datum: None acquired_by: None start: 1980-01-01T00:00:00+00:00 end: 1980-01-01T00:00:00+00:00 runs_processed: ['300a'] coordinate_system: geographic
[6]:
print(z_object.sigma_e[0, 1, 1])
tf_object.residual_covariance.loc[dict(input="ex", output="ex")][0]
(0.01604+0j)
[6]:
<xarray.DataArray 'residual_covariance' ()> array(0.01604+0.j) Coordinates: period float64 1.164 output <U2 'ex' input <U2 'ex' Attributes: survey: 0 project: None id: 300 name: None latitude: 34.727 longitude: -115.735 elevation: 948.158935547 declination: 13.1 datum: None acquired_by: None start: 1980-01-01T00:00:00+00:00 end: 1980-01-01T00:00:00+00:00 runs_processed: ['300a'] coordinate_system: geographic
[ ]: