Add error propagation estimates for BoxcarExtract and HorneExtract#286
Add error propagation estimates for BoxcarExtract and HorneExtract#286harry353 wants to merge 2 commits intoastropy:mainfrom
Conversation
|
Also currently working on issue #281 as well |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
==========================================
- Coverage 87.11% 86.68% -0.44%
==========================================
Files 15 15
Lines 1281 1419 +138
==========================================
+ Hits 1116 1230 +114
- Misses 165 189 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| def spectrum(self): | ||
| return self.__call__() | ||
|
|
||
| def _variance2d_from_image(self, image): |
There was a problem hiding this comment.
You can simplify uncertainty parsing because the _ImageParser._parse_image method always assures that the image.uncertainty attribute always exists, and is a subclass of astropy.nddata.NDUncertainty.
specreduce/extract.py
Outdated
| bkgrd_prof = models.Polynomial1D(2) | ||
|
|
||
| self.image = self._parse_image(image, variance, mask, unit, disp_axis) | ||
| var2d_q = self._var2d_as_quantity() |
There was a problem hiding this comment.
var2d_q is not used later in the code.
specreduce/extract.py
Outdated
|
|
||
| return RectBivariateSpline(x=bin_centers, y=np.arange(nrows), z=samples, kx=kx, ky=ky) | ||
|
|
||
| def _var2d_as_quantity(self) -> u.Quantity: |
There was a problem hiding this comment.
This utility method is not really needed. The HorneExtract._parse_image method already ensures that the image.uncertainty attribute exists and contains a VarianceUncertainty uncertainty.
This changes how uncertainties are handled in:
BoxcarExtract.__call__HorneExtract.__call__HorneExtract._fit_gaussian_spatial_profileas described in #282. Now they:
Also, I have added test scripts under the
testsdirectory, as well as a .ipynb file for the Horne case with some examples.