GalSim-developers / GalSim-Euclid-Like

Helper functions to generate simulations of Euclid-Like images.
Other
1 stars 0 forks source link

Sky level calculations #11

Closed rmandelb closed 6 months ago

rmandelb commented 6 months ago

This PR includes sky level calculations. As an illustration of its performance, if you install the version of the code on this branch, then you can run the following code snippet:

import galsim
import galsim.roman
import euclidlike
pos = galsim.CelestialCoord(ra=100*galsim.degrees, dec=0.*galsim.degrees)
euclidlike.getSkyLevel(euclidlike.getBandpasses()['VIS'], pos)
euclidlike.getSkyLevel(galsim.roman.getBandpasses()['H158'], pos)
galsim.roman.getSkyLevel(galsim.roman.getBandpasses()['H158'], world_pos=pos, exptime=euclidlike.long_exptime)*euclidlike.collecting_area/galsim.roman.collecting_area*euclidlike.gain

The first number is the sky level for Euclid VIS given the Euclid exposure time and collecting area and gain, in e-/arcsec^2, at the given position. The second is the same thing calculated using our code, but for the Roman H158 bandpass, still with all other parameters set to the Euclid ones. The third is what GalSim gives (based on a lookup table) for the Roman H158 bandpass and otherwise a Euclid setup. The 2nd and 3rd agree to <0.1%, which is expected; it isn't an exact match because GalSim is doing a lookup table while we're doing an exact calculation.

andyyPark commented 6 months ago

Maybe

euclidlike.getSkyLevel(galsim.roman.getBandpasses()['H158'], pos)
galsim.roman.getSkyLevel(galsim.roman.getBandpasses()['H158'], world_pos=pos, exptime=euclidlike.long_exptime)*euclidlike.collecting_area/galsim.roman.collecting_area*euclidlike.gain

can be used in the unit test?

rmandelb commented 6 months ago

Yes, we should use that test for a few different positions on the sky.

andyyPark commented 6 months ago

LGTM!