mth5.io package
Subpackages
- mth5.io.lemi package
- mth5.io.miniseed package
- mth5.io.nims package
- Submodules
- mth5.io.nims.gps module
- mth5.io.nims.header module
- mth5.io.nims.nims module
- NIMS
NIMS
NIMS.align_data()
NIMS.box_temperature
NIMS.check_timing()
NIMS.declination
NIMS.elevation
NIMS.end_time
NIMS.ex
NIMS.ex_metadata
NIMS.ey
NIMS.ey_metadata
NIMS.find_sequence()
NIMS.get_channel_response()
NIMS.get_stamps()
NIMS.has_data()
NIMS.hx
NIMS.hx_metadata
NIMS.hy
NIMS.hy_metadata
NIMS.hz
NIMS.hz_metadata
NIMS.latitude
NIMS.longitude
NIMS.make_dt_index()
NIMS.match_status_with_gps_stamps()
NIMS.n_samples
NIMS.read_nims()
NIMS.remove_duplicates()
NIMS.run_metadata
NIMS.start_time
NIMS.station_metadata
NIMS.to_runts()
NIMS.unwrap_sequence()
read_nims()
- mth5.io.nims.nims_collection module
- mth5.io.nims.response_filters module
- Module contents
GPS
GPSError
NIMS
NIMS.align_data()
NIMS.box_temperature
NIMS.check_timing()
NIMS.declination
NIMS.elevation
NIMS.end_time
NIMS.ex
NIMS.ex_metadata
NIMS.ey
NIMS.ey_metadata
NIMS.find_sequence()
NIMS.get_channel_response()
NIMS.get_stamps()
NIMS.has_data()
NIMS.hx
NIMS.hx_metadata
NIMS.hy
NIMS.hy_metadata
NIMS.hz
NIMS.hz_metadata
NIMS.latitude
NIMS.longitude
NIMS.make_dt_index()
NIMS.match_status_with_gps_stamps()
NIMS.n_samples
NIMS.read_nims()
NIMS.remove_duplicates()
NIMS.run_metadata
NIMS.start_time
NIMS.station_metadata
NIMS.to_runts()
NIMS.unwrap_sequence()
NIMSCollection
NIMSHeader
Response
read_nims()
- mth5.io.phoenix package
- Subpackages
- Submodules
- mth5.io.phoenix.phoenix_collection module
- mth5.io.phoenix.read module
- Module contents
ConfigJSON
ConfigJSON.auto_power_enabled
ConfigJSON.config
ConfigJSON.empower_version
ConfigJSON.fn
ConfigJSON.has_obj()
ConfigJSON.mtc150_reset
ConfigJSON.network
ConfigJSON.read()
ConfigJSON.receiver
ConfigJSON.schedule
ConfigJSON.station_metadata()
ConfigJSON.surveyTechnique
ConfigJSON.timezone
ConfigJSON.timezone_offset
ConfigJSON.version
PhoenixCollection
ReceiverMetadataJSON
ReceiverMetadataJSON.channel_map
ReceiverMetadataJSON.e1_metadata
ReceiverMetadataJSON.e2_metadata
ReceiverMetadataJSON.fn
ReceiverMetadataJSON.get_ch_index()
ReceiverMetadataJSON.get_ch_metadata()
ReceiverMetadataJSON.get_ch_tag()
ReceiverMetadataJSON.h1_metadata
ReceiverMetadataJSON.h2_metadata
ReceiverMetadataJSON.h3_metadata
ReceiverMetadataJSON.h4_metadata
ReceiverMetadataJSON.h5_metadata
ReceiverMetadataJSON.h6_metadata
ReceiverMetadataJSON.has_obj()
ReceiverMetadataJSON.read()
ReceiverMetadataJSON.run_metadata
ReceiverMetadataJSON.station_metadata
ReceiverMetadataJSON.survey_metadata
open_phoenix()
read_phoenix()
- mth5.io.usgs_ascii package
- Submodules
- mth5.io.usgs_ascii.usgs_ascii module
- Module contents
AsciiMetadata
AsciiMetadata.elevation
AsciiMetadata.end
AsciiMetadata.file_size
AsciiMetadata.fn
AsciiMetadata.get_component_info()
AsciiMetadata.latitude
AsciiMetadata.longitude
AsciiMetadata.n_channels
AsciiMetadata.n_samples
AsciiMetadata.read_metadata()
AsciiMetadata.run_id
AsciiMetadata.run_metadata
AsciiMetadata.sample_rate
AsciiMetadata.site_id
AsciiMetadata.start
AsciiMetadata.station_metadata
AsciiMetadata.survey_id
AsciiMetadata.survey_metadata
AsciiMetadata.write_metadata()
USGSascii
USGSasciiCollection
read_ascii()
- mth5.io.zen package
- Submodules
- mth5.io.zen.coil_response module
- mth5.io.zen.z3d_collection module
- mth5.io.zen.z3d_header module
- mth5.io.zen.z3d_metadata module
- mth5.io.zen.z3d_schedule module
- mth5.io.zen.zen module
- Zen
Z3D
Z3D.azimuth
Z3D.channel_metadata
Z3D.channel_number
Z3D.channel_response
Z3D.check_start_time()
Z3D.coil_number
Z3D.coil_response
Z3D.component
Z3D.convert_counts_to_mv()
Z3D.convert_gps_time()
Z3D.convert_mv_to_counts()
Z3D.counts2mv_filter
Z3D.dipole_filter
Z3D.dipole_length
Z3D.elevation
Z3D.end
Z3D.file_size
Z3D.fn
Z3D.get_UTC_date_time()
Z3D.get_gps_stamp_index()
Z3D.get_gps_time()
Z3D.latitude
Z3D.longitude
Z3D.n_samples
Z3D.read_all_info()
Z3D.read_z3d()
Z3D.run_metadata
Z3D.sample_rate
Z3D.start
Z3D.station
Z3D.station_metadata
Z3D.to_channelts()
Z3D.trim_data()
Z3D.validate_gps_time()
Z3D.validate_time_blocks()
Z3D.zen_response
Z3D.zen_schedule
ZenGPSError
ZenInputFileError
ZenSamplingRateError
read_z3d()
- Module contents
CoilResponse
Z3D
Z3D.azimuth
Z3D.channel_metadata
Z3D.channel_number
Z3D.channel_response
Z3D.check_start_time()
Z3D.coil_number
Z3D.coil_response
Z3D.component
Z3D.convert_counts_to_mv()
Z3D.convert_gps_time()
Z3D.convert_mv_to_counts()
Z3D.counts2mv_filter
Z3D.dipole_filter
Z3D.dipole_length
Z3D.elevation
Z3D.end
Z3D.file_size
Z3D.fn
Z3D.get_UTC_date_time()
Z3D.get_gps_stamp_index()
Z3D.get_gps_time()
Z3D.latitude
Z3D.longitude
Z3D.n_samples
Z3D.read_all_info()
Z3D.read_z3d()
Z3D.run_metadata
Z3D.sample_rate
Z3D.start
Z3D.station
Z3D.station_metadata
Z3D.to_channelts()
Z3D.trim_data()
Z3D.validate_gps_time()
Z3D.validate_time_blocks()
Z3D.zen_response
Z3D.zen_schedule
Z3DCollection
Z3DHeader
Z3DMetadata
Z3DSchedule
read_z3d()
Submodules
mth5.io.collection module
Phoenix file collection
Created on Thu Aug 4 16:48:47 2022
@author: jpeacock
- class mth5.io.collection.Collection(file_path=None, **kwargs)[source]
Bases:
object
A general collection class to keep track of files with methods to create runs and run ids.
- property file_path
Path object to file directory
- get_files(extension)[source]
Get files with given extension. Uses Pathlib.Path.rglob, so it finds all files within the file_path by searching all sub-directories.
- Parameters
extension (string or list) – file extension(s)
- Returns
list of files in the file_path with the given extensions
- Return type
list of Path objects
- get_runs(sample_rates, run_name_zeros=4, calibration_path=None)[source]
Get a list of runs contained within the given folder. First the dataframe will be developed from which the runs are extracted.
For continous data all you need is the first file in the sequence. The reader will read in the entire sequence.
For segmented data it will only read in the given segment, which is slightly different from the original reader.
- Parameters
sample_rates – list of sample rates to read, defaults to [150, 24000]
run_name_zeros (integer, optional) – Number of zeros in the run name, defaults to 4
- Returns
List of run dataframes with only the first block of files
- Return type
collections.OrderedDict
- Example
>>> from mth5.io.phoenix import PhoenixCollection >>> phx_collection = PhoenixCollection(r"/path/to/station") >>> run_dict = phx_collection.get_runs(sample_rates=[150, 24000])
- to_dataframe()[source]
Get a data frame of the file summary with column names:
survey: survey id
station: station id
run: run id
start: start time UTC
end: end time UTC
channel_id: channel id or list of channel id’s in file
component: channel component or list of components in file
fn: path to file
sample_rate: sample rate in samples per second
file_size: file size in bytes
n_samples: number of samples in file
sequence_number: sequence number of the file
instrument_id: instrument id
calibration_fn: calibration file
- Returns
summary table of file names,
- Return type
TYPE
mth5.io.reader module
This is a utility function to get the appropriate reader for a given file type and
return the appropriate object of mth5.timeseries
This setup to be like plugins but a hack cause I did not find the time to set this up properly as a true plugin.
If you are writing your own reader you need the following structure:
Class object that will read the given file
a reader function that is read_{file_type}, for instance read_nims
the return value is a
mth5.timeseries.MTTS
ormth5.timeseries.RunTS
object and any extra metadata in the form of a dictionary with keys as {level.attribute}.
class NewFile
def __init__(self, fn):
self.fn = fn
def read_header(self):
return header_information
def read_newfile(self):
ex, ey, hx, hy, hz = read_in_channels_as_MTTS
return RunTS([ex, ey, hx, hy, hz])
def read_newfile(fn):
new_file_obj = NewFile(fn)
run_obj = new_file_obj.read_newfile()
return run_obj, extra_metadata
Then add your reader to the reader dictionary so that those files can be read.
See also
Existing readers for some guidance found in mth5.io
Created on Wed Aug 26 10:32:45 2020
- author
Jared Peacock
- license
MIT
- mth5.io.reader.get_reader(extension)[source]
get the proper reader for file extension
- Parameters
extension (string) – file extension
- Returns
the correct function to read the file
- Return type
function
- mth5.io.reader.read_file(fn, file_type=None, **kwargs)[source]
This is the universal reader for MT time series. This will pick out the proper reader given the file type or extension. Keyworkd arguments will depend on the reader and file type.
- Parameters
fn (string or
pathlib.Path
) – full path to filefile_type (string) – a specific file time if the extension is ambiguous.
- Returns
channel or run time series object
- Return type
mth5.timeseries.MTTS
ormth5.timeseries.RunTS
Module contents
- class mth5.io.Collection(file_path=None, **kwargs)[source]
Bases:
object
A general collection class to keep track of files with methods to create runs and run ids.
- property file_path
Path object to file directory
- get_files(extension)[source]
Get files with given extension. Uses Pathlib.Path.rglob, so it finds all files within the file_path by searching all sub-directories.
- Parameters
extension (string or list) – file extension(s)
- Returns
list of files in the file_path with the given extensions
- Return type
list of Path objects
- get_runs(sample_rates, run_name_zeros=4, calibration_path=None)[source]
Get a list of runs contained within the given folder. First the dataframe will be developed from which the runs are extracted.
For continous data all you need is the first file in the sequence. The reader will read in the entire sequence.
For segmented data it will only read in the given segment, which is slightly different from the original reader.
- Parameters
sample_rates – list of sample rates to read, defaults to [150, 24000]
run_name_zeros (integer, optional) – Number of zeros in the run name, defaults to 4
- Returns
List of run dataframes with only the first block of files
- Return type
collections.OrderedDict
- Example
>>> from mth5.io.phoenix import PhoenixCollection >>> phx_collection = PhoenixCollection(r"/path/to/station") >>> run_dict = phx_collection.get_runs(sample_rates=[150, 24000])
- to_dataframe()[source]
Get a data frame of the file summary with column names:
survey: survey id
station: station id
run: run id
start: start time UTC
end: end time UTC
channel_id: channel id or list of channel id’s in file
component: channel component or list of components in file
fn: path to file
sample_rate: sample rate in samples per second
file_size: file size in bytes
n_samples: number of samples in file
sequence_number: sequence number of the file
instrument_id: instrument id
calibration_fn: calibration file
- Returns
summary table of file names,
- Return type
TYPE
- mth5.io.read_file(fn, file_type=None, **kwargs)[source]
This is the universal reader for MT time series. This will pick out the proper reader given the file type or extension. Keyworkd arguments will depend on the reader and file type.
- Parameters
fn (string or
pathlib.Path
) – full path to filefile_type (string) – a specific file time if the extension is ambiguous.
- Returns
channel or run time series object
- Return type
mth5.timeseries.MTTS
ormth5.timeseries.RunTS