Fix Version/s: None
Component/s: obs_subaru, pipe_tasks
In HSC, there are a number of ways that the PSF modeling with psfex can be poor. Most of the time this is because the seeing is too good, but there can be other things that cause problems. We would like to reject these images when building the coadd. This ticket is to write an image selector that selects on the quality of the PSF based on the residuals of the second moments.
At the suggestion of Rachel Mandelbaum, I have remade the plots using delta size/size.
Note that I have shifted the distribution to be centered at zero. And here is the scatter plot:
Upon further investigations I found the following:
- the median(delta e1) cut per ccd does not overlap much with the median(delta e2) because you have visits where either e1 or e2 is small across the ccd while the other is large. For problematic visits it will still get the small ellipticity value correct, but not the large. I think the way to go here is to combine into a median(delta e) cut.
- a permissive cut in the median( (delta size)/ size) does not catch some of the known bad visits, while a cut in the ellipticity does. Therefore this cut does not seem to add any more information.
- The scatter for delta e1, delta e2 and delta size/size per ccd roughly flag the same visits, and add ~15% ccds to the median(delta e) cut. These look like poor modeling where the residuals are equally scattered around the mean. A tighter cut on the median(delta e) value can also catch these.
- The fraction of bad objects is not a useful metric because some ccds have essentially constant ellipticity/size and therefore a scatter that is extremely small which can give rise to reasonably large outliers.
I think this is ready for review. Paul Price, will you have a chance to review this before you leave?
Looks good to me. A couple of minor comments:
- Should the choice of shape (currently hard-coded as base_SdssShape) be configurable? Alternatively, could you use src.getShape(), which would remove the need for the ellipticity calculations because they could be done by lsst.afw.geom.ellipses?
- What needs to be done to use this code by default? Shouldn't we activate it in obs_subaru?
I tried to come up with a reasonable set of cuts based on the results from the HSC S16A visit data. I use the following quantities derived from the second moment quantities:
I have also rejected ccd 9 from this analysis because of the known problems there that cause many visits to fail.
For each CCD I looked at the residuals of the two ellipticity components and the size. Here is the median of residuals for each CCD.
Here is a plot of the scatter (as defined by the median absolute deviation scaled to be a Gaussian.) for each of these quantities.
Finally, I plot the fraction of objects with values greater than 5*scatter from the median.
Given these plots I chose a conservative set of cuts to remove outliers:
With these cuts I remove 6808 ccds from 971 different visits which corresponds to ~5% of the data. Here is the number of ccds removed from each visit.
You can see that most visits only have a few ccds with poorly modeled data. I also noticed that a number of ccds from the visits we rejected in S16A don't have any problems.
Here are the number of rejected visits for each ccd which show fairly uniform coverage except for the outer ccds:
We could also try to be more aggressive to exclude more objects as these are cuts are quite conservative.