磁地电数据的归档和可交换格式
项目描述
MTH5
MTH5是磁地电时间序列数据的一个HDF5数据容器,但可以扩展到其他数据类型。此包提供读取/写入/操作MTH5文件的工具。
MTH5使用h5py与HDF5文件交互,使用xarray以优雅的方式与数据交互,所有元数据使用mt_metadata。该项目与地震学综合研究所、美国地质勘探局和其他合作伙伴合作。IRIS联盟的设施由美国国家科学基金会(NSF)的地球科学推进地震设施(SAGE)奖(合作支持协议EAR-1851048)资助。USGS部分资金来自数据集成社区和IMAGe通过矿物资源计划。
- 版本: 0.4.7
- 免费软件:MIT许可证
- 文档: https://mth5.readthedocs.io。
- 示例: 点击上面的
Binder
徽章,Jupyter Notebook 示例在 docs/examples/notebooks - 建议引用:Peacock, J. R., Kappler, K., Ronan, T., Heagy, L., Kelbert, A., Frassetto, A. (2022) MTH5:用于磁大地电测时间序列数据、传递函数和傅里叶系数的存档和可交换数据格式,《计算机与地球科学》,162,doi:10.1016/j.cageo.2022.105102
功能
- 读取和写入为磁大地电测时间序列、传递函数和傅里叶系数格式化的HDF5文件。
- 用户可以从MTH5创建MTH5文件,获取/添加/删除站点、传递函数、傅里叶系数、运行、通道和过滤器以及所有相关元数据。
- 数据以xarray形式包含,可以同时容纳数据和元数据,并且数据按时间索引。
- 包含一些数据类型的读取器作为插件,具体如下
- Z3D
- NIMS BIN
- USGS ASCII
- LEMI
- StationXML + miniseed
简介
MTH5的目标是提供一个自描述的分层数据格式,用于工作、共享和存档。MTH5是在社区参与下合作开发的,并且逻辑上遵循了磁大地电测数据的收集方式。此模块提供了开源工具,用于与MTH5文件交互。
元数据遵循由IRIS-PASSCAL MT软件工作组提出的标准,并在MT元数据标准中记录。**注意**:如果您想评论或贡献,请查看问题或Slack。
MTH5格式
- 以下展示了MTH5的基本格式,其中元数据附加在每个级别。
MTH5文件版本0.1.0
MTH5文件版本0.1.0
是原始文件版本,其中Survey
是文件的最高级别。这有一些局限性,即只能在一个文件中保存一个Survey
,但如果您有多个想要存储的Surveys
,我们需要添加一个更高级别的Experiment
。
重要:一些MTH5 0.1.0
文件已经在ScienceBase上存档,并作为Aurora的工作格式使用,此处仅供参考。向前推进,新的格式将是0.2.0
,如下所述。
MTH5文件版本0.2.0
MTH5文件版本0.2.0
以Experiment
为顶级。这允许在单个文件中包含多个Survey
,因此提供了更大的灵活性。例如,如果您想在本地调查中远程引用来自不同调查的站点,并且这些站点是在同一时间收集的,您可以将所有这些调查和站点放在同一文件中,并使其更容易处理。
提示:MTH5进行了全面记录,因此如果您遇到任何问题,您始终可以检查mth5_debug.log(如果您处于调试模式,请在mth5.init中更改模式)和mth5_error.log,这些将被写入您当前的工作目录。
示例
创建一个简单的MTH5文件,包含一个站点、2个运行、2个通道、1个传递函数、1组傅里叶系数(版本0.2.0)
from mth5.mth5 import MTH5
with MTH5() as mth5_object:
mth5_object.open_mth5(r"/home/mt/example_mth5.h5", "a")
# add a survey
survey_group = mth5_object.add_survey("example")
# add a station with metadata
station_group = mth5_object.add_station("mt001", survey="example")
station_group = survey_group.stations_group.add_station("mt002")
station_group.metadata.location.latitude = "40:05:01"
station_group.metadata.location.longitude = -122.3432
station_group.metadata.location.elevation = 403.1
station_group.metadata.acquired_by.author = "me"
station_group.metadata.orientation.reference_frame = "geomagnetic"
# IMPORTANT: Must always use the write_metadata method when metadata is updated.
station_group.write_metadata()
# add runs
run_01 = mth5_object.add_run("mt002", "001", survey="example")
run_02 = station_group.add_run("002")
# add channels
ex = mth5_object.add_channel("mt002", "001", "ex", "electric", None, survey="example")
hy = run_01.add_channel("hy", "magnetic", None)
# add transfer functions
tf = station_group.transfer_functions_group.add_transfer_function("tf01")
# add Fourier Coefficients
fcs = station_group.fourier_coefficients_group.add_fc_group("fc01")
print(mth5_object)
/:
====================
|- Group: Experiment
--------------------
|- Group: Reports
-----------------
|- Group: Standards
-------------------
--> Dataset: summary
......................
|- Group: Surveys
-----------------
|- Group: example
-----------------
|- Group: Filters
-----------------
|- Group: coefficient
---------------------
|- Group: fap
-------------
|- Group: fir
-------------
|- Group: time_delay
--------------------
|- Group: zpk
-------------
|- Group: Reports
-----------------
|- Group: Standards
-------------------
--> Dataset: summary
......................
|- Group: Stations
------------------
|- Group: mt001
---------------
|- Group: Fourier_Coefficients
------------------------------
|- Group: Transfer_Functions
----------------------------
|- Group: mt002
---------------
|- Group: 001
-------------
--> Dataset: ex
.................
--> Dataset: hy
.................
|- Group: 002
-------------
|- Group: Fourier_Coefficients
------------------------------
|- Group: fc01
--------------
|- Group: Transfer_Functions
----------------------------
|- Group: tf01
--------------
--> Dataset: channel_summary
..............................
--> Dataset: tf_summary
.........................
致谢
本项目与 Incorporated Research Institutes of Seismology、美国地质勘探局和其他合作者合作。IRIS协会的设施得到了国家科学基金会地震学设施促进地球科学(SAGE)奖的资助,资助协议为 EAR-1851048。USGS的部分资金通过数据集成社区和IMAGe通过矿产资源计划获得。
历史
0.1.0 (2021-06-30)
- 首次发布在PyPI上。
0.2.0 (2021-10-31)
- 更新了MTH5的结构,使
Experiment
成为顶级 - 更新了测试
- 向后兼容性工作
- 更新了文档
0.2.5 (2022-04-07)
- 修复了错误
- 在站点级别添加了TransferFunctions和TransferFunction组,现在可以包含传递函数
- 添加了channel_summary和tf_summary表,如果文件在'w'模式下关闭,则会更新这些表
- 更新了测试
- 更新了文档
- 注意:由于DMC数据的一些重组,IRIS的make_mth5测试目前无法正常工作
0.2.6 (2022-07-01)
- 添加了校准函数
- 修复了一些小错误
- 更新了测试
- 更新了文档
0.2.7 (2022-09-14)
- 将IO模块重构为每个数据记录器类型创建一个模块
- 更新了测试
- 更新了文档
- 重构了
make_mth5
0.3.0 (2022-09-25)
- 将默认的initialize_mth5初始化模式更改为追加模式,由@kkappler在#94中提出的issue #92
- 通过@kkappler在PR #106中修复了issue 105
- 由@nre900在#110中添加了并行mth5教程
- 由@nre900在issue #112中添加了新的教程和mth5_in_parallel.ipynb的修改
- 由@kujaku11在PR #103中添加了phoenix读者
- 由@kujaku11在PR #100中移除了响应
0.3.1 (2023-01-18)
- 通过以下方式加快站点和调查验证:
- 由@nre900进行教程更新
- 移除指定默认值的kwarg
- 更新initialize_mth5
- 为ChannelTS和RunTS使用单个元数据对象
- 使用h5路径获取组和数据集
- 将wheel从0.33.6提升到0.38.1
0.4.0 (2023-09-29)
- 在https://github.com/kujaku11/mth5/pull/136中添加了add和merge到ChannelTS
- 在https://github.com/kujaku11/mth5/pull/82中添加了客户端,包括USGS地磁客户端
- 在https://github.com/kujaku11/mth5/pull/139中将Scipy过滤器添加到xarray中
- 在https://github.com/kujaku11/mth5/pull/137中修复了没有通道过滤器时的FDSN下载问题
- 在https://github.com/kujaku11/mth5/pull/141中在RunTS中对通道进行对齐
- 在https://github.com/kujaku11/mth5/pull/154中修复了没有所有运行时的FDSN下载问题
- 添加了存储处理软件估计的傅里叶系数的功能
- 更新了Phoenix读者
- 现在使用Loguru而不是内置的日志模块
- 修复了通道数据集的切片问题
0.4.1 (2023-11-08)
- 修复了一些小错误
- 移除了对pandas < 2的限制
0.4.3
- 通过@kkappler在https://github.com/kujaku11/mth5/pull/172中修复了issue 171
- 由@kkappler在https://github.com/kujaku11/mth5/pull/176中为没有通道的运行添加了try except
- 由@kkappler在https://github.com/kujaku11/mth5/pull/177中移除了对滤波校正操作的引用
- 由@kkappler在https://github.com/kujaku11/mth5/pull/174中修复了mt元数据问题173
- 由@kujaku11在https://github.com/kujaku11/mth5/pull/178中进行了笔记本更新
- 由@kkappler在https://github.com/kujaku11/mth5/pull/173中添加了(失败的)测试,该测试验证fc_metadata按预期更新
- 由@kkappler在https://github.com/kujaku11/mth5/pull/183中将return self添加到open_mth5()中
- 由@kkappler在https://github.com/kujaku11/mth5/pull/181中进行了修补
- 由@kkappler在https://github.com/kujaku11/mth5/pull/184中进行了修补
- 由@kujaku11在https://github.com/kujaku11/mth5/pull/192中更新了MTH5Tables处理dtype的方式
- 由@kkappler在https://github.com/kujaku11/mth5/pull/190中进行了修补
- 由@kkappler在https://github.com/kujaku11/mth5/pull/194中添加了合成时间序列
- 由@kujaku11在https://github.com/kujaku11/mth5/pull/195中进行了修补
- 由@kujaku11在https://github.com/kujaku11/mth5/pull/196中更新了tests.yml
- 由@kujaku11在https://github.com/kujaku11/mth5/pull/200中在测试上运行ipynb
0.4.5
- 由@kujaku11在https://github.com/kujaku11/mth5/pull/205中进行了Wtf
- 由 @kkappler 修复问题 191,在 https://github.com/kujaku11/mth5/pull/208
- 由 @kkappler 修复问题 191,在 https://github.com/kujaku11/mth5/pull/211
- 由 @kkappler 修复问题 209,在 https://github.com/kujaku11/mth5/pull/210
- 更新 station.py,由 @kujaku11,在 https://github.com/kujaku11/mth5/pull/215
- 由 @kkappler 提供的补丁,在 https://github.com/kujaku11/mth5/pull/206
- 由 @kkappler 修复问题 219,在 https://github.com/kujaku11/mth5/pull/222
- 由 @kkappler 修复问题 217,在 https://github.com/kujaku11/mth5/pull/218
- 尝试修复 #223,由 @kkappler,在 https://github.com/kujaku11/mth5/pull/224
- 由 @kkappler 添加更多多元功能,在 https://github.com/kujaku11/mth5/pull/228
- 由 @kkappler 修复问题 209a,在 https://github.com/kujaku11/mth5/pull/231
- 由 @kkappler 进行多元更新,在 https://github.com/kujaku11/mth5/pull/232
- 更新错误并添加功能,由 @kujaku11,在 https://github.com/kujaku11/mth5/pull/226
- 版本升级 v0.4.3 --> v0.4.4,由 @kujaku11,在 https://github.com/kujaku11/mth5/pull/216
0.4.6 (2024-08-16)
- 将 aurora 工具添加到 mth5,由 @kujaku11,在 https://github.com/kujaku11/mth5/pull/229
- 由 @kkappler 提供的补丁,在 https://github.com/kujaku11/mth5/pull/234
- 由 @kkappler 修复问题 233,在 https://github.com/kujaku11/mth5/pull/235
- 热修复合成电场极性 (#236),由 @kkappler,在 https://github.com/kujaku11/mth5/pull/237
0.4.7 (2024-09-30)
- 由 @kkappler 修复问题 191,在 https://github.com/kujaku11/mth5/pull/239
- 由 @kkappler 更新合成数据,在 https://github.com/kujaku11/mth5/pull/243
- 优化添加 TF,由 @kujaku11,在 https://github.com/kujaku11/mth5/pull/242
- 由 @kujaku11 提供的补丁,在 https://github.com/kujaku11/mth5/pull/244
- 版本升级 v0.4.6 --> v0.4.7,由 @kujaku11,在 https://github.com/kujaku11/mth5/pull/245
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。