TF calibration

Fit acquired F/B histograms through one count model with beta fixed at one or free. Applied deadtime correction selects weighted corrected counts with retained measured/supplied variance; off/skipped correction uses raw Poisson. See Alpha calibration for assumptions, units, safeguards, conditional error meaning, and reference comparisons. The supplied dataset owns acquisition/grouping/correction facts; the request owns intent. Explicit periods use the existing acquired-period selector. Returned native domains retain detector membership, alignment, raw-bin windows, timing, and correction preflight outcomes without copying a mutable grouping table. TFCalibrationResult.excluded_indices retains the source’s authored exclusions once alongside the shared domains. Quick results retain forward_indices, backward_indices, and excluded_indices. All are immutable zero-based acquired-channel ordinals, independent of physical detector labels; an empty tuple means no exclusions, whereas None means uncaptured legacy context. JSON/project/workdir restoration preserves that distinction without refitting.

Shared TF count calibration with beta fixed at one or fitted.

class asymmetry.core.fitting.tf_calibration.TFEnvelope(*values)[source]

Declared candidate order, also used to resolve exact cost ties.

UNDAMPED = 'undamped'
EXPONENTIAL = 'exponential'
GAUSSIAN = 'gaussian'
STRETCHED = 'stretched'
class asymmetry.core.fitting.tf_calibration.TFCalibrationRequest(forward_group, backward_group, fit_beta=False, period=None, t_min=None, t_max=None, exclude=None, frequency_mhz=None, parameters=(), pulse_separation_us=None, minos=False)[source]

Intent applied to the supplied acquisition’s existing grouping/corrections.

period=None uses the supplied run; an explicit selector delegates to select_period. Parameter overrides use the existing count-model names. The amplitude is percent, frequency MHz, phase radians and rate inverse µs.

forward_group
backward_group
fit_beta = False
period = None
t_min = None
t_max = None
exclude = None
frequency_mhz = None
parameters = ()
pulse_separation_us = None
minos = False
__init__(forward_group, backward_group, fit_beta=False, period=None, t_min=None, t_max=None, exclude=None, frequency_mhz=None, parameters=(), pulse_separation_us=None, minos=False)
class asymmetry.core.fitting.tf_calibration.TFCalibrationResult(request, fit, source_run_number, period_number, source_file, ok, message, envelope=TFEnvelope.EXPONENTIAL, content_identity=None, excluded_indices=None)[source]

Complete fit and a separate calibration verdict; errors are conditional.

Successful minimisation can have unavailable/unreliable covariance. Free beta also requires the existing resolved-precession/error safeguards; fixed beta does not acquire those beta-identifiability gates or a fitted error. HESSE standard errors and optional MINOS offsets are separate summaries, conditional on fixed response, timing, weights, and this envelope. Neither includes envelope-selection uncertainty or guarantees interval coverage.

request
fit
source_run_number
period_number
source_file
ok
message
envelope = 'exponential'
content_identity = None
excluded_indices = None

Zero-based authored exclusions, independent of the retained effective bank members.

property n_bins_used[source]
property method[source]
property model[source]
property alpha[source]
property beta[source]
property beta_fixed[source]
property alpha_error[source]
property beta_error[source]
property alpha_beta_correlation[source]
__init__(request, fit, source_run_number, period_number, source_file, ok, message, envelope=TFEnvelope.EXPONENTIAL, content_identity=None, excluded_indices=None)
asymmetry.core.fitting.tf_calibration.fit_tf_calibration(dataset, request, *, envelope=TFEnvelope.EXPONENTIAL, cancel_callback=None)[source]

Fit one explicit envelope (exponential/common-phase by default).

Applied deadtime uses retained-variance weighted counts; off/skipped correction uses raw Poisson deviance. Input limitations raise FitInputError/ValueError; numerical failures retain the fit with ok=False. Cancellation raises FitCancelledError. This single-model operation does not select an envelope.

class asymmetry.core.fitting.tf_calibration.TFCalibrationSelection(candidates)[source]

All four candidate fits and their separate calibration/covariance states.

The recommendation uses minimum summed cost among usable candidates. Errors are conditional on each envelope and exclude model-selection uncertainty.

candidates
property selected[source]
__init__(candidates)
asymmetry.core.fitting.tf_calibration.select_tf_calibration(dataset, request, *, envelope_parameters=None, cancel_callback=None)[source]

Compare four envelopes on one prepared F/B count pair.

Request overrides constrain common parameters in every candidate. Damping overrides belong in envelope_parameters: Lambda for exponential, sigma for Gaussian, Lambda and stretch for stretched; none for undamped. All constraints are validated before fitting. Exact ties follow TFEnvelope order. A failed fit retains its result/message and does not remove other candidates; no usable candidate gives selected=None. Cancellation raises FitCancelledError, including between candidates, and returns no partial set.

Count-fit result extraction and immutable joint covariance ownership.

class asymmetry.core.fitting.count_results.CountFitDomain(group_id, detector_indices, time_us, raw_windows, alignment, bin_width_us, deadtime, background_preflight, acquired_sources=())[source]

Resolved bank selection on native timing, before any lifetime correction.

Raw windows use the cropped alignment coordinate; detector offsets map them to acquisition bins. Each output time is the centre of its contributing bins.

group_id
detector_indices
time_us
raw_windows
alignment
bin_width_us
deadtime
background_preflight
acquired_sources = ()

(flat offset, channel count, source, run, input ordinal, coefficient, data period, DAE period).

__init__(group_id, detector_indices, time_us, raw_windows, alignment, bin_width_us, deadtime, background_preflight, acquired_sources=())
asymmetry.core.fitting.count_results.count_fit_domain(group, dataset)[source]

Retain the selection resolved by the existing grouped-count input owner.

class asymmetry.core.fitting.count_results.CountFitParameter(name, value, min=-inf, max=inf, fixed=False)[source]

Immutable parameter specification/value; count scales are counts per bin.

Free TF overrides inherit default search bounds at infinite endpoints. Fixed overrides retain explicit endpoints without numerical search defaults. Finite endpoints and fixed values must respect physical parameter domains; fixed values must also lie within explicitly supplied endpoints.

name
value
min = -inf
max = inf
fixed = False
property unit[source]
__init__(name, value, min=-inf, max=inf, fixed=False)
class asymmetry.core.fitting.count_results.JointCountFit(parameters, covariance_parameters, covariance, covariance_accurate, objective, statistic, dof, success, message, domains=(), minos_intervals=())[source]

One complete joint solution, including every background and nuisance.

Covariance order contains unique free parameters only. Uncertainty is conditional curvature at unit change in deviance or weighted chi-square, without residual scaling. All fitted nuisances enter the covariance; fixed inputs and model selection do not. minos_intervals stores separate signed lower/upper offsets from each fitted value, at the unit-objective criterion. Availability does not certify coverage or model adequacy.

parameters
covariance_parameters
covariance
covariance_accurate
objective
statistic
dof
success
message
domains = ()
minos_intervals = ()
property uncertainty_status[source]
standard_error(name)[source]
correlation(first, second)[source]
property statistic_per_dof[source]
__init__(parameters, covariance_parameters, covariance, covariance_accurate, objective, statistic, dof, success, message, domains=(), minos_intervals=())
asymmetry.core.fitting.count_results.joint_count_fit(result, domains)[source]

Freeze the full minimizer solution, never reconstruct it from bank slices.

asymmetry.core.fitting.count_results.count_bank_view(result, observations, model_values, *, omit, statistic)[source]

Project a bank view from the complete joint solution for existing consumers.

A fresh count request prepares the retained acquired histograms with its current grouping and corrections. A failed cached asymmetry curve does not block that request after its grouping is repaired; the cached diagnosis remains history. Current unavailable corrections, missing acquired observations, and unsupported count likelihoods still receive their own diagnostics.

Applying and saving a captured result

Use the existing grouping-profile owner to apply a completed fit or selection:

from asymmetry.core.project.calibration import CalibrationRecord, apply_calibration
from asymmetry.core.project.schema import CURRENT_SCHEMA_VERSION, save_project

record = CalibrationRecord("calibration-1", result)
apply_calibration(profile, record)
state = {"schema_version": CURRENT_SCHEMA_VERSION, "datasets": [],
         "grouping_profiles": [profile.to_dict()]}
save_project(state, "calibration.asymp")

Restore the profile with GroupingProfile.from_dict after load_project. Calibration identities must be nonempty strings and are checked when a record is constructed, including during project restore. Both coefficient policies reference one frozen record; their scalar values and errors derive from its full fit. An unsuccessful selection may be retained in profile.calibration_records for diagnostics but cannot be applied. See Project files for source availability and history semantics.

Frozen applied TF calibration and its project-boundary codec.

Profiles retain history; coefficient policies point into the same frozen record. No source file is opened, fitted or reselected by persistence.

class asymmetry.core.project.calibration.CalibrationRecord(calibration_id, result, computation_revision=None)[source]

Stable identity of a captured fit or selection, including failed diagnostics.

calibration_id
result
computation_revision = None
property selected[source]
require_source()[source]

Resolve the recorded input for an explicit rerun, never during loading.

__init__(calibration_id, result, computation_revision=None)
class asymmetry.core.project.calibration.CalibratedCoefficient(record, envelope, coefficient)[source]

Read-only scalar compatibility view of one canonical applied candidate.

record
envelope
coefficient
property result[source]
property mode[source]
property value[source]
property error[source]
property method[source]
property source_run[source]
to_dict()[source]
__init__(record, envelope, coefficient)
class asymmetry.core.project.calibration.QuickCalibratedCoefficient(result)[source]

Scalar policy view backed by the workflow’s full captured quick result.

result
property mode[source]
property value[source]
property error[source]
property method[source]
property source_run[source]
to_dict()[source]
__init__(result)
asymmetry.core.project.calibration.restore_coefficient(data, records)[source]

Resolve one stored policy through the existing canonical result codecs.

asymmetry.core.project.calibration.apply_calibration_outcome(profile, outcome, projection=None)[source]

Commit a current workflow outcome without inventing provenance from numbers.

asymmetry.core.project.calibration.resolve_projection_calibrations(policies, grouping)[source]

Derive projection values and attribution from their coefficient owners.

class asymmetry.core.project.calibration.PreparedGrouping(payload)[source]

A detached grouping payload whose captured coefficient links are resolved.

payload
__init__(payload)
asymmetry.core.project.calibration.calibration_values(payload)[source]

Derive runtime coefficient views from canonical override transport at its boundary.

asymmetry.core.project.calibration.apply_calibration(profile, record)[source]

Apply a usable captured result to the existing profile policy owner.

asymmetry.core.project.calibration.calibration_payload(record)[source]

Encode candidates with shared acquisition/domain facts stored once.

asymmetry.core.project.calibration.restore_calibration(data)[source]

Validate canonical identities, constraints and covariance at the project boundary.

asymmetry.core.project.calibration.resolved_calibration_payload(profile)[source]

Capture active coefficient authorities, including an unapplied preview result.

A preview’s frozen coefficient can be authoritative before Apply commits it to profile history. The project codec separately requires that committed history.

asymmetry.core.project.calibration.profile_calibration_payload(profile, data)[source]

Capture history and references without storing a second scalar authority.

asymmetry.core.project.calibration.restore_profile_calibrations(data)[source]

Workflow calibration

Scripted calibration and CLI requests use the same core operations:

from asymmetry.core.io import load
from asymmetry.core.workflow import CalibrationOptions, ReductionSettings, calibrate_run, reduce_run

source = load("calibrant.nxs")
settings = ReductionSettings(deadtime="from_file", rebin=2)
outcome = calibrate_run(source, settings,
    CalibrationOptions("tf_calibration_fit", fit_beta=True, period=1, count_packing=4))
if outcome.alpha is not None:
    applied = ReductionSettings(alpha=outcome.record, deadtime="from_file")
    signal = reduce_run(target.run, applied)

CalibrationOptions.count_packing replaces the source’s fixed bunching factor for this TF operation; None inherits it and one requests native bins. It accepts positive integers and rejects booleans. Science settings.rebin does not affect calibration. Quick methods reject explicit calibration packing. See Explicit workflow and CLI calibration for window selection, incomplete trailing groups, and an example applying the record with independent science packing.

ReductionSettings.alpha accepts an authored scalar or a captured CalibrationRecord. effective_alpha and effective_alpha_source derive the applied scalar/identity; calibration exposes the record. The record is the authority for both alpha and beta. to_dict derives scalar output views and encodes the canonical block with the project nonfinite codec; from_dict restores it without fitting, source-file access, or a new identity. Old scalar/source-only settings do not acquire inferred joint records.

ReductionSettings.alpha also accepts a QuickCalibrationResult, preserving its shared typed estimate and source/pair/period/correction/timing context, including the contributor mapping for a mapped quick calculation. Such mapped results have no acquired-period ordinal; mapped_period_number retains the selected red/green set’s 1-based ordinal separately. A missing mapped-set identifier remains unknown; reading does not guess it from the coefficient. Combined acquired sources default to red for quick methods and record period 1. All methods require that source period’s histograms, rather than a cached curve backed by another period’s counts. calibration_source retains a matching selected cached curve when available; a source with held histograms alone has empty curve arrays. Period extraction retains the source Run identity without requiring duplicate run-number metadata. The quick_calibration view and JSON block retain that explicit operation; automatic legacy ratio settings remain scalar/source-only. Fixed beta one is applied authoritatively even when a target carries a historical nonunity beta.

Omitting the options argument in calibrate_run(source, settings) selects TF calibration fit with automatic four-envelope selection and beta fixed at one. Joint-beta requests require a single-pair source layout; projection layouts retain beta one and reject fit_beta=True at the shared workflow boundary. explicit_calibration_options owns this fresh explicit default. Passing CalibrationOptions() deliberately retains the automatic integral ratio; explicit diamagnetic, general, and ratio return the shared typed quick result with source/count context. TF with envelope=None selects all four; an explicit TFEnvelope constrains the actual fit. fit_tf_calibration also accepts envelope= directly and retains exponential as its default. Historical count_fit consumers retain their identity and exponential model. Parameter overrides and cancellation pass into the shared TF operation. Both workflow entries accept an optional boolean cancel_callback. A true return raises FitCancelledError through quick estimation, count preparation, TF minimisation, covariance scans, and candidate transitions; no partial outcome is returned. The lower-level quick estimator and count builder instead accept a raising cancel_check and propagate its exception unchanged. Individual native array operations complete before the next work-boundary check; see Alpha calibration for polling granularity. A failed/no-selection result can be emitted for diagnostics but cannot become applied settings. Scripting and AI-agent workflow documents CLI flags and independent source-period semantics.

Explicit script calibration delegates preparation and fitting to core owners.

asymmetry.core.workflow.calibration.supports_joint_calibration(method, *, projection_layout=False)[source]

Joint detector beta is supported by TF calibration on a single F/B pair.

class asymmetry.core.workflow.calibration.CalibrationOptions(method=None, fit_beta=False, envelope=None, period=None, frequency_mhz=None, parameters=(), exclude=None, minos=False, pulse_separation_us=None, count_packing=None)[source]

Explicit operation; an omitted method preserves the automatic ratio policy.

TF with no envelope selects among TFEnvelope in declared order. Parameter constraints use the shared TF request vocabulary. Period is the source’s acquired period, independent of a target ReductionSettings.period.

count_packing is a TF-only positive integral number of native bins per fitted observation. None inherits source binning; an explicit factor replaces it with fixed packing (one requests native bins). It is independent of ReductionSettings.rebin. Quick methods retain their native-window estimator.

method = None
fit_beta = False
envelope = None
period = None
frequency_mhz = None
parameters = ()
exclude = None
minos = False
pulse_separation_us = None
count_packing = None
__init__(method=None, fit_beta=False, envelope=None, period=None, frequency_mhz=None, parameters=(), exclude=None, minos=False, pulse_separation_us=None, count_packing=None)
asymmetry.core.workflow.calibration.calibrate_run(loaded, settings, options=None, *, cancel_callback=None)[source]

Calibrate source histograms; TF requires one acquired period.

Explicit TF requests on multi-period acquisitions require a selected acquired period. The historical ratio uses red for a difference and preserves its single-period source adaptation. Corrections/timing come from the source profile; TF owns its own native-window and fitted-background preparation. options.count_packing controls TF count packing; settings.rebin applies only to science reduction and is not composed with calibration bins. cancel_callback returns true to request cooperative exit. Preparation, quick estimation, TF solver/covariance and candidate boundaries poll it; cancellation raises FitCancelledError without an outcome.

asymmetry.core.workflow.calibration.explicit_calibration_options(options=None)[source]

Resolve omitted explicit-operation intent without altering automatic policies.

asymmetry.core.workflow.calibration.calibrate_source(dataset, options=None, *, t_min=None, t_max=None, reference_resolver=None, cancel_callback=None)[source]

Calibrate an identified source with its fully resolved grouping and corrections.

Front ends resolve source selection/profile through their existing owners. This boundary never replaces those policies with CLI reduction defaults. cancel_callback has the same boolean/exception contract as calibrate_run; raised cancellation is never an unavailable coefficient or partial selection.

asymmetry.core.workflow.calibration.calibration_source(loaded, settings, options)[source]

Resolve a source period separately from target reduction and cached views.

Keep the selected cached curve when available; a held-only acquisition has empty curve arrays, so a parent’s curve cannot acquire another period’s label.

Workflow views of shared calibration results and immutable quick context.

class asymmetry.core.workflow.calibration_results.QuickCalibrationResult(estimate, run_number, forward_group, backward_group, period_number, source_file, corrections, alignment, window, bin_width_us, t0_time_us, period_mapping=(), mapped_period_number=None, computation_revision=None, content_identity=None, forward_indices=None, backward_indices=None, excluded_indices=None)[source]

One shared estimate, plus the source facts needed to interpret/replay it.

estimate
run_number
forward_group
backward_group
period_number
source_file
corrections
alignment
window
bin_width_us
t0_time_us
period_mapping = ()
mapped_period_number = None
computation_revision = None
content_identity = None
forward_indices = None

Zero-based acquired-channel indices; None denotes uncaptured legacy membership.

backward_indices = None
excluded_indices = None
to_dict()[source]

Export shared result fields and source context without histogram arrays.

classmethod from_dict(data)[source]

Restore the shared typed estimate and existing correction/timing owners.

__init__(estimate, run_number, forward_group, backward_group, period_number, source_file, corrections, alignment, window, bin_width_us, t0_time_us, period_mapping=(), mapped_period_number=None, computation_revision=None, content_identity=None, forward_indices=None, backward_indices=None, excluded_indices=None)
class asymmetry.core.workflow.calibration_results.CalibrationOutcome(result)[source]

A shared typed result with source/pair context, without copied coefficients.

result
property record[source]
property selected[source]
property alpha[source]
property message[source]
property method[source]
property source[source]

The first candidate owns common source facts even without a selection.

property run_number[source]
property period_number[source]
property forward_group[source]
property backward_group[source]
to_dict()[source]

Derive scalar views; preserve the canonical block before JSON sanitising.

__init__(result)

Reduce a run to forward/backward asymmetry, exactly as the GUI does.

The one rule this module exists to enforce: a scripted reduction and the desktop application must produce the same numbers. So it goes through the same path a freshly opened project does — a GroupingProfile built from the loader’s own grouping payload, policies applied by resolve_effective_grouping(), then the reduce_grouped_asymmetry() chokepoint — rather than re-deriving the grouping or the corrections here.

asymmetry.core.workflow.reduction.ALPHA_ESTIMATED_PREFIX = 'estimated:'

this, then the run number.

Type:

ReductionSettings.alpha_source for alpha estimated on a run

asymmetry.core.workflow.reduction.BACKGROUND_MODES = ('none', 'range', 'tail_fit')

Background treatments. range averages exact authored acquisition bins or a supported automatic pre-t0 default; tail_fit fits a flat rate under the late-time decay (pulsed sources). The fixed and reference-run modes are grouping-window work, not CLI work.

asymmetry.core.workflow.reduction.DEADTIME_MODES = ('off', 'from_file')

Deadtime treatments a scripted reduction offers. off is the GUI’s fresh-run default; from_file uses each run’s own per-detector values. The manual/estimate modes are grouping-window work, not CLI work.

asymmetry.core.workflow.reduction.GREEN_MINUS_RED = 'green_minus_red'

The period selector for the green − red difference of a two-period run.

class asymmetry.core.workflow.reduction.ReductionSettings(alpha=1.0, alpha_source='assumed', deadtime='off', background='none', background_range=None, pair=None, t0_offset_bins=0, t_good_offset_bins=None, rebin=1, t_min=None, t_max=None, period=None)[source]

The choices that turn a loaded run into an asymmetry curve.

Defaults match the GUI’s fresh-run defaults: alpha 1.0, no deadtime correction, no background subtraction, the file’s own detector pair, t0 and good-bin window, no bunching and no time window.

alpha also accepts a canonical CalibrationRecord; its two coefficients are applied together, without storing another scalar/covariance authority.

alpha_source records where alpha came from so a later summary can say so: "assumed" (nobody measured it), "estimated:<run>" (a per-run estimate on that calibration run) or "user".

pair names the forward and backward groups by the file’s group names or ids; t0_offset_bins shifts every detector’s file t0; and t_good_offset_bins is a signed first-bin offset from effective t0 — the grouping window’s Manual t0 and t_good offset modes. period selects one period, or GREEN_MINUS_RED for the difference of a two-period run.

alpha = 1.0
alpha_source = 'assumed'
deadtime = 'off'
background = 'none'
background_range = None
pair = None
t0_offset_bins = 0
t_good_offset_bins = None
rebin = 1
t_min = None
t_max = None
period = None
property calibration[source]

The captured result, when alpha is supplied by explicit TF calibration.

property quick_calibration[source]

Explicit shared quick result/context; historical scalar settings stay scalar.

property effective_alpha[source]

Applied alpha derived from the captured result or authored scalar.

property effective_alpha_source[source]

Canonical identity for TF calibration; historical source text otherwise.

to_dict()[source]

Serialize to a plain, JSON-safe dict (round-trips via from_dict()).

classmethod from_dict(data)[source]

Reconstruct settings from to_dict() output.

__init__(alpha=1.0, alpha_source='assumed', deadtime='off', background='none', background_range=None, pair=None, t0_offset_bins=0, t_good_offset_bins=None, rebin=1, t_min=None, t_max=None, period=None)
asymmetry.core.workflow.reduction.estimate_alpha_for_run(run, settings)[source]

Return the historical per-run integral ratio, including red for a difference.

This policy is separate from explicit quick and TF calibration methods.

asymmetry.core.workflow.reduction.load_reduction_source(paths, period)[source]

The dataset reduce_run() starts from for one run file, or the co-add of several.

Several files are summed at the count level exactly as the GUI’s data browser co-adds (combine_runs()), each member first narrowed to period. The sum is identified as its first member — it keeps that run’s number, master condition labels, and instrument metadata, together with constituent values and active ranges in its combination provenance. Raises CombineError (a ValueError) when the members cannot be summed.

asymmetry.core.workflow.reduction.reduce_run(run, settings)[source]

Reduce run to a MuonDataset under settings.

With default settings the result is identical to the loader’s own reduction of the same file: the profile is built from the loader’s grouping payload, so the groups, t0, good-bin window and alpha are the file’s own. For GREEN_MINUS_RED run is the combined two-period run and each period is reduced alone before the difference is formed. rebin merges recorded bins at the count level before the ratio is formed; the time window selects that final curve’s bin centres. Correction uses their contributing raw samples plus active estimators. Authored merging does not request spectral analysis; sampling checks belong to spectral operations.

asymmetry.core.workflow.reduction.reduction_source(loaded, period)[source]

The dataset reduce_run() starts from in a loader’s result.

The first dataset without a period; the named period with one; and the combined two-period dataset itself for GREEN_MINUS_RED, whose two periods reduce_run() reduces separately.

asymmetry.core.workflow.reduction.resolve_reduction_grouping(run, settings)[source]

The full grouping payload reduce_run() will reduce run with.

Exposed separately so a caller can digest the resolved grouping (the work directory keys its cache on it) without performing the reduction. For the green − red difference it is the red period’s, which the green shares.

calibrate_source accepts an identified source with its fully resolved grouping. The GUI uses this seam for manual/estimated deadtime and fixed/reference background policies that the CLI settings vocabulary cannot express. It shares preparation, results, cancellation, and scientific support with calibrate_run.

GUI application uses the same captured outcomes. Quick policies retain the full QuickCalibrationResult context through QuickCalibratedCoefficient. GroupingProfile.projection_alpha_policies associates each projection label with its own captured coefficient; TF views reference the profile’s canonical history. Each projection keeps beta fixed at one. Runtime scalar views are derived from these owners, including released-run override application and persistence. Projection value, error, method and source views update together; a manual override removes the previous measurement’s attribution rather than retaining its error or reference run.

reduce_run(run, settings) honours the authored count merge without spectral analysis. TF count preparation honours the fixed grouping factor; a selection with no complete fit bin raises the existing count-domain diagnostic before unused correction preflight. The raw run and stored historical results remain unchanged. See Count-domain fitting (α calibration & single histograms).

For workflow reduction, implicit settings inherit a selected projection’s alpha. An explicit calibration result or authored scalar overrides the requested pair; other projections retain their own policies and beta one. Use ReductionSettings(alpha=1.0, alpha_source="user") for authored unity; nondefault scalar values are explicit. A joint-beta record cannot be applied to a declared projection. A scalar pair outside the projections retains both coefficients, including the captured beta. Reduction cache identity includes the pair-balance policy so cached curves and reported coefficients agree.

Fixed count-pulse input

fit_single_histogram and fit_fb_alpha accept Parameter("dpsep", value, fixed=True) in µs. The supplied separation must be finite and nonnegative; a free parameter or one with a following link/constraint raises PulseRequestError with fixed-input guidance. The double-delta model consumes no finite-width input. See Count-domain fitting (α calibration & single histograms) for its origin, survival weighting, conditional errors, and onset limitations.

Fixed supplied TF calibration response

TF requests and workflow CalibrationOptions accept pulse_separation_us: None means Off, while finite nonnegative values supply a fixed equal-incident double-delta response, including the causal zero-separation limit. Every candidate retains this request and a fixed dpsep in the effective fit. It never enters the free covariance order. Ordinary normalised response composition must not be applied again to these count models. Counts are evaluated at packed-bin centres, without rate integration. Backgrounds occur once; birthless predictions may be background-only. See Alpha calibration for the equations and conditional error/approximation limits.

Beta calibration

class asymmetry.core.fitting.beta_calibration.BetaEstimate(beta, beta_error, alpha, alpha_error, alpha_beta_correlation, method, n_bins_used, reduced_chi2, ok, message='')[source]

Result of a backward-amplitude balance (β) estimation.

beta_error / alpha_error are conditional joint HESSE standard errors for count_fit, or first-order propagated fitted errors for single_histogram; None means unavailable. No interval coverage is guaranteed. alpha_beta_correlation is the Pearson correlation of the fitted α and β from the joint fit’s covariance block for the "count_fit" method, and None for "single_histogram" (two independent fits do not report covariance between their derived ratios). reduced_chi2 is Poisson deviance or weighted chi-square per joint dof for count_fit (unique free parameters), or pooled per-side deviance/dof for single_histogram.