-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sky brightness inaccurate due to units error #139
Comments
@Jasonpoh Did you say that you think this is a one-line fix? If so, do you have a guess about what that would be? |
In this line of the code, the variable This can be done by this lenstronomy function. Basically, a hacky way to do this replacing the code snippet from line 273 with this:
|
Thanks @Jasonpoh @jsv1206 @ShrihanSolo @paxsonswierc This will affect our coming papers, so we should probably fix this soon. Do y'all have some time to work on this? |
Thanks, Paxson. Please tag me in the pull request. |
This is for current version PyPI 0.0.2.3, on macOS Sonoma 14.5. The sky brightness input to deeplenstronomy is shown in the examples (https://deepskies.github.io/deeplenstronomy/Notebooks/ConfigFiles.html) to be:
sky_brightness: measured light contamination from the atmosphere in magnitude per square arcsecond
followed by,
This indicates an input in magnitude/sq. arcsec. I believe the
sky_brightness
value is not manipulated and directly passed intolenstronomy.Util.data_util.bkg_noise()
which takes input in counts/s/sq. arcsec, rather than magnitude/sq. arcsec. See function signature below (https://lenstronomy.readthedocs.io/en/latest/_modules/lenstronomy/Util/data_util.html):To test, I attach 3 images with only changing sky brightness in the .yaml file, and show that the sky brightness input is certainly acting like a counts/s input rather than a mag/sq. arcsec input.
Testing for a visible change in generated images with changing sky brightness required a
sky_brightness: 10_000
or so before it could be seen, indicating inputs should be in flux. Entering a value of 0. or 1. sky brightness should produce a very bright image for magnitude/sq. arcsec but instead produces an image with no sky noise. Similarly, entering a negative value for the sky_brightness causes nan images, which should not occur for magnitude based inputs.I also attach .yaml files which can be used to reproduce the same (uploaded as .txt at the end). The only difference in these files is the sky_brightness parameter.
Lastly, the default survey distributions provided in distributions.py (https://github.com/deepskies/deeplenstronomy/blob/9672080cd1a5792887341f4fb13c3b0bcf913600/deeplenstronomy/distributions.py) are also in mag/sq. arcsec. This means that any use of the default survey distributions such as des_sky_brightness causes() a too-low sky brightness input to replicate the survey.
Happy to provide more information or receive corrections if I have misunderstood this.
sky10000.txt
sky100.txt
sky1.txt
The text was updated successfully, but these errors were encountered: