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

Flux scaling error fix #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Flux scaling error fix #12

wants to merge 1 commit into from

Conversation

tjgalvin
Copy link

I tracked down an error in the flux calibration stage in some data I
have been working with. If there was a nod and shuffle source observed,
then the NEXP, SEXP, NSUBEXPS header fields will still contain this
information when other observing modes are used. When the pipeline uses
the ’ns’:True parameter, signifying that N&S has been used, the exptime
is incorrectly re-calculated using these N&S parameters for exposures
made with other modes - like ClassicEquall for the standard star. This
can obviously throw off the calibration as the observed flux is scaled
in by exptime.

The fix checks the observing mode of a frame. If it is not a N&S, then
falls back to the exptime in original header, which has not been edited.

I tracked down an error in the flux calibration stage in some data I
have been working with. If there was a nod and shuffle source observed,
then the NEXP, SEXP, NSUBEXPS header fields will still contain this
information when other observing modes are used. When the pipeline uses
the ’ns’:True parameter, signifying that N&S has been used, the exptime
is incorrectly re-calculated using these N&S parameters for exposures
made with other modes - like ClassicEquall for the standard star. This
can obviously throw off the calibration as the observed flux is scaled
in by exptime.

The fix checks the observing mode of a frame. If it is not a N&S, then
falls back to the exptime in original header, which has not been edited.
@chrusher
Copy link

chrusher commented Apr 6, 2016

This is fixing the bug in the wrong place - the pipeline should check the headers in run_slitlet_mef (and run_sky_sub and run_cosmic_rays) to determine which files are nod and shuffle and which are not.

@tjgalvin
Copy link
Author

tjgalvin commented Apr 6, 2016

More robust checking could definitely be thrown in during those routines as well, and you are right. Avoiding the incorrect ToS being written would be the far better solution. I needed a quick fix, but want to report the error so the important people know. I think it is is the run_slitlet_mef that actually computes the ToS stored in the header. The other tasks I don't think contribute to the problem as it is the incorrect ToS that gives the incorrect flux scaling - but it has been a while since I looked at the code.

I may have some time to put together a better fix.

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