mth5.io.usgs_ascii.header

Created on Thu Aug 27 16:54:09 2020

author:

Jared Peacock

license:

MIT

Classes

AsciiMetadata

Container for all the important metadata in a USGS ascii file.

Module Contents

class mth5.io.usgs_ascii.header.AsciiMetadata(fn=None, **kwargs)[source]

Container for all the important metadata in a USGS ascii file.

Attributes

Description

survey_id

Survey name

site_id

Site name

run_id

Run number

site_latitude

Site latitude in decimal degrees WGS84

site_longitude

Site longitude in decimal degrees WGS84

site_elevation

Site elevation according to national map meters

start

Start time of station YYYY-MM-DDThh:mm:ss UTC

end

Stop time of station YYYY-MM-DDThh:mm:ss UTC

sample_rate

Sampling rate samples/second

n_samples

Number of samples

n_channels

Number of channels

coordinate_system

[ Geographic North | Geomagnetic North ]

chn_settings

Channel settings, see below

missing_data_flag

Missing data value

Chn_settings:

Keys

Description

ChnNum

site_id+channel number

ChnID

Component [ ex | ey | hx | hy | hz ]

InstrumentID

Data logger + sensor number

Azimuth

Setup angle of componet in degrees relative to coordinate_system

Dipole_Length

Dipole length in meters

logger[source]
property fn[source]
missing_data_flag[source]
coordinate_system = None[source]
ex_metadata[source]
ey_metadata[source]
hx_metadata[source]
hy_metadata[source]
hz_metadata[source]
channel_order = ['hx', 'ex', 'hy', 'ey', 'hz'][source]
national_map_url = 'https://epqs.nationalmap.gov/v1/json?x={0:.5f}&y={1:.5f}&units=Meters&wkid=4326&includeDate=False'[source]
property file_size[source]
property survey_id[source]
property run_id[source]
property site_id[source]
property latitude[source]
property longitude[source]
property elevation[source]

get elevation from national map

property start[source]
property end[source]
property n_channels[source]
property sample_rate[source]
property n_samples[source]
property survey_metadata[source]
property station_metadata[source]
property run_metadata[source]
get_component_info(comp)[source]
Parameters:

comp (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

read_metadata(fn=None, meta_lines=None)[source]

Read in a meta from the raw string or file. Populate all metadata as attributes.

Parameters:
  • fn (string) – full path to USGS ascii file

  • meta_lines (list) – lines of metadata to read

write_metadata(chn_list=['Ex', 'Ey', 'Hx', 'Hy', 'Hz'])[source]

Write out metadata in the format of USGS ascii.

return:

list of metadate lines.

Note

meant to use ‘

‘.join(lines) to write out in a file.