{ "cells": [ { "cell_type": "markdown", "id": "dcd30715-d919-4893-b263-e70da852a584", "metadata": {}, "source": [ "# EDI formats\n", "\n", "[EDI](https://library.seg.org/doi/abs/10.1190/1.1892244) files have historically been the most common format for MT transfer functions. The metadata is quite flexible and can be verbose or scant in details about the transfer function. Needless to say there are many flavor of EDI files. The EDI module has been test with various flavors, if you find your's is not read properly be sure to raise an [issue](https://github.com/kujaku11/mt_metadata/issues) with the \"transfer function\" label. \n", "\n", "Here we will load a few different types of EDI files into TF. The files are common products from contracting companies. \n", "\n", "**Note**: Spectra data can be readily converted. The spectra conversion is adopted from Anna Kelbert's [EMTF fortran code](https://software.seg.org/2020/0001/). This computes the `inverse_signal_power` and `residual_covariance` estimates for the errors to accurately estimate error upon rotation. " ] }, { "cell_type": "code", "execution_count": 48, "id": "1c1c4ff7-8fba-4c95-be27-162f9a9f7c38", "metadata": {}, "outputs": [], "source": [ "from mt_metadata.transfer_functions import TF\n", "from mt_metadata.transfer_functions.io.edi import EDI" ] }, { "cell_type": "markdown", "id": "8d74b614-7f23-4705-b0b1-3e81baeec37e", "metadata": {}, "source": [ "### Common output by Phoenix Geophysics" ] }, { "cell_type": "code", "execution_count": 3, "id": "d2a95b99-b0f8-46fb-bce4-096600024cb8", "metadata": {}, "outputs": [], "source": [ "from mt_metadata import TF_EDI_PHOENIX" ] }, { "cell_type": "code", "execution_count": 25, "id": "28be888b-29d1-465f-9f59-6ee928a3ad3b", "metadata": {}, "outputs": [], "source": [ "tf_object = TF(fn=TF_EDI_PHOENIX)\n", "tf_object.read()\n", "edi_object = EDI(fn=TF_EDI_PHOENIX)" ] }, { "cell_type": "code", "execution_count": 26, "id": "66754418-acad-43c8-93a0-4566e36a64c9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ">HEAD\n", "\tACQBY=Phoenix\n", "\tACQDATE=2014-07-28T00:00:00+00:00\n", "\tCOORDINATE_SYSTEM=geographic\n", "\tDATAID=14-IEB0537A\n", "\tDATUM=WGS84\n", "\tELEV=158.000\n", "\tEMPTY=1e+32\n", "\tFILEBY=Phoenix\n", "\tFILEDATE=2023-03-16\n", "\tLAT=-22:49:25.40\n", "\tLON=139:17:40.90\n", "\tPROGDATE=2021-12-01\n", "\tPROGNAME=mt_metadata\n", "\tPROGVERS=0.2.2\n", "\tSTDVERS=SEG 1.0\n", "\tUNITS=M\n", "\n", "\n", ">INFO\n", " CUTOFF: 0.00 COH: 35 % VAR: 25 %\n", " Comp MTU box S/N Temp\n", " Comp Chan# Sensor Azimuth\n", " Ebat:12.3V Hbat:12.3V Rbat:11.9V\n", " Elevation: 158 M. DECL: 0.000\n", " Ex & Ey: MTU5A 2189 39 C\n", " Ex1 1 100.0 M 0.0 DGtn\n", " Ey1 2 100.0 M 90.0 DGtn\n", " FILE: IEB0537A IEB0564M\n", " Hx & Hy: MTU5A 2189 39 C\n", " Hx1 3 COIL2318 0.0 DGtn\n", " Hy1 4 COIL2319 90.0 DGtn\n", " Hz1 5 COIL2320\n", " Hz: MTU5A 2189 39 C\n", " Lat 22:49:254S Long 139:17:409E\n", " Lat 22:49.423 S Lng 139:17.681 E\n", " MTU-Box Gains:E`s x 4 H`s x 4\n", " MTU-DFT VERSION: TStoFT.38\n", " MTU-RBS VERSION:R2012-0216-B22\n", " MTU-Ref Serial Number: U-2779\n", " Notch Filters set for 50 Hz.\n", " PROCESSED FROM DFT TIME SERIES\n", " RBS: 7 COH: 0.85 RHO VAR: 0.75\n", " RHx2 6 COIL2485 0.0 DGtn\n", " RHy2 7 COIL2487 90.0 DGtn\n", " RUN INFORMATION\n", " Reference Field: Remote H - Ref.\n", " Reference Site: IEB0564M\n", " Rx & Ry: MTU5A 2779 40 C\n", " STATION 1\n", " SYSTEM INFORMATION\n", " Site Desc; BadR: 0 SatR: 54\n", " Site Layout by:\n", " Site Permitted by:\n", "\n", "\n", ">=DEFINEMEAS\n", " MAXCHAN=7\n", " MAXRUN=999\n", " MAXMEAS=7\n", " REFLAT=-22.823722\n", " REFLON=139.294694\n", " REFELEV=158.0\n", " REFTYPE=CART\n", " UNITS=M\n", "\n", ">HMEAS ID=5371.0537 CHTYPE=HX X=8.50 Y=8.50 Z=0.00 AZM=0.00 DIP=0.00 ACQCHAN=CH3\n", ">HMEAS ID=5372.0537 CHTYPE=HY X=-8.50 Y=8.50 Z=0.00 AZM=90.00 DIP=0.00 ACQCHAN=CH4\n", ">HMEAS ID=5373.0537 CHTYPE=HZ X=21.20 Y=-21.20 Z=0.00 AZM=0.00 DIP=0.00 ACQCHAN=CH5\n", ">EMEAS ID=5374.0537 CHTYPE=EX X=-50.00 Y=-0.00 Z=0.00 X2=50.00 Y2=0.00 Z2=0.00 AZM=0.00 ACQCHAN=CH1\n", ">EMEAS ID=5375.0537 CHTYPE=EY X=22.40 Y=-44.70 Z=0.00 X2=-22.40 Y2=44.70 Z2=0.00 AZM=116.62 ACQCHAN=CH2\n", ">HMEAS ID=5376.0537 CHTYPE=RRHX X=8.50 Y=45008.50 Z=0.00 AZM=0.00 DIP=0.00 ACQCHAN=CH6\n", ">HMEAS ID=5377.0537 CHTYPE=RRHY X=-8.50 Y=45008.50 Z=0.00 AZM=90.00 DIP=0.00 ACQCHAN=CH7\n", "\n", "\n", ">=MTSECT\n", " NFREQ=80\n", " SECTID=14-IEB0537A\n", " NCHAN=7\n", " MAXBLKS=80\n", " HX=5371.0537\n", " HY=5372.0537\n", " HZ=5373.0537\n", " EX=5374.0537\n", " EY=5375.0537\n", " RRHX=5376.0537\n", " RRHY=5377.0537\n", "\n", "\n" ] } ], "source": [ "print(edi_object.Header)\n", "print(edi_object.Info)\n", "print(edi_object.Measurement)\n", "print(edi_object.Data)" ] }, { "cell_type": "code", "execution_count": 6, "id": "444b4a64-0d30-4521-b667-537c0f6dfdb0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Station: 14-IEB0537A\n", "--------------------------------------------------\n", "\tSurvey: BOULIA\n", "\tProject: IEB\n", "\tAcquired by: Phoenix\n", "\tAcquired date: 2014-07-28\n", "\tLatitude: -22.824\n", "\tLongitude: 139.295\n", "\tElevation: 158.000\n", "\tDeclination: \n", "\t\tValue: 0.0\n", "\t\tModel: WMM\n", "\tCoordinate System: geographic\n", "\tImpedance: True\n", "\tTipper: True\n", "\tN Periods: 80\n", "\tPeriod Range:\n", "\t\tMin: 3.12500E-03 s\n", "\t\tMax: 2.94118E+03 s\n", "\tFrequency Range:\n", "\t\tMin: 3.40000E-04 Hz\n", "\t\tMax: 3.20000E+02 Hz\n" ] } ], "source": [ "print(tf_object)" ] }, { "cell_type": "code", "execution_count": 7, "id": "0cda5340-58de-4eec-af76-93aab3752ebc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{\n", " \"station\": {\n", " \"acquired_by.author\": \"Phoenix\",\n", " \"channels_recorded\": [\n", " \"ex\",\n", " \"ey\",\n", " \"hx\",\n", " \"hy\",\n", " \"hz\",\n", " \"rrhx\",\n", " \"rrhy\"\n", " ],\n", " \"comments\": \"CUTOFF: 0.00 COH: 35 % VAR: 25 %\\nComp MTU box S/N Temp\\nComp Chan# Sensor Azimuth\\nEbat:12.3V Hbat:12.3V Rbat:11.9V\\nElevation: 158 M. DECL: 0.000\\nEx & Ey: MTU5A 2189 39 C\\nEx1 1 100.0 M 0.0 DGtn\\nEy1 2 100.0 M 90.0 DGtn\\nFILE: IEB0537A IEB0564M\\nHx & Hy: MTU5A 2189 39 C\\nHx1 3 COIL2318 0.0 DGtn\\nHy1 4 COIL2319 90.0 DGtn\\nHz1 5 COIL2320\\nHz: MTU5A 2189 39 C\\nLat 22:49:254S Long 139:17:409E\\nLat 22:49.423 S Lng 139:17.681 E\\nMTU-Box Gains:E`s x 4 H`s x 4\\nMTU-DFT VERSION: TStoFT.38\\nMTU-RBS VERSION:R2012-0216-B22\\nMTU-Ref Serial Number: U-2779\\nNotch Filters set for 50 Hz.\\nPROCESSED FROM DFT TIME SERIES\\nRBS: 7 COH: 0.85 RHO VAR: 0.75\\nRHx2 6 COIL2485 0.0 DGtn\\nRHy2 7 COIL2487 90.0 DGtn\\nRUN INFORMATION\\nReference Field: Remote H - Ref.\\nReference Site: IEB0564M\\nRx & Ry: MTU5A 2779 40 C\\nSTATION 1\\nSYSTEM INFORMATION\\nSite Desc; BadR: 0 SatR: 54\\nSite Layout by:\\nSite Permitted by:\",\n", " \"data_type\": \"MT\",\n", " \"geographic_name\": null,\n", " \"id\": \"14-IEB0537A\",\n", " \"location.datum\": \"WGS84\",\n", " \"location.declination.model\": \"WMM\",\n", " \"location.declination.value\": 0.0,\n", " \"location.elevation\": 158.0,\n", " \"location.latitude\": -22.823722222222223,\n", " \"location.longitude\": 139.29469444444445,\n", " \"orientation.method\": null,\n", " \"orientation.reference_frame\": \"geographic\",\n", " \"provenance.creation_time\": \"2014-08-01T00:00:00+00:00\",\n", " \"provenance.software.author\": null,\n", " \"provenance.software.name\": \"Phoenix\",\n", " \"provenance.software.version\": \"MT-Editor Ver 0.99.2.106\",\n", " \"provenance.submitter.author\": \"Phoenix\",\n", " \"provenance.submitter.email\": null,\n", " \"provenance.submitter.organization\": null,\n", " \"release_license\": \"CC0-1.0\",\n", " \"run_list\": [\n", " \"14-IEB0537Aa\"\n", " ],\n", " \"time_period.end\": \"2014-07-28T23:38:25+00:00\",\n", " \"time_period.start\": \"2014-07-28T02:57:00+00:00\",\n", " \"transfer_function.coordinate_system\": \"geopgraphic\",\n", " \"transfer_function.id\": \"14-IEB0537A\",\n", " \"transfer_function.processed_date\": null,\n", " \"transfer_function.processing_parameters\": [\n", " \"processing_parameters=[XPR Weighting=RHO Variance.]\"\n", " ],\n", " \"transfer_function.remote_references\": [],\n", " \"transfer_function.runs_processed\": [\n", " \"14-IEB0537Aa\"\n", " ],\n", " \"transfer_function.sign_convention\": null,\n", " \"transfer_function.units\": null\n", " }\n", "}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tf_object.station_metadata" ] }, { "cell_type": "code", "execution_count": 8, "id": "73387d55-fefc-4055-8516-7a71d7a1ed83", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{\n", " \"survey\": {\n", " \"acquired_by.author\": \"Phoenix\",\n", " \"citation_dataset.doi\": null,\n", " \"citation_journal.doi\": null,\n", " \"datum\": \"WGS84\",\n", " \"geographic_name\": null,\n", " \"id\": \"BOULIA\",\n", " \"name\": null,\n", " \"northwest_corner.latitude\": 0.0,\n", " \"northwest_corner.longitude\": 0.0,\n", " \"project\": \"IEB\",\n", " \"project_lead.email\": null,\n", " \"project_lead.organization\": null,\n", " \"release_license\": \"CC0-1.0\",\n", " \"southeast_corner.latitude\": 0.0,\n", " \"southeast_corner.longitude\": 0.0,\n", " \"summary\": null,\n", " \"time_period.end_date\": \"1980-01-01\",\n", " \"time_period.start_date\": \"1980-01-01\"\n", " }\n", "}" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tf_object.survey_metadata" ] }, { "cell_type": "code", "execution_count": 9, "id": "8ecd1c81-88a4-49bc-b1d4-d2c3717efcf0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (period: 80, output: 5, input: 5)\n",
"Coordinates:\n",
" * period (period) float64 0.003125 ... 2.941e+03\n",
" * output (output) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
" * input (input) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
"Data variables:\n",
" transfer_function (period, output, input) complex128 (nan+na...\n",
" transfer_function_error (period, output, input) float64 nan ... nan\n",
" transfer_function_model_error (period, output, input) float64 nan ... nan\n",
" inverse_signal_power (period, output, input) complex128 (nan+na...\n",
" residual_covariance (period, output, input) complex128 (7.7123...\n",
"Attributes: (12/14)\n",
" survey: BOULIA\n",
" project: IEB\n",
" id: 14-IEB0537A\n",
" name: None\n",
" latitude: -22.823722222222223\n",
" longitude: 139.29469444444445\n",
" ... ...\n",
" datum: WGS84\n",
" acquired_by: Phoenix\n",
" start: 2014-07-28T02:57:00+00:00\n",
" end: 2014-07-28T23:38:25+00:00\n",
" runs_processed: ['14-IEB0537Aa']\n",
" coordinate_system: geographic<xarray.Dataset>\n",
"Dimensions: (period: 73, output: 5, input: 5)\n",
"Coordinates:\n",
" * period (period) float64 0.005155 ... 1.449e+03\n",
" * output (output) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
" * input (input) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
"Data variables:\n",
" transfer_function (period, output, input) complex128 (nan+na...\n",
" transfer_function_error (period, output, input) float64 nan ... nan\n",
" transfer_function_model_error (period, output, input) float64 nan ... nan\n",
" inverse_signal_power (period, output, input) complex128 (nan+na...\n",
" residual_covariance (period, output, input) complex128 0j ... 0j\n",
"Attributes: (12/14)\n",
" survey: None\n",
" project: None\n",
" id: GEO858\n",
" name: None\n",
" latitude: 22.691378333333333\n",
" longitude: 139.70504\n",
" ... ...\n",
" datum: WGS84\n",
" acquired_by: Metronix\n",
" start: 2014-08-17T04:58:00+00:00\n",
" end: 2014-08-17T20:03:00+00:00\n",
" runs_processed: ['GEO858a']\n",
" coordinate_system: geographic<xarray.Dataset>\n",
"Dimensions: (period: 73, output: 5, input: 5)\n",
"Coordinates:\n",
" * period (period) float64 0.001212 ... 1.212e+03\n",
" * output (output) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
" * input (input) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
"Data variables:\n",
" transfer_function (period, output, input) complex128 (nan+na...\n",
" transfer_function_error (period, output, input) float64 nan ... nan\n",
" transfer_function_model_error (period, output, input) float64 nan ... nan\n",
" inverse_signal_power (period, output, input) complex128 (nan+na...\n",
" residual_covariance (period, output, input) complex128 0j ... 0j\n",
"Attributes: (12/14)\n",
" survey: None\n",
" project: EGC\n",
" id: TEST01\n",
" name: None\n",
" latitude: -30.930285\n",
" longitude: 127.22923\n",
" ... ...\n",
" datum: WGS84\n",
" acquired_by: GSC_CGG\n",
" start: 2014-06-05T00:00:00+00:00\n",
" end: 1980-01-01T00:00:00+00:00\n",
" runs_processed: ['TEST01a']\n",
" coordinate_system: geographic<xarray.Dataset>\n",
"Dimensions: (period: 33, output: 5, input: 5)\n",
"Coordinates:\n",
" * period (period) float64 0.004196 0.005952 ... 209.7\n",
" * output (output) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
" * input (input) <U2 'ex' 'ey' 'hx' 'hy' 'hz'\n",
"Data variables:\n",
" transfer_function (period, output, input) complex128 (nan+na...\n",
" transfer_function_error (period, output, input) float64 nan ... nan\n",
" transfer_function_model_error (period, output, input) float64 nan ... nan\n",
" inverse_signal_power (period, output, input) complex128 (nan+na...\n",
" residual_covariance (period, output, input) complex128 (0.0062...\n",
"Attributes: (12/14)\n",
" survey: None\n",
" project: None\n",
" id: SAGE_2005\n",
" name: None\n",
" latitude: 35.55\n",
" longitude: -106.28333333333333\n",
" ... ...\n",
" datum: WGS84\n",
" acquired_by: Quantec Consulting\n",
" start: 2004-07-03T00:00:00+00:00\n",
" end: 2004-07-06T00:00:00+00:00\n",
" runs_processed: ['SAGE_2005a']\n",
" coordinate_system: geographic