imSim icon indicating copy to clipboard operation
imSim copied to clipboard

feature request: Output image background level and variance

Open esheldon opened this issue 1 year ago • 8 comments

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.

esheldon avatar Jan 10 '24 17:01 esheldon

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?

cwwalter avatar Jan 10 '24 17:01 cwwalter

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.

esheldon avatar Jan 10 '24 17:01 esheldon

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?

cwwalter avatar Jan 12 '24 18:01 cwwalter

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

  • turn off apply_sky_gradient
  • turn off vignetting
  • turn off tree rings
  • store sky_level in the truth catalog
  • assume poisson noise

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

esheldon avatar Jan 12 '24 19:01 esheldon

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

cwwalter avatar Jun 10 '24 15:06 cwwalter

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

esheldon avatar Jun 10 '24 16:06 esheldon

You mean in your own framework code correct?

If so, can you close this?

cwwalter avatar Jun 10 '24 16:06 cwwalter

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.

esheldon avatar Jun 10 '24 16:06 esheldon