SkyMaker: astronomical image simulations made easy

7
Mem. S.A.It. Vol. 80, 422 c SAIt 2009 Memorie della E. Bertin Institut d’Astrophysique de Paris, UMR7095 CNRS, Universit´ e Pierre & Marie Curie, 98bis bd Arago, F-75014 Paris, France, e-mail: [email protected] Abstract. SM is a software package for creating artificial astronomical images. I show how such a tool could be used in the framework of the Virtual Observatory to generate virtual observations from simulation data. Key words. Methods: numerical – Techniques: image processing 1. Introduction Realistic data simulations are an essential com- ponent of all modern astronomical survey ex- periments, in particular those that deal with images. Detection eciencies in microlensing studies, or star/galaxy separation and surface brightness selection eects in galaxy surveys are examples of critical issues relying on real- istic image simulations. The science of large imaging surveys re- quires large numerical simulations and huge datasets. Suitable datasets, such as ”toy uni- verses” from n-body simulations, consisting of particle attributes at various epochs, are readily available (see e.g. the contributions by Volker Springel or Herv´ e Wozniak, this conference). Unfortunately the data volumes are much too large to be directly publishable through the Virtual Observatory. A more consistent ap- proach, as proposed by G. Lemson, is to set up a VO-compliant “virtual telescope” webser- Send oprint requests to: E. Bertin vice, generating on-the-fly images from the nu- merical simulations 1 . Contemporary observations of astronomi- cal sources are often conducted over of a wide range of electromagnetic wavelengths to get a comprehensive understanding of physical pro- cesses. The image generator should ideally be flexible enough to oer the possibility to sim- ulate data at wavelengths ranging from radio waves to γ-rays. Hopefully this is not as dif- ficult as it may seem, at least to first order, as most modern imagers share many common characteristics. Image data are generally ar- ranged as a rectangular grid of pixels with close-to-linear behaviour over a dynamic range of 10,000 or more. The image formation pro- cess provided by the focusing system is largely translation-invariant up to some cutoangular frequency over large parts of the focal-plane, and can be described by a point spread func- tion slowly variable over the field of view. Noise may essentially be decomposed into a Poissonian component from the photon-noise 1 www.ivoa.net/cgi-bin/twiki/bin/view/ IVOA/VirtualTelescopeConfiguration

Transcript of SkyMaker: astronomical image simulations made easy

Mem. S.A.It. Vol. 80, 422c© SAIt 2009 Memorie della

SkyMaker: astronomical image simulations madeeasy

E. Bertin

Institut d’Astrophysique de Paris, UMR7095 CNRS, Universite Pierre & Marie Curie, 98bisbd Arago, F-75014 Paris, France, e-mail: [email protected]

Abstract. SM is a software package for creating artificial astronomical images. Ishow how such a tool could be used in the framework of the Virtual Observatory to generatevirtual observations from simulation data.

Key words. Methods: numerical – Techniques: image processing

1. Introduction

Realistic data simulations are an essential com-ponent of all modern astronomical survey ex-periments, in particular those that deal withimages. Detection efficiencies in microlensingstudies, or star/galaxy separation and surfacebrightness selection effects in galaxy surveysare examples of critical issues relying on real-istic image simulations.

The science of large imaging surveys re-quires large numerical simulations and hugedatasets. Suitable datasets, such as ”toy uni-verses” from n-body simulations, consisting ofparticle attributes at various epochs, are readilyavailable (see e.g. the contributions by VolkerSpringel or Herve Wozniak, this conference).Unfortunately the data volumes are much toolarge to be directly publishable through theVirtual Observatory. A more consistent ap-proach, as proposed by G. Lemson, is to setup a VO-compliant “virtual telescope” webser-

Send offprint requests to: E. Bertin

vice, generating on-the-fly images from the nu-merical simulations1.

Contemporary observations of astronomi-cal sources are often conducted over of a widerange of electromagnetic wavelengths to get acomprehensive understanding of physical pro-cesses. The image generator should ideally beflexible enough to offer the possibility to sim-ulate data at wavelengths ranging from radiowaves to γ−rays. Hopefully this is not as dif-ficult as it may seem, at least to first order,as most modern imagers share many commoncharacteristics. Image data are generally ar-ranged as a rectangular grid of pixels withclose-to-linear behaviour over a dynamic rangeof 10,000 or more. The image formation pro-cess provided by the focusing system is largelytranslation-invariant up to some cutoff angularfrequency over large parts of the focal-plane,and can be described by a point spread func-tion slowly variable over the field of view.Noise may essentially be decomposed into aPoissonian component from the photon-noise

1 www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/VirtualTelescopeConfiguration

Bertin: SkyMaker 423

and an additive, Gaussian component from theelectronics.

In the following I present a versatile as-tronomical image simulation software pack-age called SM2 which relies on thisset of features. SM is distributed un-der the GNU Public license3. It started out asa testing tool for the SE source ex-traction software (Bertin & Arnouts 1996). Ithas since been used in various studies: weaklensing (e.g. Erben et al. 2001, Heymans et al.2006), preliminary instrument/pipeline design(e.g. Babusiaux 2005, Refregier et al. 2006) orrendering of n-body simulations (e.g. Cattaneoet al. 2005, Blaizot et al. 2005). The organisa-tion of this paper follows that of the main com-putation steps in SM: §2 describes themodelling of the different point spread functioncomponents; §3 explains how sources are ren-dered; §4 presents the final stages of the sim-ulation process; §5 gives some performancenumbers; §6 focuses on some issues with in-put data; finally, §7 takes a look at features thatmay be implemented in future versions.

2. The point spread function

SM uses a tabulated Point SpreadFunction (PSF) model, which may be loadedfrom a FITS file or internally generated. TheSM PSF is tabulated at a considerablyhigher resolution than the final image (typi-cally 3−11×) to provide a faithful reproductionof aliasing effects in conditions of undersam-pling. The purpose of the internal generator isto be able to represent with decent accuracy thePSF of typical astronomical instruments. It isassumed to be the convolution of five compo-nents:

– atmospheric blurring (for ground-based in-struments),

– telescope motion blurring (jitter and guid-ing errors),

– instrument diffraction and aberrations,– optical diffusion effects,– intra-pixel response.

2 terapix.iap.fr/soft/skymaker3 www.gnu.org

In practice, the first three steps are conductedin pupil space, the final PSF being the Fouriertransform of the autocorrelation of the pupil.

2.1. Atmospheric blurring

The effects of the atmosphere are modelledas isotropic phase fluctuations on the pupil.Assuming that the turbulent structure of theatmosphere follows a Kolmogorov model, theoptical transfer function of atmospheric blur-ring in long exposures may be written as (see,e.g. Roddier 1981)

OTF(|| f ||) ∝ exp−3.442(λ|| f ||

r0

)5/3

, (1)

where || f || is the angular frequency (in rad−1),λ the observation wavelength, and r0 the Fried(1965) parameter representing the coherencescale of phase fluctuations. r0 may itself bewritten as a function of λ and the Full-Width atHalf-Maximum (FWHM) of the resulting “at-mospheric” PSF:

r0 ≈ 0.976λ

FWHM. (2)

Removing the first-order component of phasefluctuations (“image wander”), either by com-bining many very short exposures, or using afast tip-tilt mirror (e.g. Christou 1991), or anorthogonal transfer detector (Tonry et al. 1997)can bring significant improvement to the im-age quality on small telescopes. SM of-fers the possibility to simulate images with per-fect tip-tilt-correction by removing the imagewander contribution, which is assumed to beGaussian and independent of wavelength:

OTF(|| f ||) ∝ exp −3.442(λ|| f ||

r0

)5/3

×1 −

(λ|| f ||dM1

)1/3 , (3)

where dM1 is the diameter of the primary mir-ror.

2.2. Telescope motion blurring

Jitter and guiding errors can be a significantsource of image degradation; both effects are

424 Bertin: SkyMaker

available in SM, as a convolution ofthe PSF with a Gaussian (jitter) and/or a one-dimensional door function (trailing).

2.3. Instrument diffraction andaberrations

The SM PSF simulator reproduces theeffects of diffraction and aberrations in theFrauhofer regime of Fourier optics by manipu-lating a virtual entrance pupil function p(ρ, θ).The amplitude part of p is a mask driven bythe limits of a primary mirror M1 and the pos-sible obscuration by spider arms and a sec-ondary mirror or primary focus. A set of num-bers – the diameters of M1 and the central ob-scuration (disk shapes are assumed for both),and the number, position angle and thicknessof the spider arms – makes it possible to sim-ulate with reasonable accuracy the diffractionpattern of most common telescope configura-tions.

Optical aberrations may be added by in-troducing changes of phase φ(ρ, θ) throughoutthe complex pupil (Fig. 1). The following low-order phase terms can be linearly combinedwithin SM to simulate a wide range ofaberrations:

– defocus: φdefoc ∝ ρ2,– astigmatism: φasti ∝ ρ2 cos 2(θ − θasti),– coma: φcoma ∝ ρ3 cos(θ − θcoma),– spherical: φspher ∝ ρ4,– tri-coma: φtri ∝ ρ3 cos 3(θ − θtri), and– quad-ast: φquad ∝ ρ4 cos 4(θ − θquad).

Phase terms are individually normalised fol-lowing the ESO d80 convention (Fouque andMoliton 1996, private communication): phasecoefficients represent the diameter of a circleenclosing 80% of the total energy (flux) of anaberrated spot on the focal plane.

2.4. Diffusion

The wings of instrumental PSFs become dom-inated by diffusion beyond a few FWHMsfrom the centre. This so-called “aureole” com-ponent is experimentally found to follow asomewhat “universal” r−2 profile (King 1971),

with a surface brightness generally close to16 mag.arcsec−2 at 1’ from a 0th magnitudestar. The exact formation process of the aureoleis not well understood, although dust, scratchesand micro-ripples on optical surfaces, as wellas atmospheric aerosols, are most likely themajor contributors (see, e.g. Racine 1996 andreferences therein).

The aureole of bright sources can be tracedout to large angular distances from their cen-tre. To avoid manipulating exceedingly largePSFs in SM, the aureole is generated ata later stage of the processing, and convolvedwith the image in the final resolution.

2.5. Intra-pixel response

SM convolves the oversampled opticalPSF with the intra-pixel response, and there-fore makes the implicit assumption that the lat-ter does not vary on small scales. In the cur-rent version, the intra-pixel response functionis simply the door function with a width equalto the sampling step, and effects such as chargediffusion are ignored.

3. Source rendering

After generating the PSF model, SM

reads the input catalogue and renders sourcesat the specified pixel coordinates in the frame.Sources are rendered “on-the-fly”; hence thereis no memory limitation to the number ofsources that can be added to an image. The cur-rent version of SM supports two typesof sources: point-sources and galaxies.

3.1. Point sources

SM renders point-sources by simplyscaling in flux and interpolating the PSF onthe final pixel grid at the specified position.Interpolation is carried out using a 6 × 6-tapLanczos-3 filter (e.g. Wolberg 1994), whichrepresents a good compromise between flat-ness of the spatial frequency response and pro-cessing speed.

Bertin: SkyMaker 425

Fig. 1. Real part of the pupil functions and their respective PSFs in the perfect case (left), and in thepresence of 1” (d80) of defocus, astigmatism, coma, and spherical aberrations. The PSFs are free of seeingeffects and convolved with a 0.2” square-shaped pixel footprint.

3.2. Galaxies

Galaxies are modelled as a sum of a spheroid(bulge) and a disk components. Spheroids fol-low a de Vaucouleurs profile:

µS (r) = m − 2.5 log(B/T ) + 8.3268(

rreff

)1/4

+5 log reff − 4.9384. (4)

µS is expressed in units of mag.arcsec−2, m isthe apparent galaxy magnitude, B/T the ap-parent bulge-to-total ratio, and reff the effectiveradius of the spheroid in arcseconds (see e.g.Graham & Driver 2005). Disks are given an ex-ponential profile

µD(r) = m − 2.5 log(1 − B/T ) + 1.0857(

rrh

)

+5 log rh + 1.9955, (5)

where rh is the disk scalelength in arcseconds.m, B/T , reff , rh as well as independent aspectratios and position angles for both componentsare read from the catalogue.

Galaxy models are generated at a higherresolution than the final image to minimisealiasing effects. To speed up computations,galaxy images are framed around a limit-ing isophote which depends on galaxy sur-face brightness and background noise level.After convolution with the PSF, galaxy images

are downsampled to the final resolution usingLanczos-3 interpolation and added to the im-age.

4. Sky background, noise, saturationand quantization

The current version of SM renders thesky background simply as a constant added toall pixel values. Up to this stage, all pixel val-ues are expressed in “expected” numbers ofphoto-electrons (detector events), that is, not asintegers. Next, two noise processes are appliedindependently to the data: each pixel value pis replaced with a random number of eventsdrawn from a Poisson distribution with meanp, and Gaussian read-out noise is added. Nocorrelation of the noise is introduced betweenadjacent pixels.

Charge-coupled devices (CCDs) are usedextensively for wide-field imaging. CCDs areknown to “bleed’ (or “bloom”) when the num-ber of photo-electrons exceeds the full wellcapacity of a pixel. Bleeding/blooming on abright star results in an intense, saturated streakextending in opposite directions along the axisof charge transfer. SM reproduces thisfeature by spreading photo-electrons in excessof the pixel full well capacity, symmetricallyalong the y direction (Fig. 2).

426 Bertin: SkyMaker

Fig. 2. Blooming artifact in a simulated CCD imageof a bright star.

Finally, counts are converted to ADUs andclipped according to the gain factor and satura-tion values specified in the configuration file.

5. Performance

SM is written in C, and has been opti-mised to offer solid performance without sac-rificing quality. Much of the code is mul-tithreaded and therefore benefits from mul-ticore CPUs and multiprocessor machines.Processing rates for typical deep field simula-tions (1024 × 1024 PSF model with 5× over-sampling) are ≈ 2000 sources/s with a 3GHz,quad-core CPU.

6. Input data

6.1. Input catalogues

Input catalogues may be created in a number ofways. Since they are ASCII files, they can becreated or modified with any editor. They mayconsist only of particle coordinates and fluxesas in Fig. 3.

For studies of extragalactic survey system-atics and applications such as advanced expo-sure time calculators, one has the possibilityto generate galaxy catalogues with the S4

4 terapix.iap.fr/soft/stuff

program. S combines spectra, luminosityfunctions and physical parameters to generateartificial catalogues of the deep extragalacticsky in a standard universe driven by (ΩM ,ΩΛ).This is done simultaneously in many filters.

One should note that the current versionof SM handles images in a purelymonochromatic way. Simulating effects suchas chromatic aberrations, differential chro-matic refraction, or diffraction-limited imagestaken through wide bandpass filters requiresrunning SM several times at differentwavelengths and summing the resulting im-ages. This might seem a cumbersome way ofcircumventing some limitation of the software.But it is actually in practice the simplest andmost flexible approach; supporting full spectradirectly within the renderer would bring a lotof complexity to the catalogue handling pro-cess without much performance benefit.

6.2. Mimicking survey data

SM offers the possibility to insertheader information from an external FITS fileinto the header of the simulated image. Thismakes it straightforward to replace actual sur-vey data with simulations in image analysispipelines, for testing of scientific assessmentpurposes: completeness, reliability, crowdingeffects, effective area at a given depth, ... (Fig4).

7. Future improvements to SM

A number of useful features are still waiting tobe implemented, among which:

– PSF variability over the field of view, andfull support for models derived with thePSF software (Bertin et al., in prepara-tion),

– Additional galaxy features (bars, spiralarms, arcs),

– Additional image primitives (artifacts).

Support for new source features in catalogueswill require a move to a more flexible input fileformat, such as XML, VO-tables and/or FITSbinary tables.

Bertin: SkyMaker 427

Fig. 3. A SM rendering of a section of the Mare Nostrum simulation at z = 2.46 (Ocvirk et al. 2008)“observed” in the I, K and IRAC-8 filters. Zooms on individual “galaxies” are shown in inserts. Particle datacourtesy of C. Pichon, IAP.

Acknowledgements. I thank C. Pichon of theHorizon collaboration for providing the data forgenerating Fig. 3, Pascal Fouque for help during theearly phases of development, and the organisers ofthe Euro-VO DCA WP4 2008 workshop for the in-vitation and fruitful discussions.

Fig.4 is based on observations obtained withMegaPrime/MegaCam, a joint project of CFHTand CEA/DAPNIA, at the Canada-France-HawaiiTelescope (CFHT) which is operated by theNational Research Council (NRC) of Canada, the

Institut National des Sciences de l’Univers ofthe Centre National de la Recherche Scientifique(CNRS) of France, and the University of Hawaii,and on data products produced at TERAPIX andthe Canadian Astronomy Data Centre as part of theCanada-France-Hawaii Telescope Legacy Survey, acollaborative project of NRC and CNRS.

Part of this work has been supported by grant04-5500 (“ACI masse de donnees”) from the FrenchMinistry of Research.

428 Bertin: SkyMaker

Fig. 4. Left: a small section of the CFHTLS “D1” deep field (e.g. Cuillandre & Bertin 2006) observed inthe g,r,i filter set. Right: full reconstruction with SM from catalogues containing bulge+disk modelparameters fitted using SE 2.8.

References

Babusiaux, C. 2005, in ESA SpecialPublication, Vol. 576, The Three-Dimensional Universe with Gaia, ed.C. Turon, K. S. O’Flaherty, & M. A. C.Perryman, 417

Bertin, E. & Arnouts, S. 1996, A&AS, 117,393

Blaizot, J., Wadadekar, Y., Guiderdoni, B.,et al. 2005, MNRAS, 360, 159

Cattaneo, A., Combes, F., Colombi, S., Bertin,E., & Melchior, A.-L. 2005, MNRAS, 359,1237

Christou, J. C. 1991, PASP, 103, 1040Cuillandre, J.-C. & Bertin, E. 2006, in

SF2A-2006: Semaine de l’AstrophysiqueFrancaise, ed. D. Barret, F. Casoli,G. Lagache, A. Lecavelier, & L. Pagani,265

Erben, T., Van Waerbeke, L., Bertin, E.,Mellier, Y., & Schneider, P. 2001, A&A,366, 717

Fried, D. L. 1965, Journal of the Optical

Society of America (1917-1983), 55, 1427Graham, A. W. & Driver, S. P. 2005,

Publications of the Astronomical Society ofAustralia, 22, 118

Heymans, C., Van Waerbeke, L., Bacon, D.,et al. 2006, MNRAS, 368, 1323

King, I. R. 1971, PASP, 83, 199Ocvirk, P., Pichon, C., & Teyssier, R. 2008,

ArXiv e-printsRacine, R. 1996, PASP, 108, 699Refregier, A., Boulade, O., Mellier, Y.,

et al. 2006, in Society of Photo-OpticalInstrumentation Engineers (SPIE)Conference Series, Vol. 6265, Societyof Photo-Optical Instrumentation Engineers(SPIE) Conference Series

Roddier, F. 1981, Prog. Optics, Volume 19,p. 281-376, 19, 281

Tonry, J., Burke, B. E., & Schechter, P. L.1997, PASP, 109, 1154

Wolberg, G. 1994, Digital image warping(IEEE Computer Society Press Monograph,Los Alamitos, CA: IEEE Computer SocietyPress, —c1994, 3rd ed.)