Measurement Data¶
This page describes the files a tracking fit reads and the machine state a model is put in. The fitters that read them are listed in Fit Families.
Measurement files¶
A tracking fit reads one parquet file per measurement. Each row is one marker on one turn.
Column |
Unit |
Content |
|---|---|---|
|
BPM or marker name, as in the model sequence |
|
|
Turn number. Any integer offset; the fitter shifts each file to start after the previous one |
|
|
Bunch the turn belongs to. Tracks never cross from one bunch to the next |
|
|
m |
Position |
|
1 |
Momentum, MAD-NG canonical (\(p_x / p_0\)) |
|
m² |
Variance of the position |
|
1 |
Variance of the momentum |
How the fitter reads a file:
Only rows whose
nameis a BPM in the fitted range, or a marker the fitter needs, are read.A missing row, or a missing value, is not compared: the reading gets weight zero.
A variance that is zero, negative or not finite also gives weight zero.
The momenta are compared only with
TrackingDataConfig.optimise_momenta=True.Start turns per bunch: arc-by-arc and AC-dipole marker fits track one turn and skip each bunch’s first and last turn; kicker fits start one track at the bunch’s first turn;
ACDSinusoidFittercuts each file into back-to-back tracks ofturns_per_trackturns.The file’s excited plane (
x,yorxy) is read from the data: a plane whose coordinates span less than 1e-12, or less than a tenth of the other plane’s span, counts as not excited. Only the excited planes are compared.
Marker rows¶
Some fitters start the tracking at a marker instead of a BPM. The file must then contain rows for that marker.
Fitter |
Marker rows |
|---|---|
The |
|
|
Turn boundary¶
The fitter puts the BPMs of each file in ring order, starting from the BPM each recorded turn
begins at. By default this is the first BPM row in the file. Set
MeasurementDetails.first_bpm when the file’s row order does not start there, for example
when marker rows are written after the BPMs.
Describing the files¶
MeasurementConfig maps each file to a
MeasurementDetails:
machine_stateModel globals (tune knobs, corrector kicks) the machine had for this file.
b2_errorsLHC dipole b2 error table; needs the tune knobs in
machine_state.machine_deltapMomentum offset of the beam in this file.
first_bpmBPM each recorded turn begins at (see above).
from pathlib import Path
from accelmo.tracking.config.models import MeasurementConfig, MeasurementDetails
measurement_config = MeasurementConfig(
{
Path("on_momentum.parquet"): MeasurementDetails(
machine_state=Path("knobs_on.txt"),
),
Path("off_momentum.parquet"): MeasurementDetails(
machine_state=Path("knobs_off.txt"),
machine_deltap=3e-4,
),
}
)
single_measurement_config() builds the same
mapping for a single file.
Machine state¶
A machine state is the set of name/value pairs a model is put in before fitting: quadrupole families, tune knobs and corrector kicks. A name is either
a MAD-X variable, such as
kbrqforkqtf.a12b1, oran element attribute
<element>.<attribute>, such asbr3.dhz2l4.kick. Element names are matched case-insensitively. Setting an attribute replaces its deferred expression with the number.
A state can be given in three forms
(resolve_machine_state()):
Form |
Content |
|---|---|
|
|
Knobs file (any suffix but |
One |
TFS corrector table ( |
Columns |
merge_machine_states() combines several states; later
ones override earlier ones.
Closed-orbit measurements¶
The POCO fitters take their data as Python objects, not files: see
ClosedOrbitSeries and User Guide.