Skip to content

Note on uncertainties handling between operands with matching/non-matching and propagate_to_all keys. #70

@toqduj

Description

@toqduj

Some general rules on what to expect when operating with (multiple) uncertainty estimates (GPT used for formatting):


1) When both operands only have propagate_to_all

  • Output keys: only {"propagate_to_all": ...}
  • Propagation: standard (uncorrelated) error propagation.

Example (mul):
R = A*Bσ_R^2 = (B σ_A)^2 + (A σ_B)^2
and store it under propagate_to_all.


2) One side has only propagate_to_all, the other has specific keys (e.g. poisson)

  • Output keys: only the specific keys (poisson, pixel_index, …).
    No propagate_to_all key in the result.
  • Meaning: propagate_to_all acts as a fallback contributor into those specific keys.

So if a has only propagate_to_all and b has poisson, then result.uncertainties["poisson"] includes:

  • a’s global uncertainty contribution
  • plus b’s poisson contribution
    combined in quadrature (after proper unit handling).

This exactly matches your “apply propagate_to_all to it, as expected”.


3) Both operands have matching non-propagate_to_all keys

  • Output keys: the matching keys
  • Propagation: by key, combining left+right contributions for that key (quadrature).

So poisson + poisson stays poisson and is combined correctly.


4) Both operands have non-matching non-propagate_to_all keys

  • Output keys: the union of keys (e.g. {"pixel_index", "poisson"})
  • Propagation: each key is propagated from the operand that owns it, without inventing NaNs and without trying to merge unrelated keys.

Concretely:

  • result["pixel_index"] comes only from the pixel_index source(s) (plus any global fallback if that operand only had propagate_to_all, per rule 2)
  • result["poisson"] comes only from the poisson source(s)

No “matching” happens, so no cross-key quadrature sum between unrelated sources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions