GNU Astronomy Utilities


Next: , Previous: , Up: SubtractSky   [Contents][Index]


6.5.2 Tiling an image

Some of the programs in Gnuastro will need to divide the pixels in an image into individual tiles or a mesh grid to be able to deal with gradients. In this section we will explain the concept in detail and how the user can check the grid. In the case of SubtractSky, if the image is completely uniform then one sky value will suffice for the whole image. See Sky value for the definition of the sky value. Unfortunately though, as discussed in SubtractSky, in most images taken with ground or space-based telescopes the sky value is not uniform. So we have to break the image up into small tiles on a mesh grid, assume the sky value is constant over them and find the sky value on those tiles.

Meshes are considered to be a square with a side of --meshsize pixels. The best mesh size is directly related to the gradient on the image. In practice we assume that the gradient is not significant over each mesh. So if there is a strong gradient (for example in long wavelength ground based images) or the image is of a crowded area where there isn’t too much blank area, you have to choose a smaller mesh size. A larger mesh will give more pixels and so the scatter in the results will be less.

For raw image processing, a simple mesh grid is not sufficient. Raw images are the unprocessed outputs of the camera detectors. Large detectors usually have multiple readout channels each with its own amplifier. For example the Hubble Space Telescope Advanced Camera for Surveys (ACS) has four amplifiers over its full detector area dividing the square field of view to four smaller squares. Ground based image detectors are not exempt, for example each CCD of Subaru Telescope’s Hyper Suprime-Cam camera (which has 104 CCDs) has four amplifiers, but they have the same height of the CCD and divide the width by four parts.

The bias current on each amplifier is different, and normally bias subtraction is not accurately done. So even after subtracting the measured bias current, you can usually still identify the boundaries of different amplifiers by eye. See Figure 11(a) in Akhlaghi and Ichikawa (2015) for an example. This results in the final reduced data to have non-uniform amplifier-shaped regions with higher or lower background flux values. Such systematic biases will then propagate to all subsequent measurements we do on the data (for example photometry and subsequent stellar mass and star formation rate measurements in the case of galaxies). Therefore an accurate sky subtraction routine should also be able to account for such biases.

To get an accurate result, the mesh boundaries should be located exactly on the amplifier boundaries. Otherwise, some meshes will contain pixels that have been read from two or four different amplifiers. These meshes are going to give very biased results and the amplifier boundary will still be present after sky subtraction. So we define ‘channel’s. A channel is an independent mesh grid that covers one amplifier to ensure that the meshes do not pass the amplifier boundary. They can also be used in subsequent steps as the area used to identify nearby neighbors to interpolate and smooth the final grid, see Grid interpolation and smoothing. The number of channels along each axis can be specified by the user at run time through the command-line --nch1 and --nch2 options or in the configuration files, see Configuration files. The area of each channel will then be tiled by meshes of the given size and subsequent processing will be done on those meshes. If the image is processed or the detector only has one amplifier, you can set the number of channels in both axises to 1.

Unlike the channel size, that has to be an exact multiple of the image size, the mesh size can be any number. If it is not an exact multiple of the image side, the last mesh (rightest, for the first FITS dimension, and highest for the second when viewed in SAO ds9) will have a different size than the rest. If the remainder of the image size divided by mesh size is larger than a certain fraction (value to --lastmeshfrac) of the mesh size along each axis, a new (smaller) mesh will be put there instead of a larger mesh. This is done to avoid the last mesh becoming too large compared to the other meshes in the grid. Generally, it is best practice to choose the mesh size such that the last mesh is only a few (negligible) pixels wider or thinner than the rest.

The final mesh grid can be seen on the image with the --checkmesh option that is available to all programs which use the mesh grid for localized operations. When this option is called, a multi-extension FITS file with a _mesh.fits suffix will be created along with the outputs, see Automatic output. The first extension will be the input image. For each mesh grid the image produces, there will be a subsequent extension. Each pixel in the grid extensions is labeled to the mesh that it is part of. You can flip through the extensions to check the mesh sizes and locations compared to the input image.


Next: , Previous: , Up: SubtractSky   [Contents][Index]