Tools to correlate EIS (Electrochemical Impedance Spectroscopy) timing with neutron scattering event data.
The workflow is designed to be run in two stages:
- Extract EIS intervals (can run on any machine)
- Filter/reduce neutron events (must run on Mantid cluster)
EIS files (.mpt) are EC-Lab ASCII format with:
- Header containing
Acquisition started on : MM/DD/YYYY HH:MM:SS.fff - Tab-separated data with
time/scolumn for elapsed time
Use eis-intervals to extract timing from EIS files into JSON:
eis-intervals --data-dir /path/to/eis/data --output intervals.jsonThis produces:
{
"source_directory": "/path/to/eis/data",
"n_intervals": 9,
"intervals": [
{
"filename": "sequence_1_..._PEIS_C02_1.mpt",
"start": "2025-04-20T10:55:16.521000",
"end": "2025-04-20T11:05:06.361862",
"duration_seconds": 589.84
},
...
]
}| Option | Description |
|---|---|
--data-dir |
Directory containing EIS .mpt files (required) |
--pattern |
Glob pattern to match files (default: *C02_?.mpt) |
--exclude |
Exclude files containing this string (default: fit) |
--output |
Output JSON file path (prints to stdout if not specified) |
--quiet |
Suppress progress messages |
Copy intervals.json and the scripts from scripts/mantid/ to the cluster.
python eis_filter_events.py \
--intervals intervals.json \
--event-file /SNS/REF_L/IPTS-XXXXX/nexus/REF_L_12345.nxs.h5 \
--output-dir ./filtered_eventsOutputs:
- One NeXus file per EIS interval
python eis_reduce_events.py \
--intervals intervals.json \
--event-file /SNS/REF_L/IPTS-XXXXX/nexus/REF_L_12345.nxs.h5 \
--template /SNS/REF_L/IPTS-XXXXX/shared/templates/template.xml \
--output-dir ./reduced_dataOutputs:
- Reflectivity text files (Q, R, dR, dQ) per interval
- Summary plot (
*_eis_summary.png) - Reduction metadata JSON
# On your local machine (with EIS data access)
eis-intervals \
--data-dir /Users/m2d/data/expt11/ec-data \
--output intervals.json
# Copy to Mantid cluster, then run:
python eis_reduce_events.py \
--intervals intervals.json \
--event-file /SNS/REF_L/IPTS-34347/nexus/REF_L_218281.nxs.h5 \
--template /SNS/REF_L/IPTS-34347/shared/templates/expt11.xml \
--output-dir ./expt11_reduced| File | Location | Description |
|---|---|---|
eis_interval_extractor.py |
analyzer_tools/ |
Extracts intervals → JSON |
eis_filter_events.py |
scripts/mantid/ |
Mantid script for filtering |
eis_reduce_events.py |
scripts/mantid/ |
Mantid script for reduction |
The eis-intervals tool supports two resolution modes:
One interval per EIS file - good for reduction workflows:
eis-intervals --data-dir /path/to/eis/data --resolution per-fileOne interval per frequency measurement - for detailed analysis:
eis-intervals --data-dir /path/to/eis/data --resolution per-frequency