[PIPE2D-1197] subtractSky1d applied to spectrograph=3 produces excessive noise Created: 31/Mar/23 Updated: 28/Apr/23 Resolved: 28/Apr/23 |
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Normal |
| Reporter: | price | Assignee: | price |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
rhl reports:
|
| Comments |
| Comment by price [ 31/Mar/23 ] |
|
I have a fix that I'm going to put on (It's a completely boring, accounting bug.) This fix will invalidate existing sky1d products (they cannot be accessed from the butler any more). |
| Comment by rhl [ 02/Apr/23 ] |
|
The normalisation is still wrong, I think. Here are the calexp, the spectra-subtracted, and the sky-subtracted images for 83149. You can also see artefacts from the background subtraction model, but that's a different issue. The code for the last two plots only differs in doing the sky subtraction: pfsArm = butler.get("pfsArm", dataId) if subtractSky: from pfs.drp.stella.subtractSky1d import subtractSky1d sky1d = butler.get("sky1d", dataId) subtractSky1d(pfsArm, pfsConfig, sky1d) |
| Comment by price [ 04/Apr/23 ] |
|
Your code doesn't match the figures, so it's not clear to me what you're doing. One thing that I noticed is that when we make an image from spectra, the image includes the values in the sky arrays. That's probably not what we want (we only want the flux), so I've changed that (on Perhaps that, combined with using the old branch might explain the figures you posted. If not, please provide me detailed instructions on how to reproduce the problem. I've attached my notebook in case it's helpful. |
| Comment by rhl [ 05/Apr/23 ] |
|
The "image includes the values in the sky arrays" comment was the clue. Yes, the code works with the tip of One thing that would be helpful would be an option to spectra.makeImage(exp.getDimensions(), traces) that subtracted the .sky array rather than the .flux. Yes; I can stuff sky into flux, but it's ugly.
|
| Comment by price [ 28/Apr/23 ] |
|
This merged as part of I added a toggle to SpectrumSet.makeImage to have it construct an image from the sky instead of from the flux. |