baobab.data_augmentation package¶
baobab.data_augmentation.noise_lenstronomy module¶
-
baobab.data_augmentation.noise_lenstronomy.get_noise_sigma2_lenstronomy(img, pixel_scale, exposure_time, magnitude_zero_point, read_noise=None, ccd_gain=None, sky_brightness=None, seeing=None, num_exposures=1, psf_type='GAUSSIAN', kernel_point_source=None, truncation=5, data_count_unit='ADU', background_noise=None)[source]¶ Get the variance of sky, readout, and Poisson flux noise sources using lenstronomy
Parameters: - img (2D numpy array) – image on which the noise will be evaluated
- pixel_scale (float) – pixel scale in arcsec/pixel
- exposure_time (float) – exposure time per image in seconds
- magnitude_zero_point (float) – magnitude at which 1 count per second per arcsecond square is registered
- read_noise (float) – std of noise generated by readout (in units of electrons)
- ccd_gain (float) – electrons/ADU (analog-to-digital unit). A gain of 8 means that the camera digitizes the CCD signal so that each ADU corresponds to 8 photoelectrons
- sky_brightness (float) – sky brightness (in magnitude per square arcsec)
- seeing (float) – fwhm of PSF
- num_exposures (float) – number of exposures that are combined
- psf_type (str) – type of PSF (‘GAUSSIAN’ and ‘PIXEL’ supported)
- kernel_point_source (2d numpy array) – model of PSF centered with odd number of pixels per axis(optional when psf_type=’PIXEL’ is chosen)
- truncation (float) – Gaussian truncation (in units of sigma), only required for ‘GAUSSIAN’ model
- data_count_unit (str) – unit of the data (and other properties), ‘e-‘: (electrons assumed to be IID), ‘ADU’: (analog-to-digital unit)
- background_noise (float) – sqrt(variance of background) as a total contribution from read noise, sky brightness, etc. in units of the data_count_units If you set this parameter, it will override read_noise, sky_brightness. Default: None
Returns: variance in the poisson, sky, and readout noise sources
Return type: dict
-
class
baobab.data_augmentation.noise_lenstronomy.NoiseModelNumpy(pixel_scale, exposure_time, magnitude_zero_point, read_noise=None, ccd_gain=None, sky_brightness=None, seeing=None, num_exposures=1, psf_type='GAUSSIAN', kernel_point_source=None, truncation=5, data_count_unit='ADU', background_noise=None)[source]¶ Bases:
objectA combination of sky, readout, and Poisson flux noise to be added to the image
Note
This is a wrapper around the functionality provided by the SingleBand class in lenstronomy.
-
get_background_noise_sigma2_composite()[source]¶ Get the variance in background noise from the sky brightness and read noise
Returns: variance of the background noise, in cps^2 Return type: float
-
get_background_noise_sigma2_simple()[source]¶ Get the variance in background noise from the specified estimate of the background noise, rather than computing it from the sky brightness and read noise
Returns: variance of the background noise, in cps^2 Return type: float
-
get_noise_map(img)[source]¶ Get the total random noise map due to the combined effects of sky, readout, and Poisson flux noise
Parameters: img (2D np.array) – the image of flux values in cps on which to evaluate the noise Returns: the noise map in cps Return type: 2D np.array
-
get_noise_sigma2(img)[source]¶ Get the variance of total noise due to the combined effects of sky, readout, and Poisson flux noise
Parameters: img (2D np.array) – the image of flux values in cps on which to evaluate the noise Returns: variance of total noise, in cps^2 Return type: 2D np.array
-
get_poisson_noise_sigma2(img)[source]¶ Get the variance in Poisson flux noise from the image
Parameters: img (2D np.array) – the image of flux values in cps on which to evaluate the noise Returns: variance of the Poisson flux noise, in cps^2 Return type: float
-