imUtil.art - EranOfek/AstroPack GitHub Wiki
Description
The imUtil.art package contains functions for generating artificial astronomical images including background and sources.
List of functions
- imUtil.art.injectArtSrc
- imUtil.art.directInjectSources
- imUtil.art.injectStamps
imUtil.art.injectArtSrc
Make an artificial sky image with rotated and jitter-blurred source point source functions (PSFs) injected to the catalog positions. The mandatory inputs are the image sizes, the pixel positions of the emission sources, their integral count rates, and their PSF stamps (it is also possible to use one PSF stamp for all the sources). It is possible to rotate the source PSFs by individual angles or by a single angle for all the sources. The outputs are a 2D array containing the resulting source image and a 2+1 D array of rotated and jitter-blurred source PSFs.
% Make a SizeX x SizeY sky image containing images of input sources all rotated by -90 deg
% (X, Y, CPS are vectors, PSF is either a 2D or a 3D array):
[Image, JPSF] = imUtil.art.injectArtSrc (X, Y, CPS, SizeX, SizeY, PSF, 'RotatePSF', -90);
imUtil.art.directInjectSources
In an given artificial sky image inject a list of input sources to their catalog positions with source point spread functions (PSFs) scaled relative to the image pixel size by a given factor. The mandatory inputs are the initial sky image (without sources), a 3-columnt table of sources (X, Y, full band flux normalization), a pixel scaling factor, and a 2+1 D array of source PSFs. The output is a 2D array containing the resulting sky image.
% Inject into Image0 all the source PSFs scaled by the factor Scaling at positions given by Cat:
Image1 = imUtil.art.directInjectSources (Image0, Cat, Scaling, PSF);
imUtil.art.injectStamps
Make an artificial sky image from input source stamps and background. Optionally add noise and/or subtract the newly constructed image from another one ('Args.InputImage') or add to it. The mandatory inputs are a cube of PSF stamps (M x M x N objects) or a cell array of PSF stamps (for the case the PSF size varies), and an array of source fluxes (in counts). The output is a 2D array containing the resulting sky image and (optionally) a sum or difference of the 'Args.InputImage' and the constructed artificial sky image.
Im = imUtil.art.injectStamps(XY,PSF,F,'Back',200.);