IRIS TUTORIAL
Optimal subtraction

The OPT_SUB command perform optimized subtraction of two images for highlight the differences. This type of function is  useful for example for the search a faint supernova into galaxies arms. The few images which follow watch a characteristic example of use of this new function.

Here an example. The problem is to subtract two images of galaxy NGC266 acquired with very different instruments, eliminate the galaxy and highlight a supernova in the first image (left image below). This supernova is in fact an artificial star added for the demonstration. It reside just in the south of the core of the galaxy. The name of the left image is N266_1, the name of the right image is N266_2:

The first operation to be realized consists in superimposing the these two images. We use the COREGISTER: command (or the equivalent Full matching option of Stellar registration dialog box / Processing menu - see here for details):

>COREGISTER N266_1 N266_2
>SAVE N266_1

The result is the new N266_1 image:

At this stage, the images having the same format, it is possible to substrat the first from the second for example. The result below shows the simulated supernov, but because the PSF (spread function) is the same for the two images many residual artifact can also generate false detections:

>SUB N266_2 1000

Command OPT_SUB compute a convolution kernel that so that wa have a maximum of resemblance between the N266_1 image and image N266_2. Iris proceeds by convoluting the N266_1 image (the image in memory) with the suitable kernel. If possible, the processed image is the most resolved of the two. The calculation of this kernel is carried out by solving a system of linear equations which connect the shape of a star (that one selects with the mouse as a preliminary) common to both images and the shape of the convolution matrix. So, before run command OPT_SUB it is necessary to surround a well insulated unsatured star. It is the center of the selection box which is important and not its size.

At the end of OPT_SUB, the N266_1 image is smoothed by the kernel and displayed. You can now substrat this result from N266_2 . The stars of the field well disappeared (except saturated stars) and the detection of the supernova is now not ambiguous:

>OPT_SUB N266_2
>SUB N266_2 1000

To note that the convolution kernel is saved in the working repertory in the shape of a small file image having the name @k (the elements of the matrix were multiplied by a coefficient 1000). If need, command FILE_CONV makes the convolution of the image in memory by a kernel of your choice (before the convolution is carried out, the values of the matrix are to multiply by Iris by 0.001). For example:

>FILE_CONV @k

The size of the kernel by default is of 11x11 pixels. This value can be modified by changing the KernelSize variable of the file IRIS.INI which is in the Windows directory of your hard disk.

Below, another example of use of OPT_SUB. From left to right, the first image (note the selected unsatured star for PSF estimation, red rectangle), the second image (note the different spatial resolution - less resolved), the difference between the images, and the computed kernel. Use this sequence to display the kernel: