Flat field the data
(PIPE2D-10)
|
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Sub-task | Priority: | Major |
| Reporter: | swinbank | Assignee: | aritter |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Sprint: | 2014-17 | ||||||||||||||||||||||||
| Reviewers: | price | ||||||||||||||||||||||||
| Description |
|
1. Understand why the normalized flat is only five pixels wide; |
| Comments |
| Comment by aritter [ 10/Oct/16 ] |
|
This ticket is based on |
| Comment by aritter [ 20/Oct/16 ] |
|
It appears that we looked at the wrong file when we created this ticket. The width of the normalized Flat (point 1.) was actually correct, and so was the variation (point 2.). However concerning the width we decided to not use the proposed SNR cut nor cut the normalized Flat FiberTrace to the width of the spectral FiberTraces for diagnostic reasons. We might need to rethink not using the SNR cut though as it will probably add noise to the adjacent FiberTraces. |
| Comment by swinbank [ 22/Oct/16 ] |
|
rhl, are you happy with the text above? If so, we'll close this. |
| Comment by swinbank [ 29/Oct/16 ] |
Please check/demonstrate this by not setting all negative pixels to zero and making sure that the profile is no longer too low. Should be quick to do this: just hack away at the source. |
| Comment by aritter [ 10/Nov/16 ] |
|
Turns out that I don't set negative pixel values to zero (anymore), only negative profile values. I'm going to check the weights for the most outer pixels next. |
| Comment by swinbank [ 20/Dec/16 ] |
|
Per our meeting of 2016-12-19, please add:
|
| Comment by swinbank [ 10/Jan/17 ] |
|
Per our meeting of 2017-01-09, aritter believes that this problem may have vanished (or be much reduced?) with newer simulations and/or the current version of his code. He will check this, and update this ticket with material to convince us that that is the case. We can then close this (a post-mortem of bugs in old code or simulations is not necessary). |
| Comment by aritter [ 18/Jan/17 ] |
|
I have produced plots comparing the original and reconstructed (from the spatial profile and the extracted spectrum) pixel values in all FiberTraces in one Flat, sorted by their distance to the center of the FiberTrace. The profile was calculated with 10 times oversampling (bin width 1/10th pixel). The bin width for which the mean and standard deviation of the difference (original pixel value) / (reconstructed pixel value) were calculated is 1/100th pixel. We originally saw strong systematics in the most outer 1/20th (half a bin width of the profile calculation) of a pixel which seems resolved now: |
| Comment by swinbank [ 19/Jan/17 ] |
|
price — in case it's not obvious, I've just been talking to aritter and he points out that the review of this ticket involves not just understanding his figures and agreeing that they indicate that there's nothing to worry about here, but also reviewing the outstanding PR on GitHub. |
| Comment by aritter [ 25/Jan/17 ] |
|
Please ignore the ticket branch for obs_pfs as this is superseeded by As for what is going with this ticket in general: I used the Flat with visit number 104 to generate a normalized Flat. This is done by calculating the spatial profile, optimally extract the spectrum by scaling the spatial profile to each row in the FiberTrace, reconstruct the (smooth) FiberTrace image by multiplying the spatial profile with the spectrum, and dividing the original FiberTrace image by the reconstructed one. The spatial profile is calculated from the Flat rows in a swath containing 500 rows. The swaths overlap (swath 1: rows 0-499, swath 2: rows 255-754,...). Within each swath the rows are (noisy) dithered representations of the spatial profile, scaled with the flux in the dispersion element. These dithered representations are normalized to a sum of 1 and binned with a bin width of 1/oversample (with oversample=10). For each bin center, the mean value (with sigma rejection iterations) is calculated, and fitted with a cubic spline. |
| Comment by price [ 25/Jan/17 ] |
|
I've made some comments about the code on the GitHub PR. I still need to grok what it is you're doing because I'm still getting my head around the algorithms. It might be helpful if you could make some "before" plots to match the "after" ones you've already posted, so we can see the problem along with its solution. |
| Comment by aritter [ 30/Jan/17 ] |
|
Here are some images which illustrate the problems we saw:
|
| Comment by aritter [ 01/Feb/17 ] |
|
RHL suggests: |
| Comment by aritter [ 01/Feb/17 ] |
|
Some more comments about the strategy for the construction of the master Flat from the dithered Flats:
I was thinking that maybe it's better/faster, to trace, extract, and reconstruct the wide sum of the dithered FiberTrace representations, instead of reconstructing each dithered FiberTrace individually. This version is implemented in a different branch now (obs_pfs tickets/PIPE2D-77_1profile). Both versions are working fine, but I didn't exactly compare and profile them yet. I filed another ticket to compare both versions for quality and speed ( |
| Comment by aritter [ 01/Feb/17 ] |
|
A last (hopefully) systematic I forgot to mention earlier in the wings of the spatial profile, where the model was ~10% too low. The fix was to turn up the oversampling factor (config parameter config.profile.overSample) from 10 to 50-100, reducing the bin size for the profile calculation to 1/50-1/100 of a pixel: |
| Comment by aritter [ 01/Feb/17 ] |
|
Please review the latest commits in drp_stella and the branch tickets/ |
| Comment by price [ 02/Feb/17 ] |
|
I added review comments to the PR on obs_pfs. Nothing further to add to drp_stella. |
| Comment by aritter [ 09/Feb/17 ] |
|
Merged into master |