-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
bug reportBug reportBug reportcorrelated noiseRelated to the handling of correlated noise.Related to the handling of correlated noise.
Description
Hi,
I'm trying to whiten the noise in images from the COSMOS catalog and it seems not to scale properly with the pixel scale and (maybe) the PSF fwhm I'm using. Below is a snippet reproducing what I'm finding.
@rmjarvis thinks that might be due to the noise object not scaling properly, so I tried to dilate the noise object by the ratio of pixel scales, which seems to improve things (not sure how to quantify that).
import galsim
nx = 256
pixel_scale = 0.2
cat = galsim.COSMOSCatalog()
gal = cat.makeGalaxy(index=245, gal_type='real', noise_pad_size=nx*pixel_scale)
PSF = galsim.Kolmogorov(fwhm=0.15)
gal_psf = galsim.Convolve([gal, PSF])
im1 = gal_psf.drawImage(scale=pixel_scale, nx=nx, ny=nx)
im2 = im1.copy()
im1.whitenNoise(gal_psf.noise)
fig, axes = plt.subplots(1, 3, figsize=(12,3))
im = axes[0].imshow(im2.array)
plt.colorbar(im, ax=axes[0])
im = axes[1].imshow(im1.array)
plt.colorbar(im, ax=axes[1])
im = axes[2].imshow(im1.array-im2.array)
plt.colorbar(im, ax=axes[2])
im1 = gal_psf.drawImage(scale=pixel_scale, nx=nx, ny=nx)
im2 = im1.copy()
im1.whitenNoise(gal_psf.noise.dilate(0.03/pixel_scale))
fig, axes = plt.subplots(1, 3, figsize=(12,3))
im = axes[0].imshow(im2.array)
plt.colorbar(im, ax=axes[0])
im = axes[1].imshow(im1.array)
plt.colorbar(im, ax=axes[1])
im = axes[2].imshow(im1.array-im2.array)
plt.colorbar(im, ax=axes[2])Metadata
Metadata
Assignees
Labels
bug reportBug reportBug reportcorrelated noiseRelated to the handling of correlated noise.Related to the handling of correlated noise.

