[SIM2D-119] Variance map outside fiber traces is very suspicious Created: 08/Aug/19  Updated: 13/Jan/23

Status: Open
Project: DRP 2-D Simulator
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: ncaplar Assignee: rhl
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2019-08-07 14.27.04.png     PNG File sim2d-119.png    
Story Points: 2
Sprint: 2DDRP-2019 H, 2DDRP-2021 A 2

 Description   

Upper panel shows cutout from the science image from calExp-FA000031r1.fits and lower panel shows cutout from the variance image. As we can see, variance image is very different within fiber traces and outside fibertrace. I doubt that this is wanted behavior? It is creating problems for Keigo Nakamura when he wants to analyze PSF images in 2d, as the variance image outside fiber traces is very unrealistics.



 Comments   
Comment by price [ 08/Aug/19 ]

The variance is discontinuous because the flat-field is discontinuous: there is no flux outside the area of the trace.

What specific problems is this causing?

Comment by ncaplar [ 08/Aug/19 ]

Ok, I suspected something similar. Thanks for clarifying.

We encountered this problem when he was modeling PSF with PSFx (PIPE2D-355), i.e., when he tried to work with 2D type algorithm on the simulated data and was cutting 40x40 and 20x20 post-stamp images. I never encountered this problem as I never look at the simulated data and only worked with ``real data''.

Comment by price [ 08/Aug/19 ]

But what is the problem?
This effect will be present on both simulated and real data.

Comment by ncaplar [ 08/Aug/19 ]

This effect is not present in the real data. The flux outside traces is not zero in the real data and variance map behaves as expected. If this was present in the real data 2D modeling would be seriously hampered. You might remember, we were even tweaking numbers so that mean of the variance map is the equal to mean of the variance in the science image (PIPE2D-278)? I think we are misunderstanding each other here?

Comment by price [ 17/Mar/20 ]

Here's the image (left), mask (center) and variance (right) planes for a part of a calexp produced with the command detrend.py DATA --calib DATA/CALIB --rerun sim2d-119 --id visit=21460 arm=r. I think this shows the same features you're pointing out in the simulated data. If I'm mistaken, could you please be more specific in identifying the problem?

Comment by ncaplar [ 17/Mar/20 ]

I am very confused. I have never seen this feature when running detrend.py on my side. 

But the variance value of a pixel should not change depending on the fact if the pixel is within a trace or outside a trace. Right? You are showing there is a clear difference in variance value for pixels within trace and outside trace and that has to be unwanted behaviour unless I am misunderstanding something.

Comment by price [ 17/Mar/20 ]

All the pixels outside the trace are masked out, and shouldn't be used. We have no variance estimate for them in the flat, but they get set to 1. I could set them to a variance of zero, but the drp_stella code we've inherited wouldn't like that. Alternatively, I could set them to a variance of infinity, but I think rhl has argued against that in the past. What value do you think they should be set to?

Note also that the flat-field outside the traces is set to 1 everywhere, so if you're flat-fielding donut images with the fiber flats, you're probably messing up the images.

Comment by ncaplar [ 17/Mar/20 ]

How is the computation of variance of pixels outside of trace different than the computation of variance of pixels inside of trace?

Pixels outside of trace are still needed for estimates of scattering etc... 

It is not possible to flat field 2d images for me as we do not have traces (as you correctly pointed out)

Comment by ncaplar [ 17/Mar/20 ]

I guess why I never noticed this is because I turned off flatfielding when doing detrend ?

Comment by price [ 24/Mar/20 ]

That's possible.

I suggest we close this ticket.

Comment by ncaplar [ 24/Mar/20 ]

price Is the data that you generate above with command detrend.py DATA --calib DATA/CALIB --rerun sim2d-119 --id visit=21460 arm=r avaliable on Tiger somewhere?

Comment by price [ 24/Mar/20 ]

My data repo is /scratch/pprice/sim2d-119/DATA.

Comment by rhl [ 24/Mar/20 ]

Could this have been a rerun from the "official" data repo?

Comment by price [ 24/Mar/20 ]

I am not aware of an "official" data repo.

Comment by rhl [ 24/Mar/20 ]

We are supposed to have all the data on tiger, so that would be the official one.

Comment by price [ 07/Apr/20 ]

rhl, did you decide how you want to handle this? The problem is that pixels outside the trace have zero weight when normalising by the trace.

Generated at Sat Feb 10 16:08:46 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.