Skip to content

consistency between loaded data values and arrays, enforcing metadata#41

Closed
toqduj wants to merge 4 commits intomainfrom
data-loading-with-units-and-variance
Closed

consistency between loaded data values and arrays, enforcing metadata#41
toqduj wants to merge 4 commits intomainfrom
data-loading-with-units-and-variance

Conversation

@toqduj
Copy link
Collaborator

@toqduj toqduj commented May 24, 2025

We need a way to ensure loaded data (e.g. a photon flux or wavelength, but also flat field arrays) come with units and variance.

With this change, every IoSource has to ensure loaded data comes with some sort of unit and variance. This way, the processsteps can operate on BaseData elements and propagate units and uncertainties (in the form of variance propagation).

@toqduj toqduj marked this pull request as draft May 25, 2025 09:38
# data, units and variance are required
value: np.ndarray = field(validator=v.instance_of(np.ndarray))
units: pint.Unit = field(validator=v.instance_of(ureg.Unit))
variance: pint.Unit = field(validator=v.instance_of(ureg.Unit))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't variance be a np.ndarray as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but with the changes to BaseData, sourceData should become redundant again..

@toqduj toqduj mentioned this pull request Jun 4, 2025
@toqduj toqduj closed this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants