usim - EranOfek/AstroPack GitHub Wiki
This function can be employed to simulate an image obtained with one of the four ULTRASAT tiles exposed to a number of emission sources in its field of view. The primary outputs are an AstroImage object containing the injected source catalog and a FITS image file, as well as ds9-style region files containing positions of all the modeled sky sources and a text table with the catalog source positions (X, Y, RA, DEC), source magnitudes and count rates.
Possible inputs
- the tile name (A, B, C, D), def. to B
- a source catalog ([X, Y] or [RA Dec]):
- an AstroCatalog object OR
- an XY source table OR
- the number of sources N to be randomly distributed in the tile FOV (def. to 10)
- source magnitudes: an array mag (or 1 mag for all, def. to 20) and the filter for which the magnitudes are set (def. to ULTRASAT)
- galactic extinction in the field as E(B-V)
- source spectra:
- an array of AstSpec/AstroSpec objects or
- an array of spectral parameters (‘BB’ + temp. or ‘PL’ + index) different or same for all the sources or
- an array of N source spectra as N table columns [+ wavelength grid in the last N+1 column if the grid differs from the 2000:1:11000 A grid]
- the desired PSF resolution (1/47.5, 1/10, ⅕, ½, 1 of the ULTRASAT pixel) (def. to ⅕)
- the number of exposures in a set (def. to 3) and the exposure length (def. to 300 s)
- the aim point position in RA, DEC and the detector rotation angle (def. to 0 deg)
- the output directory (def. to current) and output filename template (def. to 'SimImage')
Examples
% Make an ULTRASAT tile 'B' image of 10 sources randomly distributed in the tile FOV,
% all with the same default ULTRASAT magnitude and BB spectrum of 5800 K, for 3 standard exposures of 300 seconds each,
% with source PSFs calculated at the scale of 1/5 pixel:
SimImage = ultrasat.usim('Cat', 10);
% Make an ULTRASAT tile 'A' image of sources with pixel coordinates from the catalog Cat,
% of ULTRASAT magnitudes listed in the vector Mag and spectra
% given by the vector of AstroSpec objects Spec, for 10 standard exposures of 300 seconds each,
% with source PSFs calculated at the scale of 1/2 pixel.
SimImage = ultrasat.usim('Cat', Cat, 'Mag', Mag, 'Spec', Spec, 'Tile', 'A', 'Exposure', [10 300], 'ImRes', 2);
% Make an ULTRASAT tile 'B' image of sources with sky coordinates from the catalog Cat, with the telescope aimpoint at RA, Dec = 210, 52
% and rotate it by 40 deg counterclockwise. Start the output file names with 'skysim':
SimImage = ultrasat.usim('Cat', Cat, 'SkyCat', true, 'RA0', 210, 'Dec0', 52, 'PlaneRotation', 40, 'OutName', 'skysim');
% Make an ULTRASAT tile 'B' image of sources with sky coordinates from the catalog Cat,
% and dereddened SDSS g magnitudes given by a vector Mag, account for extinction of E(B-V) = 0.1,
% with the telescope aimpoint at RA, Dec = 210, 52:
SimImage = ultrasat.usim('Cat', Cat, 'SkyCat', true, 'RA0', 210, 'Dec0', 52, 'Mag', Mag, 'Ebv', 0.1, 'FiltFam', 'SDSS', 'Filt', 'g');