spacetelescope / STScI-STIPS

STScI-STIPS
https://stips.readthedocs.io
13 stars 16 forks source link

Detector Noise Units #164

Open robelgeda opened 1 year ago

robelgeda commented 1 year ago

It seems like the outputs are in counts/s but the detector noise in counts. Simulating a dwarf bright galaxy, the galaxy sinks under noise. Do you know if this is a bug with the detector noise units?

CC @AstroJacobLi @ojustino

AstroJacobLi commented 1 year ago

Thank you @robelgeda for tagging me! I was testing how different exposure time affects the image quality, then I found that no matter how long you expose, you get similar noisy images. I did a simple fix here: https://github.com/AstroJacobLi/STScI-STIPS/commit/98f0a0850cef03db80dd6456fc47ab74a8532dbe, but it might be worth testing if my fix is correct. I will be back to work on this soon.

york-stsci commented 1 year ago

As far as I can see, the STIPS noise model doesn't incorporate exposure time anywhere, and indeed the changes that I can see, looking over the history, are that when the output moved from being in counts to being counts/s, the noise model was modified to no longer be multiplied by exposure time.

As such, I don't think this is a bug with detector noise units. It may be that, instead, the STIPS noise model is incorrect, which is possible, but is another sort of issue, in particular because if I find a bug in the calculation I can fix it, but if the noise model is wrong, then I would need a correct model to switch to, and I don't know what that would be.

That said, I'm willing to be convinced that there's an obvious bug in the noise model, I just have no idea of what it is, so I'll probably need help to find it.

gmzsebastian commented 1 year ago

Yes, this is part of a known issue with how the noise gets calculated. I'm the process of fixing it and I am now getting more reasonable results in my fork of STIPS (https://github.com/gmzsebastian/STScI-STIPS), but obviously still under development.

kwynn03 commented 1 year ago

Hi there! I am currently working on a project involving doing photometry on these simulations, and I believe this noise issue is what is currently stopping progress. Is there any update on this, or a specific place in the code I should be looking at to check this out? Thanks!

ojustino commented 1 year ago

Hi @kwynn03, we expect the new release to be ready in the coming weeks. You can preview whether it resolves your issue by temporarily installing the branch with the updates. We haven't yet completed a code review, so while it's not yet official, it may give you an idea of what to expect when it's released.

kwynn03 commented 12 months ago

Hi @ojustino, thanks for the update! I successfully installed the new branch you suggested, but I'm having some issues with the pandeia engine. At first it was looking for a configuration file in a source directory in pandeia_data-1.7_roman/roman/ but the actual directory seems to be in pandeia_data-1.7_roman (one directory above). I set up a symbolic link so it is now looking in the pandeia_data-1.7_roman/source/ directory for the configuration file, but now it is giving me this error: "pandeia.engine.custom_exceptions.DataConfigurationError: No default source configuration found". Any thoughts? Thank you again!