EPD 数据解析与绘图工具
地球物理观测台站 .EPD 格式数据文件的解析与可视化工具,使用 uv 管理。
功能特性
- 多测项解析:自动识别任意数量的测项分量
- 跨日连续绘图:合并多天数据为连续时间序列
- 缺测标注:自动检测 NULL 值并用红色背景高亮
- 统计信息:每个子图右上角显示均值/最大/最小/缺测点数
- 按天输出:
--per-day模式逐天生成图像 - 中文显示:自动检测 Windows 系统中文字体
安装
# 克隆项目后安装
uv sync
使用方法
基本绘图(交互显示)
uv run epd-plot --data-dir data
指定日期范围,保存为 PNG
uv run epd-plot --data-dir data --start 20260410 --end 20260415 --output output/week.png
仅绘制某一测项
uv run epd-plot --data-dir data --channels 4312 --output output/temp.png
按天逐日输出
uv run epd-plot --data-dir data --per-day --output-dir output/daily
列出目录中所有测项代码
uv run epd-plot --data-dir data --list-channels
命令行参数
| 参数 | 说明 | 默认值 |
|---|---|---|
--data-dir |
EPD 数据目录 | ./data |
--start |
起始日期 YYYYMMDD | 最早文件 |
--end |
结束日期 YYYYMMDD | 最晚文件 |
--channels |
测项代码列表 | 全部 |
--output |
输出文件路径 | 交互显示 |
--output-dir |
按天输出目录 | ./output |
--per-day |
每天一张图 | — |
--figsize W H |
图像尺寸(英寸) | 16 8 |
--dpi |
输出分辨率 | 150 |
--fill-null |
显示缺测段红色背景标注 | 默认不显示 |
--list-channels |
列出测项代码 | — |
-v / --verbose |
详细日志 | — |
EPD 文件格式
[日期] [台站码] [仪器码] [采样率码] [测项数量N] [测项代码×N] [数据值×(N×样本数)]
示例:
20260410 11074 X4X1DQYQ2698 01 02 4312 4112 38.7723 1.220 38.7708 1.219 ...
- 采样率码
01= 分钟值(每天 1440 点) - 采样率码
02= 秒钟值(每天 86400 点) NULL/-NULL= 缺测
已知测项代码
| 代码 | 名称 | 单位 |
|---|---|---|
| 4112 | 静水位 | m |
| 4312 | 中层水温 | ℃ |
测项信息由内置配置文件字典
DEFAULT_CHANNELS管理。未在字典中注册的测项代码将默认使用代码本身作为显示名称。
配置文件字典与扩展
可通过修改 DEFAULT_CHANNELS 字典动态添加新测项映射:
from epd_parser_plotter import DEFAULT_CHANNELS
# 动态扩展/自定义测项配置字典
DEFAULT_CHANNELS["4212"] = {"name": "深层水温", "unit": "℃"}
Python API
from epd_parser_plotter import parse_epd_file, load_date_range, plot_components
# 解析单个文件
result = parse_epd_file("data/X4X1DQYQ2698_20260410.EPD")
print(result.metadata) # EpdMetadata
print(result.df.head()) # DataFrame
# 加载日期范围
df, meta = load_date_range("data", start_date="20260410", end_date="20260420")
# 绘图
plot_components(df, title="观测数据", output_path="output/plot.png")
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
epd_parser_plotter-0.1.2.tar.gz
(122.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epd_parser_plotter-0.1.2.tar.gz.
File metadata
- Download URL: epd_parser_plotter-0.1.2.tar.gz
- Upload date:
- Size: 122.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40ef1fb7a93c36e1dd2a2f7315fc90189b734e4c63dae3c967ca253e6b92efff
|
|
| MD5 |
147ae0a925db6b5bdad9c6adb4a4476a
|
|
| BLAKE2b-256 |
a40e527450fecbfbd9c204dd65a54b49d2faae3a24cc3464620d163cbc330057
|
File details
Details for the file epd_parser_plotter-0.1.2-py3-none-any.whl.
File metadata
- Download URL: epd_parser_plotter-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05743fb631f74db7e49eeef9d56b8d02fd63e9769cb3b2d3595ae28c6fe584b7
|
|
| MD5 |
7849315715afa04ee8ae6c06a332b4f2
|
|
| BLAKE2b-256 |
0c26924538330b292c504716d754220952b52215c3e37a070400501d545ff4b3
|