GNU Astronomy Utilities



10.8.4 Invoking astscript-psf-unite

This installed script will join two PSF images at a given radius. This operation is commonly used when merging (uniting) the inner and outer parts of the PSF. A complete tutorial is available to show the operation of this script as a modular component to extract the PSF of a dataset: Building the extended PSF. The executable name is astscript-psf-unite, with the following general template:

$ astscript-psf-unite [OPTION...] FITS-file

Examples:

## Multiply inner.fits by 3 and put it in the center (within a radius of
## 25 pixels) of outer.fits. The core goes up to a radius of 25 pixels.
$ astscript-psf-unite outer.fits \
           --core=inner.fits --scale=3 \
           --radius=25 --output=joined.fits

## Same example than the above, but considering an
## ellipse (instead of a circle).
$ astscript-psf-unite outer.fits \
           --core=inner.fits --scale=3 \
           --radius=25 --axis-ratio=0.5 \
           --position-angle=40 --output=joined.fits

The junction is done by considering the input image as the outer part. The central part is specified by FITS image given to --inner and it is multiplied by the factor --scale. All pixels within --radius (in pixels) of the center of the outer part are then replaced with the inner image.

The scale factor to multiply with the inner part has to be explicitly provided (see the description of --scale below). Note that this script assumes that PSF is centered in both images. More options are available with the goal of obtaining a good junction. A full description of each option is given below.

-h STR
--hdu=STR

The HDU/extension of the input image to use.

-i STR
--inner=STR

Filename of the inner PSF. This image is considered to be the central part of the PSF. It will be cropped at the radius specified by the option --radius, and multiplied by the factor specified by --scale. After that, it will be appended to the outer part (input image).

-I STR
--innerhdu=STR

The HDU/extension of the inner PSF (option --inner).

-f FLT
--scale=FLT

Factor by which the inner part (--inner) is multiplied. This factor is necessary to put the two different parts of the PSF at the same flux level. A convenient way of obtaining this value is by using the script astscript-model-scale-factor, see Invoking astscript-psf-scale-factor. There is also a full tutorial on using all the astscript-psf-* installed scripts together, see Building the extended PSF. We recommend doing that tutorial before starting to work on your own datasets.

-r FLT
--radius=FLT

Radius (in pixels) at which the junction of the images is done. All pixels in the outer image within this radius (from its center) will be replaced with the pixels of the inner image (that has been scaled). By default, a circle is assumed for the shape of the inner region, but this can be tweaked with --axis-ratio and --position-angle (see below).

-Q FLT
--axisratio=FLT

Axis ratio of ellipse to define the inner region. By default this option has a value of 1.0, so all central pixels (of the outer image) within a circle of radius --radius are replaced with the scaled inner image pixels. With this option, you can customize the shape of pixels to take from the inner and outer profiles.

For a PSF, it will usually not be necessary to change this option: even if the PSF is non-circular, the inner and outer parts will both have the same ellipticity. So if the scale factor is chosen accurately, using a circle to select which pixels from the inner image to use in the outer image will be irrelevant.

-p FLT
--position-angle=FLT

Position angle of the ellipse (in degrees) to define which central pixels of the outer image to replace with the scaled inner image. Similar to --axis-ratio (see above).

-t
--tmpdir

Directory to keep temporary files during the execution of the script. If the directory does not exist at run-time, this script will create it. By default, upon completion of the script, this directory will be deleted. However, if you would like to keep the intermediate files, you can use the --keeptmp option.

-k
--keeptmp

Do not remove the temporary directory (see description of --keeptmp). This option is useful for debugging and checking the outputs of internal steps.