@@ -3141,6 +3141,41 @@ def test__extract_plane_index_of_profile(self):
31413141 assert plane_index == 2
31423142
31433143
3144+ class TestSNRLightProfiles :
3145+ def test__signal_to_noise_via_simulator_correct (self ):
3146+
3147+ background_sky_level = 10.0
3148+ exposure_time = 300.0
3149+
3150+ grid = al .Grid2D .uniform (shape_native = (3 , 3 ), pixel_scales = 1.0 )
3151+
3152+ mass = al .mp .SphIsothermal (einstein_radius = 1.0 )
3153+
3154+ sersic = al .lp_snr .EllSersic (signal_to_noise_ratio = 10.0 , effective_radius = 0.01 )
3155+
3156+ tracer = al .Tracer .from_galaxies (
3157+ galaxies = [
3158+ al .Galaxy (redshift = 0.5 , mass = mass ),
3159+ al .Galaxy (redshift = 1.0 , light = sersic ),
3160+ ]
3161+ )
3162+
3163+ simulator = al .SimulatorImaging (
3164+ exposure_time = exposure_time ,
3165+ noise_seed = 1 ,
3166+ background_sky_level = background_sky_level ,
3167+ )
3168+
3169+ imaging = simulator .via_tracer_from (tracer = tracer , grid = grid )
3170+
3171+ print (imaging .signal_to_noise_map )
3172+
3173+ assert 8.0 < imaging .signal_to_noise_map .native [0 , 1 ] < 12.0
3174+ assert 8.0 < imaging .signal_to_noise_map .native [1 , 0 ] < 12.0
3175+ assert 8.0 < imaging .signal_to_noise_map .native [1 , 2 ] < 12.0
3176+ assert 8.0 < imaging .signal_to_noise_map .native [2 , 1 ] < 12.0
3177+
3178+
31443179class TestRegression :
31453180 def test__centre_of_profile_in_right_place (self ):
31463181
0 commit comments