Skip to content

Commit

Permalink
very minor mods to realdemo.py to comply with GalSim 100 char rules
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabytprowe committed May 21, 2012
1 parent 09b7f21 commit 51962fb
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions examples/RealDemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
real_catalog_filename = 'data/real_galaxy_catalog_example.fits'
image_dir = 'data'
output_dir = 'output'
good_psf_central_fwhm = 0.6 # arcsec; FWHM of smaller Gaussian in the double Gaussian for good seeing
good_psf_central_fwhm = 0.6 # arcsec; FWHM of smaller Gaussian in the double Gaussian for good
# seeing
bad_psf_central_fwhm = 1.3 # arcsec; FWHM of smaller Gaussian in the double Gaussian for bad seeing
central_psf_amp = 0.8 # relative contribution of inner Gaussian in the double Gaussian PSF
outer_fwhm_mult = 2.0 # ratio of (outer)/(inner) Gaussian FWHM for double Gaussian PSF
Expand Down Expand Up @@ -50,13 +51,15 @@
print "Simulating unsheared galaxy in good seeing..."
sim_image_good_noshear = galsim.simReal(real_galaxy, good_epsf, pixel_scale, rand_rotate = False)
print "Simulating sheared galaxy in good seeing..."
sim_image_good_shear = galsim.simReal(real_galaxy, good_epsf, pixel_scale, g1 = g1, g2 = g2, rand_rotate = False)
sim_image_good_shear = galsim.simReal(real_galaxy, good_epsf, pixel_scale, g1 = g1, g2 = g2,
rand_rotate = False)

# simulate some crappy ground-based data, e.g., a bad night at SDSS; with and without shear
print "Simulating unsheared galaxy in bad seeing..."
sim_image_bad_noshear = galsim.simReal(real_galaxy, bad_epsf, pixel_scale, rand_rotate = False)
print "Simulating sheared galaxy in bad seeing..."
sim_image_bad_shear = galsim.simReal(real_galaxy, bad_epsf, pixel_scale, g1 = g1, g2 = g2, rand_rotate = False)
sim_image_bad_shear = galsim.simReal(real_galaxy, bad_epsf, pixel_scale, g1 = g1, g2 = g2,
rand_rotate = False)

# write to files: original galaxy, original PSF, 2 target PSFs, 4 simulated images
# note: will differ each time it is run, because we chose a random image
Expand All @@ -72,7 +75,11 @@
bad_epsf_img = bad_epsf.draw(dx = pixel_scale)
bad_epsf_img.write(os.path.join(output_dir, 'demoreal.bad_target_PSF.fits'), clobber = True)

sim_image_good_noshear.write(os.path.join(output_dir, 'demoreal.good_simulated_image.noshear.fits'), clobber = True)
sim_image_good_shear.write(os.path.join(output_dir, 'demoreal.good_simulated_image.shear.fits'), clobber = True)
sim_image_bad_noshear.write(os.path.join(output_dir, 'demoreal.bad_simulated_image.noshear.fits'), clobber = True)
sim_image_bad_shear.write(os.path.join(output_dir, 'demoreal.bad_simulated_image.shear.fits'), clobber = True)
sim_image_good_noshear.write(os.path.join(output_dir, 'demoreal.good_simulated_image.noshear.fits'),
clobber = True)
sim_image_good_shear.write(os.path.join(output_dir, 'demoreal.good_simulated_image.shear.fits'),
clobber = True)
sim_image_bad_noshear.write(os.path.join(output_dir, 'demoreal.bad_simulated_image.noshear.fits'),
clobber = True)
sim_image_bad_shear.write(os.path.join(output_dir, 'demoreal.bad_simulated_image.shear.fits'),
clobber = True)

0 comments on commit 51962fb

Please sign in to comment.