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

Error propagation within msaexp #51

Open
themiyan opened this issue Nov 2, 2023 · 1 comment
Open

Error propagation within msaexp #51

themiyan opened this issue Nov 2, 2023 · 1 comment

Comments

@themiyan
Copy link

themiyan commented Nov 2, 2023

The erros for the optimally extracted spectra seems to be underestimated compared to the 'real' expectation. i.e. from the ETC or looking ash the error values from single exposures from the pipeline. The extract_spectrum function seems to be where the real science happens here.

We did a few experiments with some of 2565 data to see what was going on.

Removing any background subtraction we get 3 spectra with good continuum.
Screenshot 2023-11-02 at 14 07 52

The flux levels are not similar between the 3 dithers due to object entering issues, so we've fit a polynomial to 2 of the dithers to normalise the flux and errors to the first dither position. The same correction is also applied to the error spectrum.

Once this normalisation is applied, the flux variation between the individual pixels can be thought to be driven by the noise value. So the RMS of the flux values in the 3 dithers (show in solid black below) can be compared with the normalised errors of the 3 dither positions. They agree well (some sigma clipping applied to remove CR noise etc)
Screenshot 2023-11-02 at 14 11 35

Now the figure below shows the S/N for the 3 discussed above + also with background subtraction as handled by msaexp. It is a bit busy, but basically the 3 dither positions with no background subtraction are in the solid rgb colours. The 6 A-B iterations are shown by dashed colours. The black dashed in S/N = 30 to guide the eye.

The solid black is the optimally extracted spectrum produced by the extract_spectrum function.

Screenshot 2023-11-02 at 14 17 44

The S/N is ~ sqrt(6) higher compared to the individual error levels. However, since the background errors in A-B and A-C are correlated, it should be only sqrt(3) higher.

The extract_spectrum function stacks all 6 iterations together and takes the sum with optimal ivar scaling. So basically the 6 background subtractions are considered to be independent. Like

sall_prof = np.vstack(all_prof)

Is our understanding here correct?

@themiyan
Copy link
Author

themiyan commented Nov 2, 2023

Below is the maths Karl worked out to confirm this mathematically.

PastedGraphic-2 PastedGraphic-2

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

1 participant