mth5.clients.lemi
Client for creating MTH5 files from LEMI instrument data. Supports both LEMI-424 (long period, .txt) and LEMI-423 (broadband, .B423) files.
Created on Fri Oct 11 10:57:54 2024
@author: jpeacock
Attributes
Classes
Client for creating MTH5 files from LEMI instrument data. |
Module Contents
- class mth5.clients.lemi.LEMIClient(data_path, save_path=None, sample_rates=[1], mth5_filename='from_lemi.h5', **kwargs)[source]
Bases:
mth5.clients.base.ClientBaseClient for creating MTH5 files from LEMI instrument data.
Supports both LEMI-424 and LEMI-423 instruments: - LEMI-424: Long period data (.txt files, 1 Hz) - LEMI-423: Broadband data (.B423 files, 4000/2000/1000/500/250 Hz)
- Parameters:
data_path (str or pathlib.Path) – Path to directory containing LEMI files
save_path (str or pathlib.Path, optional) – Path to save MTH5 file, defaults to data_path
sample_rates (list, optional) – Sample rates to include, defaults to [1] Valid rates: - LEMI-424: [1] (long period only) - LEMI-423: [4000, 2000, 1000, 500, 250] (broadband, auto-detected from tick counter) To include all LEMI-423 rates: [4000, 2000, 1000, 500, 250]
mth5_filename (str, optional) – Name of output MTH5 file, defaults to “from_lemi.h5”
- Example:
>>> from mth5.clients import LEMIClient >>> # LEMI-424 data >>> lc = LEMIClient("/path/to/lemi424/data", sample_rates=[1]) >>> mth5_path = lc.make_mth5_from_lemi("Survey01", "MT001") >>> >>> # LEMI-423 data at 1000 Hz >>> lc = LEMIClient("/path/to/lemi423/data", sample_rates=[1000]) >>> mth5_path = lc.make_mth5_from_lemi("Survey01", "MT002") >>> >>> # LEMI-423 data, unknown sample rate (include all possible) >>> lc = LEMIClient("/path/to/lemi423/data", ... sample_rates=[4000, 2000, 1000, 500, 250]) >>> mth5_path = lc.make_mth5_from_lemi("Survey01", "MT003")
- make_mth5_from_lemi(survey_id, station_id, **kwargs)[source]
Create an MTH5 file from LEMI instrument data.
Works with both LEMI-424 (.txt) and LEMI-423 (.B423) files.
- Parameters:
survey_id (str) – Survey identifier
station_id (str) – Station identifier
kwargs (dict) – Additional keyword arguments passed to collection
- Returns:
Path to created MTH5 file
- Return type:
pathlib.Path
- Example:
>>> from mth5.clients import LEMIClient >>> lc = LEMIClient("/data/lemi423", sample_rates=[1000]) >>> mth5_file = lc.make_mth5_from_lemi("MySurvey", "MT001") >>> print(f"Created: {mth5_file}")
- make_mth5_from_lemi424(survey_id, station_id, **kwargs)[source]
Backward compatibility alias for make_mth5_from_lemi().
Deprecated since version 0.4.0: Use
make_mth5_from_lemi()instead. This method will be removed in version 1.0.0.