LSSTDESC / imSim

GalSim based Rubin Observatory image simulation package
https://lsstdesc.org/imSim
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

feature request: Output image background level and variance #442

Open esheldon opened 7 months ago

esheldon commented 7 months ago

I'm interested in having the background and background variance (since it may not be pure poisson) output in the image header for the "eimage" type.

The motivation is to enable quick analysis of the image without going through the entire characterize/calibrate processes.

cwwalter commented 7 months ago

Just to add a bit of info in case it isn't widely known: The background isn't flat, it is a gradient taken from the sky model so this would be an image and variance plane I think.

Would you want things like fringing or tree-rings included in it?

esheldon commented 7 months ago

I didn't know that, thanks. In that case I suppose it is the full variance plane that is needed.

My example is pretty simple: I want to try to characterize the PSF on the image. I want to do it in a fully controlled way. I want to isolate PSF determination errors from other sources of error such as calibration, astrometric calibration, background determination, etc. the WCS is in the header but I need some other info in order to construct the input data for the algorithms.

cwwalter commented 7 months ago

There are somethings, like tree-rings, which I think won't be completely separable. That is going to affect sources as well as the background and is going to depend where you hit a specific sensor.

But, you would like anything that could affect the background to be included correct?

esheldon commented 7 months ago

I'm turning off tree rings for this (see the footnote 1 for why)

I only need to know the background in order to subtract it, and the noise in order to give the code a way to remove low S/N objects (footnote 2). We don't need to know the noise precisely to run PIFF but we do need the background subtracted accurately.

By the way, I did come up with a hack that may work

storing sky level in the cat is a real hack, but I don't know any other way to get it

footnotes

  1. Tree rings are hopefully not relevant for how well PIFF works. We think PIFF will work fine with with tree rings as long as the astrometric solution includes it, but I don't have a full WCS only what's in the header (SIP).
  2. PIFF is doing a gaussian fit to get the S/N, which for constant noise works fine even if you don't know the noise perfectly
cwwalter commented 2 months ago

@esheldon Is there still something that needs to be done here? BTW note that HyeYun is working on updating the tree-ring model.

esheldon commented 2 months ago

I just implemented this functionality myself outside of the config interface.

cwwalter commented 2 months ago

You mean in your own framework code correct?

If so, can you close this?

esheldon commented 2 months ago

I do think it would be useful for the background to be written so people can use it.

But I no longer need this as I've worked around it.