Example #1
0
    m.station_metadata.provenance.software.name = "MTpy"
    m.station_metadata.provenance.software.version = "metadata branch"
    m.station_metadata.provenance.submitter.author = "Jared Peacock"
    m.station_metadata.provenance.submitter.email = "*****@*****.**"
    m.station_metadata.provenance.submitter.organization = "U.S. Geological Survey"
    m.station_metadata.transfer_function.processed_date = "2020-10-01"
    m.station_metadata.transfer_function.processing_parameters = []
    m.station_metadata.transfer_function.remote_references = []
    m.station_metadata.transfer_function.sign_convention = "+"
    m.station_metadata.transfer_function.units = (
        "millivolts_per_kilometer_per_nanotesla"
    )
    m.station_metadata.transfer_function.software.author = "Alan Chave"
    m.station_metadata.transfer_function.software.name = "BIRRP 5.2.1"
    if "um" not in m.station:
        m.station = f"um{m.station}"

    m.ex_metadata.channel_id = 4.0
    m.ex_metadata.channel_number = 4
    m.ex_metadata.contact_resistance.end = sdf.ex_cres_start
    m.ex_metadata.contact_resistance.start = sdf.ex_cres_end
    m.ex_metadata.measurement_azimuth = sdf.ex_azimuth
    m.ex_metadata.dipole_length = sdf.ex_length
    m.ex_metadata.negative.manufacturer = "Borin"
    m.ex_metadata.negative.model = "Stelth 1"
    m.ex_metadata.negative.name = "Ag-AgCl"
    m.ex_metadata.positive.manufacturer = "Borin"
    m.ex_metadata.positive.model = "Stelth 1"
    m.ex_metadata.positive.name = "Ag-AgCl"
    m.ex_metadata.translated_azimuth = (
        m.ex_metadata.measurement_azimuth
Example #2
0
"""
Created on Mon Nov 30 15:43:54 2020

:author: Jared Peacock

:license: MIT

"""

from pathlib import Path
import pandas as pd
from mtpy.core.mt import MT

epath = Path(r"c:\Users\jpeacock\Documents\milipitas")
spath = Path(r"c:\Users\jpeacock\Documents\milipitas\new_edis")
loc_fn = Path(r"c:\Users\jpeacock\Documents\milipitas\latlon_NAD83.txt")

df = pd.read_csv(loc_fn)

for fn in epath.glob("*.edi"):
    m = MT(fn)
    m.station = f"{m.station}_{fn.stem}"
    l = df[df.Station == fn.stem]
    m.latitude = l.Latitude.values[0]
    m.longitude = l.Longitude.values[0]
    m.elevation = l.Elevation.values[0]
    m.write_mt_file(save_dir=spath)

    p = m.plot_mt_response(plot_num=2)
    p.save_plot(spath.joinpath(f"{m.station}.png").as_posix(), fig_dpi=300)