The Image Math dialog box provides a range of image processing operations that can be applied to either a single FITS image or multiple FITS images. It is organized into three tabs: Standard, Advanced and Binning, each of which is detailed in the following sections.


Standard



The Standard tab consists of two sections: Involving 1 image, Involving 2 images.



  1. Involving 1 image: use Add file to open the FITS file on which you want to perform an operation. Alternatively, if you already have one or more FITS images open and want to select one, use Add open image. Upon selecting a file or open image, the Image box will display the chosen entry. 

    Next, choose an operator from the drop down list:

    • Add scalar: adds the Scalar value to each pixel value in the selected image.

    • Subtract scalar: subtracts the Scalar value from each pixel in the selected image.


    • Multiply by scalar: multiplies each pixel value in the selected image by the Scalar value.


    • Divide by scalar: dividies each pixel value in the selected image by the Scalar value.


Click the Calculate button to execute the operation. The resulting image will open in a new FITS window.


  1. Involving 2 images: similar to above, open two FITS files or select two already open FITS images, then choose an operator from the drop down list:

    • +: creates a new FITS image by adding the pixel values of Image 1 and Image 2
       
    • -: creates a new FITS image by subtracting the pixel values of Image 2 from Image 1

    • *: creates a new FITS image by multiplying the pxiel values of Image 1 with Image 2

    • /: creates a new FITS image by dividing the pixel values of Image 1 by Image 2

Click the Calculate button to execute the operation and display the resulting new FITS image.



Advanced



The operations in this tab allow to combine multiple FITS images. One has to keep in mind that all FITS images recorded by a sensor include noise. When performing operations such as addition or subtraction of images, the noise accumulates. This observation is particularly significant in the image calibration process, elucidating why the standard practice involves utilizing multiple bias, dark and flat frames to calibrate a Science image, rather than relying on a single frame of each type. By first averaging multiple bias, dark and flat frames before applying them to a Science image, the introduction of noise is significantly curtailed.


The Advanced tab provides operators designed for large sets of FITS images, enabling actions such as averaging or median combining the set to produce a new image.



The Advanced tab necessitates a minimum of two FITS images, which can be acquired by either opening FITS files using the Add files option or by selecting already open FITS images through the Add open images option. Once the files or open images are selected, the Selected images box will display the chosen entries. 


Subsequently, choose an operator from the Math operator section. Utilize the drop down list to select the desired operator:

    • Sum: creates a new FITS image by summing the pixel values of all selected images.

    • Average: creates a new FITS image by averaging the pixel values of all selected images. This method yields optimal results when the noise in the selected images is random Gaussian noise. However, if one of the images contains pixels with exceptional values (outlier pixels resulting for instance from cosmic rays), these values will be incorporated in the new FITS image.

    • Median: creates a new FITS image by median combining the pixel values of all selected images. This method effectively suppresses outlier pixels but results in a 25% increase in the noise level compared to averaging. 


    • Sigma clipping: this method initially removes outlier pixels from the selected images before averaging them. It is a compromise between the Average and Median methods, combining the noise reduction advantages of the Average method with the outlier pixel rejection characteristics of the Median method. 

      The Sigma value determines the treshold for identifying outliers. Pixels with values beyond a certain number of sigma from the mean are considered outliers. A higher sigma value results in a more stringent criterion for identifying outliers, while a lower sigma value is more permissive. Adjusting the sigma value allows you to balance the removal of outliers with the preservation of genuine features in the image.



The Stack option is a feature compatible with all 4 previously mentioned methods. It is particularly useful in situations involving a series of images capturing the same target but exhibiting slight variations, i.e. shifts in the x-y plane caused by a minor movement of the field of view (e.g., resulting from imprecisions in the telescope mount tracking). The stack operation helps to improve the SNR ratio of your image: when enabled, each image undergoes x-y shifting relative to the first image, employing a cross-correlation technique, to ensure that all pixels align spatially. The first image remains unaltered, serving as a reference image to which all subsequent images are aligned. After stacking, the chosen operator (e.g., average or median combine) is then applied. 
Note that stacking only works for images exhibiting x-y shifts; it is not applicable to images with rotational differences.



The Normalize option is available when selecting the Average or Median methods. When enabled, each image undergoes a median-normalization before the selected operator (e.g., average or median combine) is employed. Median-normalization entails determining the median value of an image, and subsequently dividing each pixel value of the image by this median value. 

Normalization is commonly applied when working with flat field frames. Each flat field image is normalized (adjusted) to values approximating unity. This ensures that post flat field correction, the numerical intensities in the images resemble those prior to flat fielding. In simpler terms, the flat field correction for pixels with responses close to the median is adjusted to approximately 1. 



Use the Remove from list button to remove one or more entries from the Selected images list.



Binning



The operations in this tab allow to bin one or more FITS images. Binning is the process of combining adjacent pixels into a single (super) pixel, often in a square grid format (i.e., 2x2, 3x3, etc). Example: when you bin an image 2x2, Phoranso combines 4 pixels into a single pixel, halving the image resolution in each dimension.



First add one or more FITS images to the Selected images list using the Add files or Add open images buttons. Next, select the desired Binning operator from the drop down list (options are 2x2, 3x3 and 4x4 binning) and the Pixel combination to be applied. Press Calculate to start the binning operation, which results in the display of one new binned image for each image in the list of Selected images.


    • When Average is selected as Pixel combination method, each binned super pixel value will be the average of the adjacent pixels. Example: with 2x2 binning, the super pixel value will be the average of the 4 adjacent pixels.


    • When Sum is selected as Pixel combination method, each binned super pixel value will be the addition of the adjacent pixels. 



Use the Remove from list button to remove one or more entries from the Selected images list.