[PIPE2D-757] 2d psf solution from January 2021 are poor in the red (R1) Created: 06/Mar/21 Updated: 01/Jun/21 Resolved: 01/Jun/21 |
|
| Status: | Won't Fix |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Normal |
| Reporter: | ncaplar | Assignee: | ncaplar |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Story Points: | 6 |
| Sprint: | 2DDRP-2021 A 4, 2DDRP-2021 A5 |
| Description |
|
I noticed that my solutions from January 2021 are systematically poor in the red part of the red detector. poor_fit_detector.png shows the quantity that measures the quality of the fit. It is log10(chi^2 residual/ chi^2 max), where chi^2 max is np.mean(sci_image^2/var_image), and chi^2 residual is np.mean((sci_image-model_image)^2/var_image). example_poor_fit.png shows the example of the single psf. We can see how the fit does not capture the shape of psf in the data.
|
| Comments |
| Comment by ncaplar [ 11/Mar/21 ] |
|
One of the reasons why the poor fits are more obvious in red now is due to the fact that result have improved in the rest of the detector (see the difference between ``fit_April_2020'' with result from April 2020 and ``poor_fit_detector'' with results from now). At the same time the fits have not improved (in some cases they even seem worse) in the red part of the detector. This makes this difference much more obvious now, even though there were hints of this issue already before. |
| Comment by ncaplar [ 11/Mar/21 ] |
|
The biggest problems for the fit are still on the edges of detector and struts. On image ``where_the_fit_is_probematic'' I have highlighted 1% of most problematic pixels which are dominating the chi**2_reduced fit. |
| Comment by rhl [ 12/Mar/21 ] |
|
|
| Comment by ncaplar [ 12/Mar/21 ] |
|
I am thinking about what to do. It is not obvious how to mask properly where the most offending pixels are, as this changes with position on detector and amount of defocus. One thing that is constant is that they are always near the edges of detector and struts, but not at the exactly same spot. |
| Comment by ncaplar [ 09/Apr/21 ] |
|
As discussed on Princeton PFS telecom on Monday, I have implemented modification to the pupil which should improve the fidelity of modelling in the corners of the detector and testing fitting algorithm that minimizes chi instead of chi**2. I have implemented these changes today and I am running first tests cases on cluster now.
|
| Comment by ncaplar [ 17/Apr/21 ] |
|
This is painful because one person is clogging the cluster with a huge amount of jobs, and they are ahead of me in the schedule. I have managed to run only a few examples on tiger-sumire which I will evaluate shortly, but I have not been able to get any code of systematic run. I am unsure why I am not getting any time... I might try rewriting the cluster procedure to get into other ques. |
| Comment by ncaplar [ 25/May/21 ] |
|
After a lot of work and experiments I have implemented the following modifications: 1. I start the chain by refitting the image in focus by modifying low order Zernike parameters (z4-z11) and setting those values as starting values in parameter search. 2. Refactored the optimization code so that convergence is slower and parameters space is better explored. 3. The code minimizes abs(chi) instead of chi**2. This was done in order to reduce the importance of pixels with low flux values which might have been wrongly fitted if the pupil description is not perfect. I also tried various masking choices which would change throughout the evolution, but the result do not seem to change. 4. The particular evolution was done with only images at +-4 mm and in focus in order to speed up the fitting procedure. 5. During the optimization process I demand that improved solutions not only improve the overall quality of the fit, but also that they do not degrade already achieved quality in the focus. In other words I reject parameters which might improve the solution in defocused images if they severely degrade the quality of in focused image. The agreement in the focus has now improved. See the image ``Comparison_old_and_new_PIPE_757''. Note that chi scaling is different in each set of images. The images are: Top right: Defocused image after these changes Bottom left: Focused image before these changes Bottom right: Focused image after these changes As one can see the agreement in focus is much better, but this has come at somewhat worse fit in the defocused images. After all of these efforts, in that part of the detector I am not able to achieve a fit which is able to explain all the images, for all choices of defocus. I suspect that some of my assumptions might not be valid in this range. Unfortunately, this seems to be needing further work. My plan is to run this version of the algorithm on all the images available and note the improvements/discrepancies. I might try some minor improvements in the fitting algorithm but I doubt they will change the main findings. I will also try to summarize my findings and intermediate results, so I could, together with Jim, Robert and other interested parties, deduce what might be a correct way forward. I recommend closing this ticket and revisiting the issues in future, more focused tickets. |
| Comment by ncaplar [ 01/Jun/21 ] |
|
After taking into account wavelength into my algorithm, the results have moderately improved. I have placed those figures as ``defocu_after_vw_accounted'' and ``focus_after_vw_accounted''. As discussed in the meeting last week I am closing this ticket. |