# set to true if you want to interact with the mth5 object in the console interact = False nims_dir = "path/to/nims/file.bin" h5_fn = "from_nims.mth5" if h5_fn.exists(): h5_fn.unlink() print(f"INFO: Removed existing file {h5_fn}") # need to unzip the data with zipfile.ZipFile(nims_dir.joinpath("nims.zip"), "r") as zip_ref: zip_ref.extractall(nims_dir) processing_start = MTime() processing_start.now() # write some simple metadata for the survey survey = metadata.Survey() survey.acquired_by.author = "MT Master" survey.archive_id = "TST01" survey.archive_network = "MT" survey.name = "test" m = mth5.MTH5() m.open_mth5(h5_fn, "w") # add survey metadata survey_group = m.survey_group survey_group.metadata.from_dict(survey.to_dict()) survey_group.write_metadata()
:license: MIT """ # ============================================================================= # Imports # ============================================================================= import zipfile from mth5 import read_file from mth5 import mth5 from mt_metadata import timeseries as metadata from mt_metadata.utils.mttime import MTime start = MTime() start.now() # ============================================================================= # # ============================================================================= # set to true if you want to interact with the mth5 object in the console interact = True zen_dir = "path/to/s3d/files" h5_fn = "from_zen.h5" if h5_fn.exists(): h5_fn.unlink() print(f"INFO: Removed existing file {h5_fn}") # need to unzip the data with zipfile.ZipFile(zen_dir.joinpath("zen.zip"), "r") as zip_ref: zip_ref.extractall(zen_dir)