Time-resolved neutron reflectometry with EIS correlation — extract timing intervals from EIS data, reduce neutron events by time slice, and process time-resolved measurements. Covers eis-intervals, simple-reduction, and eis-reduce-events tools. USE FOR: extracting EIS timing, reducing neutron event data, time-resolved analysis workflows. DO NOT USE FOR: fitting reduced data (see fitting skill) or data packaging (see data-packaging skill).
This workflow correlates Electrochemical Impedance Spectroscopy (EIS) timing with neutron reflectometry event data to produce time-resolved reflectivity curves. It runs in stages:
Parses EC-Lab .mpt files to extract timing boundaries for each EIS measurement,
producing a JSON file that maps wall-clock times to measurement intervals.
eis-intervals --data-dir /path/to/eis/data -o intervals.json
| Option | Default | Description |
|---|---|---|
--data-dir | (required) | Directory containing .mpt files |
--pattern | *C02_[0-9]*.mpt | Glob pattern to match EIS files |
--exclude | fit | Exclude files containing this string |
--resolution | per-file | per-file (one interval per file) or per-frequency (one per measurement) |
--hold-interval | — | Generate hold intervals of this duration (seconds) between EIS files |
-o, --output | stdout | Output JSON file path |
-q, --quiet | — | Suppress progress messages |
per-file (default): One interval per EIS file — use for reduction workflowsper-frequency: One interval per frequency measurement — for detailed analysisUse --hold-interval to create intervals during gaps between EIS measurements
(e.g., during potentiostatic hold periods):
eis-intervals --data-dir ./eis-data --hold-interval 30 -o intervals.json
{
"source_directory": "/path/to/eis/data",
"pattern": "*C02_[0-9]*.mpt",
"resolution": "per-file",
"n_intervals": 12,
"intervals": [
{
"label": "eis_1",
"filename": "sequence_1_..._PEIS_C02_1.mpt",
"interval_type": "eis",
"start": "2025-04-20T10:55:16.521000",
"end": "2025-04-20T11:05:06.361862",
"duration_seconds": 589.84,
"n_frequencies": 51
},
{
"label": "hold_gap_1_0",
"interval_type": "hold",
"start": "2025-04-20T11:05:06.361862",
"end": "2025-04-20T11:05:36.361862",
"duration_seconds": 30.0
}
]
}
Two reduction approaches are available, both requiring Mantid (typically via Docker):
Reduces the entire event file without time-slicing:
simple-reduction \
--event-file REF_L_218386.nxs.h5 \
--template template.xml \
--output-dir ./reduced
Uses lr_reduction.workflow.reduce() to produce combined reflectivity.
Output files:
REFL_{run}_combined_data_auto.txt — combined reflectivityreflectivity.txt — copy of combined file.last_reduced_set — metadata (run number)Splits events by EIS interval boundaries and reduces each slice:
eis-reduce-events \
--intervals intervals.json \
--event-file REF_L_218389.nxs.h5 \
--template template.xml \
--output-dir ./reduced_data
Options:
| Option | Default | Description |
|---|---|---|
--intervals | (required) | JSON file from eis-intervals |
--event-file | (required) | NeXus/HDF5 event data file |
--template | (required) | Reduction template XML |
--output-dir | ./reduced_data | Output directory |
--scan-index | 1 | Scan index within the template |
--theta-offset | 0.0 | Theta offset for reduction |
--tz-offset | 5.0 | Timezone offset (hours from UTC, e.g., 5.0 for EST) |
-v, --verbose | — | Debug logging |
Output files:
r{RUN}_{LABEL}.txt — reflectivity per interval (4 columns: Q, R, dR, dQ)r{RUN}_eis_reduction.json — reduction metadata with interval detailsreduction_options.json — all parameters for reproducibilityReduction tools require Mantid. Use Docker:
# Simple reduction
docker compose run analyzer simple-reduction \
--event-file /app/data/REF_L_218386.nxs.h5 \
--template /app/data/template.xml
# Time-resolved reduction
docker compose run analyzer eis-reduce-events \
--intervals /app/data/intervals.json \
--event-file /app/data/REF_L_218389.nxs.h5 \
--template /app/data/template.xml \
--output-dir /app/results/tnr
# 1. Extract EIS intervals (local machine)
eis-intervals \
--data-dir /Users/m2d/data/expt11/ec-data \
--hold-interval 30 \
-o intervals.json
# 2. Reduce events by time slice (Docker/Mantid cluster)
docker compose run analyzer eis-reduce-events \
--intervals /app/data/intervals.json \
--event-file /app/data/REF_L_218389.nxs.h5 \
--template /app/data/template.xml \
--output-dir /app/results/tnr
# 3. Fit individual time slices (local machine)
run-fit 218389 cu_thf
See docs/time-resolved-eis.md for detailed EIS data format documentation and cluster workflow examples.