mertisreader
mertisreader
mertisreader reads ESA BepiColombo MERTIS data from plain Python. It loads instrument data packs, assembles frames and wavelength grids, exposes metadata, and validates PDS4 labels — without requiring the original notebook-based workflow.
Installation
Use a Python virtual environment or conda environment, then install the package:
pip install mertisreaderWhile the migration is in progress, an editable install from the repository is also supported:
python -m pip install -e .Quickstart
import pathlib
import mertisreader as mr
input_path = pathlib.Path(
"data/bcmer_tm_all_START-20200409T000000_END-20200410T000000_CRE-20240717T132010-ParamEventBootSciHK-short/cal"
)
reader = mr.MERTISDataPackReader(
input_dir=input_path,
output_dir="/tmp",
log_level="INFO",
)
reader.data_collector()
reader.data_assembler()See the Getting Started tutorial for a full, executable walkthrough including lazy loading.
What You Can Do
- Read MERTIS data packs —
MERTISDataPackReadercollects, inspects, and assembles calibration and science data in a few calls. - Load large datasets lazily —
LazyArrayandLazyCSVLoaderkeep I/O deferred until data is explicitly materialized. - Validate PDS4 labels —
validate_pds4_labeland helpers extract and check metadata from PDS4 XML labels. - Work with frames directly — utilities for RAW axis-order normalization, frame dimensions, interpolation targets, and frame assembly.
Learn More
- Follow the Getting Started tutorial for a short guided walkthrough.
- Explore the other Tutorials: example workflow, core reader, lazy loading, frame utilities, and PDS4 validation.
- Open the API Reference for the generated function and class docs.
- Try the example notebook in examples/read_merstis_test.ipynb.