| mkobjects | noao.artdata | mkobjects |
mkobjects - Make/add artificial stars and galaxies to 2D images
mkobjects input
WHEN CREATING NEW IMAGES
OBJECT PARAMETERS
NOISE PARAMETERS
PACKAGE PARAMETERS
These parameters define certain computational shortcuts which greatly affect the computational speed. They should be adjusted with care.
The psf convolution, used on galaxies, is generally not evaluated over as large a dynamic range, given by the parameter psfrange , especially since it has a very strong affect on the execution time. The convolution is normalized to unit weight over the specified dynamic range.
This task creates or modifies images by adding models of astronomical objects, stars and galaxies, as specified in object lists. New images are created with the specified dimensions, background, title, and real datatype. Existing images may be modified in place or new images output. The task includes the effects of image scale, pixel sampling, atmospheric seeing, and noise. The object models may be analytic one dimensional profiles, user defined one dimensional profiles, and user defined image templates. The profiles and templates are given elliptical shapes by specifying a scale radius for the major axis, a minor axis to major axis axial ratio, and a position angle.
For new images a set of header keywords may be added by specifying an image or data file with the header parameter (see also mkheader ). If a data file is specified lines beginning with FITS keywords are entered in the image header. Leading whitespace is ignored and any lines beginning with words having lowercase and nonvalid FITS keyword characters are ignored. In addition to this optional header, keywords, parameters for the gain, read noise, and exposure time are defined. Finally, comments may be added to the image header recording the task parameters and any information from the objects file which are not object definitions; in particular, the starlist and gallist parameters are recorded.
A completely accurate simulation of the effects of pixel sampling, atmospheric seeing, object appearance, luminosity functions, and noise can require a large amount of computer time even on supercomputers. This task is intended to allow generation of large numbers of objects and images over large image sizes representative of current deep optical astronomical images. All this is to be done on typical workstations. Thus, there are many approximations and subtle algorithms used to make this possible to as high a degree of accuracy as practical. The discussion will try to describe these in sufficient detail for the user to judge the accuracy of the artificial data generated and understand the trade offs with many of the parameters.
New images are created with the specified dimensions, title, and real datatype. The images have a constant background value given by the background parameter (in data numbers) before adding objects and noise. Noise consists of gaussian and poisson components. For existing images, noise is only added to the objects and the background parameter is used in the calculation of the poisson noise: specifically, a poisson random value with mean given by the sum of the object and the background is generated and then the background is subtracted. For more on how the noise is computed and approximations used see mknoise .
Objects are specified by a position, magnitude, model, scale, axial ratio, and position angle. Since the point spread function (PSF) is assumed constant over the image the star model, size, axial ratio, and position angle are specified by the task parameters star , radius , ar , and pa . For galaxies, where the intrinsic shapes vary from object to object, these parameters are specified as part of the object lists. For both types of objects the positions and magnitudes are specified in the object lists.
There is a great deal of flexibility in defining the object models. The models are defined either in terms of a one dimensional radial intensity or cumulative flux profile or an image template. The flux profiles may be analytic functions or a user defined profile given as an equally spaced set of values in a text file. The first point is zero at the center for a cumulative profile and increases monotonically to the edge. Note that intensity profiles are to be prefered to avoid artifacts in the convertion from cumulative flux. In particular, cumulative flux profiles may give a spike at the center. In either case, the profile should be specified fairly finely, many points, to avoid interpolation effects.
The functional form of the analytic profiles the user profiles, and image template are given below.
gaussian: I = exp (-ln (2) * (R/radius)**2)
moffat: I = (1 + (2**(1/beta)-1) * (R/radius)**2) ** -beta
expdisk: I = exp (-1.6783 * R/radius)
devauc: I = exp (-7.67 * (R/radius)**1/4)
flux profile: I = intensity (nprofile * R/radius)
flux profile: F = flux (nprofile * R/radius)
image template: I = image (nc/2+nc/2*dX/radius, nl/2+nc/2*dY/radius)
where R, dX, and dY are defined below, radius is the scale parameter and beta is the Moffat parameter specified by the user, nprofile is the number of profile points in the user profile, and nc and nl are the image template column and line dimensions. The Gaussian, "gaussian", and Moffat, "moffat", profiles are used for stars and the point spread function, while the exponential disk, "expdisk", and De Vaucouleurs, "devauc", profiles are common models for spiral and elliptical galaxies. The image templates are intended to model images with some complex structure. The usual case is to have a very well sampled and high signal-to-noise image be reduced in scale (a more distant example), convolved with seeing (loss of detail), and noise (degraded signal-to-noise). This also allows for more complex point spread functions.
The radial profiles are mapped into two dimensional objects by an ellipical transformation. The image templates are also mapped by an ellipical transformation to rotate and stretch them. If the output image coordinates are given by (x, y), and the specified object center coordinates are given by (xc, yc) then the transformation is defined as shown below.
dx = x - xc dy = y - yc dX = dx * cos(pa) + dy * sin(pa) dY = (-dx * sin(pa) + dy * cos(pa)) / ar R = sqrt (dX ** 2 + dY ** 2)
where dx and dy are the object coordinates relative to the object center, dX and dY are the object coordinates in the transformed circular coordinates, and R is the circularly symmetric radius. The transformation parameters are the axial ratio ar defined as the ratio of the minor axis to the major axis, and the position angle pa defined counterclockwise from the x axis.
The radius parameter defines the size, in pixels, of the model object (before seeing for the galaxies) in the output image. It consistently refers to the major axis of the object but its meaning does depend on the model. For the gaussian and moffat profiles it is defined as the half-intensity radius. For the expdisk and devauc profiles it is defined as the half-flux radius. For the user specified profiles it is the radius of the last profile point. And for the image templates it is the radius of the image along the first or x axis given by one-half of the image dimension; i.e. nc/2.
The profiles of the analytic functions extend to infinity so a dynamic range, the ratio of the peak intensity to the cutoff intensity, is imposed to cutoff the profiles. The dynrange package parameter applies to the stellar and galaxy analytic profiles. The larger this parameter the further the profile extends, particularly for De Vaucouleurs models. When modeling large galaxies this has a fairly strong affect on the execution time because the overall extent of the images becomes rapidly greater. Only for very high signal-to-noise objects will the cutoff be noticeable. A correction is made to account for lost light so that an aperture magnitude will give the correct value for an object of the specified total magnitude.
The object models are integrated over the size of the image pixels. This is done by subsampling, dividing up a pixel into smaller pieces called subpixels. For the image templates a bilinear surface interpolation function is used and integrated analytically over the extent of the subpixels. The user cumulative one dimensional profiles are first converted to intensity profiles. The various intensity profiles are then binned into pixel fluxes per subpixel on a grid much finer than the subpixel spacing. Then for any particular radius and object center the appropriate subpixel flux can be determined quickly and accurately.
The number of subpixels per image pixel is determined by the package parameters nxsub , nysub , nxgsub , and nygsub . The first two apply to the stars and the PSF and the latter two apply to the galaxies. Typically the subsampling will be the same in each dimension. The galaxies are generally subsampled less since they will have less rapidly changing profiles and are convolved by the PSF. Also, the stars are computed only a few times and then scaled and moved, as described below, while each galaxy needs to be computed separately. Therefore, one can afford greater precision in the stars than in the galaxies.
Given an image of several hundred pixels subsampled by a factor of 100 (10 x 10) this will be a very large number of computations. A shortcut to reduce this number of operations is allow the number of subpixels to change as a function of distance from the profile center. Since the profile center is where the intensity changes most rapidly with position, the greatest subsampling is needed for the pixel nearest the center. Further from the object center the intensity changes more slowly and the the number of subpixels may be reduced. Thus, the number of subpixels in each dimension in each pixel is decreased linearly with distance from the profile center. For example, a pixel which is 3.2 pixels from the profile center will have nxsub - 3 subpixels in the x dimension. There is, of course, a minimum of one subpixel per pixel or, in other words, no subsampling for the outer parts of the objects. By adjusting the subsampling parameters one can set the degree of accuracy desired at the trade off of greatly different execution times.
The star shapes are assumed constant over the images and only their position and magnitude change. Thus, rather than compute each desired star from the model profile or image template, a normalized star template is computed once, using the spatial transformation and subsampling operations described above, and simply scaled each time to achieve the desired magnitude and added at the requested position. However, the apparent star shape does vary depending on where its center lies within an image pixel. To handle this a set of normalized star templates is precomputed over a grid of centers relative to the center of a pixel. Then the template with center nearest to that requested, relative to a pixel center, is used. The number of such templates is set by the package parameters nxc and nyc where the two axis typically have the same values. The larger the number of centers the more memory and startup time required but the better the representation of this sampling effect. The choice also depends on the scale of the stars since the larger the star profile compared to a pixel the smaller the subcentering effect is. This technique allows generating images with many stars, such as a globular cluster or a low galactic latitude field, quite efficiently.
Unlike the stars, the galaxies will each have different profiles, ellipticities, and position angles and so templates cannot be used (except for special test cases as mentioned later). Another difference is that the galaxy models need to be convolved by the PSF; i.e. the shapes are defined prior to seeing. The PSF convolution must also be subsampled and the convolution operation requires as many operations as the number of pixels in the PSF for each galaxy subpixel. Thus, computing seeing convolved, well subsampled, large galaxy images is the most demanding task of all, requiring all the shortcuts described above (larger and variable subsampling and the subpixel flux approximation) as well as further ones.
The PSF used for convolving galaxies is truncated at a lower dynamic range than the stars according to the package parameter psfrange . This reduces the number of elements in the convolution dramatically at the expense of losing only a small amount of the flux in the wings. Like the stars, the PSF is precomputed on a grid of pixel subcenters and the appropriate PSF template is used for each galaxy subpixel convolution. Unlike the stars, the truncated PSF is normalized to unit flux in order to conserve the total flux in the galaxies. For the extended galaxies this approximation has only a very small effect. As with the other approximations one may increase the dynamic range of the PSF at the expense of an increase in execution time.
There is an exception to using the truncated PSF. If the size of the galaxy because very small, 0.01 pixel, then a stellar image is substituted.
OBJECT FILES
The object files contain lines defining stars and galaxies. Stars are defined by three numbers and galaxies by seven or eight as represented symbolically below.
stars: xc yc magnitude
galaxies: xc yc magnitude model radius ar pa <save>
xc in image = xoffset + xc / distance yc in image = yoffset + yc / distance
where xoffset and yoffset are the task offset parameters. Objects whose image centers fall outside the image dimensions are ignored.
flux = exptime/distance**2 * 10**(-0.4*(magnitude-magzero))
where exptime , distance , and magzero are task parameters. For the analytic star and galaxy models a correction is made for lost light due to the finite extent of the image in the sense that the flux added to the image will never quite be that requested.
I = exp (-1.6783 * R/radius)
where radius is the major axis scale length corresponding to half of the total flux.
I = exp (-7.67 * (R/radius)**1/4)
where radius is the major axis scale length corresponding to half of the total flux.
radius in image = radius / distance
1. Create a galaxy cluster with a power law distribution of field galaxies and stars as background/foreground.
ar> gallist galaxies.dat 100 spatial=hubble lum=schecter egal=.8
ar> gallist galaxies.dat 500
ar> starlist galaxies.dat 100
ar> mkobjects galaxies obj=galaxies.dat gain=3 rdnoise=10 poisson+
Making the image takes about 5 minutes (2.5 min cpu) on a SPARCstation 1.
2. Create a uniform artifical starfield of 5000 stars for a 512 square image.
ar> starlist starfield.dat 5000
ar> mkobjects starfield obj=starfield.dat gain=2 rdnoise=10 poisson+
This example takes about a minute on a SPARCstation 1.
3. Create a globular cluster field of 5000 stars for a 512 square image.
ar> starlist gc.dat 5000 spat=hubble lum=bands
ar> mkobjects gc obj=gc.dat gain=2 rdnoise=10 poisson+
This example takes about a minute on a SPARCstation 1.
4. Add stars to an existing image for test purposes.
ar> mkobjects starfield obj=STDIN gain=2 pois+ magzero=30
100 100 20
100 200 21
200 100 22
200 200 23
[EOF]
5. Look at the center of the globular cluster with no noise and very good seeing.
cl> mkobjects gc1 obj=gc.dat nc=400 nl=400 distance=.5 \ >>> xo=-313 yo=-313 radius=.1
The offset parameters are used to recenter the cluster from (256,256) in the data file to (200,200) in the expanded field. This example takes 30 sec (5 sec CPU) on a SPARCstation 1. To expand and contract about a fixed point define the object list to have an origin at zero.
ar> starlist gc.dat 5000 spat=hubble lum=bands xmin=-256 xmax=256 \
>>> ymin=-256 ymax=256
ar> mkobjects gc obj=gc.dat xo=257 yo=257 gain=2 rdnoise=10 poisson+
ar> mkobjects gc1 obj=gc.dat xo=257 yo=257 gain=2 \
>>> distance=.5 rdnoise=10 poisson+
6. Make an image of dev$pix at various distances and orientation. First we must subtract the background.
cl> imarith dev$pix - 38 pix cl> mkobjects pix1 obj=STDIN nc=200 nl=200 back=1000 \ >>> magzero=30 rd=10 poi+ 50 50 15.0 pix 40 1 0 150 50 15.6 pix 30 .8 45 50 150 16.5 pix 20 .6 90 150 150 17.1 pix 15 .4 135 [EOF]
It would be somewhat more efficient to first block average the template since the oversampling in this case is very large.
gallist, starlist, mknoise, mkheader