Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom function to calculate error after ndcube rebin #702

Open
andyto1234 opened this issue May 9, 2024 · 1 comment
Open

Add custom function to calculate error after ndcube rebin #702

andyto1234 opened this issue May 9, 2024 · 1 comment

Comments

@andyto1234
Copy link
Contributor

Describe the feature

I was trying to rebin some EIS spectral data with propagate_uncertainties=True. I think because the error array is UnknownUncertainty with intensity measurement, it gave the following warning:
"UserWarning: self.uncertainty is of type UnknownUncertainty which does not support uncertainty propagation."

I got away by propagating the rebinned error myself and setting it externally. Would be great to allow custom operation on the uncertainty within NDCube rebin.

Proposed solution

Add custom operation on the uncertainty within NDCube rebin

@Cadair
Copy link
Member

Cadair commented May 9, 2024

What form do your uncertainties take? NDCube in theory delegates all the uncertainty propagation to Astropy's NDData.

From a quick skim of the Astropy docs, they directly support StdDevUncertainty and VarianceUncertainty.

If neither of those work, you could implement your own uncertainty class, I think a subclass of NDUncertainty with a custom propagate_<operation> method should do it?

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

No branches or pull requests

2 participants