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

Sky model bug fixDo not propagate the sky line amplitude scaling to the final sky mode… #1452

Merged
merged 2 commits into from Oct 19, 2021

Conversation

julienguy
Copy link
Contributor

When adjusting sky lines wavelength and width, an amplitude is fitted at the same time (and effectively marginalized). In the most recent modification to the sky model, those scale factors, interpolated across wavelength and fibers (with a median filter) were erroneously included in the final sky model. This is a bug that causes some discontinuities across fibers (because of the median filter). This term is removed in this PR.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 26.518% when pulling a4dc503 on skycorr into 4a7e225 on master.

@sbailey
Copy link
Contributor

sbailey commented Oct 18, 2021

Thanks for the quick fix. The sky model for night 20211014 r6-00104284 looks much better now (old left, this PR right):
skymodel-r6-beforeafter

The resulting sframe also looks much better, though there are still some strong residuals for some sky lines (old sframe-r6-00104284 left, this PR right):
sframe-r6-beforeafter

plot_frame --sky-fibers -i /global/cfs/cdirs/desi/users/sjbailey/spectro/redux/sky7951/exposures/20211014/00104284/sframe-r6-00104284.fits

image

It does, however fix the z~4.3 excess the originally motivated this PR:

Old (current master):
image

New (this PR):
image

This is definitely better than current master, but those strong sky residuals are concerning so let's investigate those a bit more before merging.

@sbailey
Copy link
Contributor

sbailey commented Oct 19, 2021

Julien and I looked into those sky residuals and it appears to be due to the sky genuinely varying across the focal plane in a way that the model can't absorb, and it also is present when processing with older code so it isn't a leftover bug from the PCA adjustments. Side note: this plot is at H-alpha, but a similar structure appears at other sky lines (but not all of them!):
image

For kicks: The same structure is also clearly visible in H-beta, and maybe in H-gamma and -delta. I don't immediately recognize what the wavelengths redward of H-alpha are (roughly 6585, 6719, 6733, ...)

@sbailey sbailey merged commit d60f311 into master Oct 19, 2021
@sbailey sbailey deleted the skycorr branch October 19, 2021 01:04
@djschlegel
Copy link

For this tile 7951, the Balmer series emission is from the Milky Way as one can see in the H-alpha sky maps: https://www.legacysurvey.org/viewer?ra=48.3831&dec=-6.7536&layer=halpha&zoom=7&desifoot=48.3570,-6.5600&tile=7951

This raises the separable question of if+how we may want to subtract Galactic nebular emission. The current pipeline will essentially be subtracting the mean of the nebular emission across each DESI petal.

@moustakas
Copy link
Member

For kicks: The same structure is also clearly visible in H-beta, and maybe in H-gamma and -delta. I don't immediately recognize what the wavelengths redward of H-alpha are (roughly 6585, 6719, 6733, ...)

These lines are [NII] 6584 (the stronger of the two doublet lines with [NII] 6548) and the [SII] 6716,31 doublet.

@sbailey
Copy link
Contributor

sbailey commented Oct 19, 2021

Nice! I had been looking for the H-alpha map on the viewer under "overlays" rather than "more surveys"; that's a good trick to know. I'm now imagining that some will ask us to subtract the spatially varying nebular emission, while others will ask us to purposefully not subtract it because that's their science signal... :)

Thanks @moustakas for identifying the other lines.

Screenshot from the viewer link that David provided, for comparison with the plot I posted above from DESI observations:
image

@ashleyjross
Copy link

ashleyjross commented Oct 19, 2021 via email

@moustakas
Copy link
Member

@ashleyjross the attribution is in the lower-right corner of the viewer in tiny tiny font. The map is on a composite made by Doug Finkbeiner from a few different surveys, including WHAM--
https://faun.rc.fas.harvard.edu/dfink/skymaps/halpha/

@ashleyjross
Copy link

ashleyjross commented Oct 19, 2021 via email

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.

None yet

6 participants