(b2) Testing and Perfecting the Coalignment of a Stereoscopic EUVI Image Pair



If you don't trust the coalignment between a stereoscopic image pair from spacecraft A and B, this routine will test how good the coalignment is and produce an improved coaligned image pair.

Let us assume you produced already a coaligned EUVI image pair with the routine EUVI_STEREOPAIR.PRO, which stores the coaligned image pair in the array IMAGE_PAIR(2, NX, NY), where the coalignment was done based on the information in the FITS headers of the image. If you call the routine EUVI_COALIGN.PRO, it will will perform an empirical finetuning of the possible imperfect coalignment, based on limb edge detection and correlation of photospheric features. The routine shifts the second image in x-direction and in y-direction and determined the optimum coalignment from the minimum difference at sharp edges at the limb (in N, S, E, and W direction). Then it will rotate the solar disk for a range of roll angles and determine the best relative roll angle from the minimum difference of the images. Each shift is repeated 3 times and the mean and standard deviation of x-offsets, y-offsets, and roll angle is calculated and displayed on the screen and returned in the variables DX, DY, and ROLL in units of pixels and degrees. The better coaligned images are stored in the array COALIGNED_PAIR(2, NX, NY). The algorithm works satisfactorily if the input images are already coaligned within the ranges of the shifts (10 pixels) and roll angles (ROLL_MAX).

Run the steps in tutorial (2a) to obtain a preliminary coalined image pair in IMAGE_PAIR(2, NX, NY) and the parameters in PARA, or restore the data from the savefile.

IDL>
savefile='loop_A.sav'
restore,savefile ;restore saved data from step (2a)
roll_max=1.0 ;maximum roll angle range of +/-1 deg for expected roll-angle misalignment
euvi_coalign,image_pair,coaligned_pair,para,roll_max,roll,dx,dy
save,filename=savefile,image_pair,coaligned_pair,para

The output is in the variables DX, DY, and ROLL, which give the mean and standard deviation of the offsets. For this example we fine a x-offset of DX=-0.108+/-0.038 pixels, a y-offset of DY=0.241+/-0.199 pixels, and a roll angle offset of ROLL=0.014+/-0.050 deg, so both images are near-perfectly coaligned with subpixel accuracy. Since the coalignment correction is not significant, the pre-coaligned images in IMAGE_PAIR can be used, while the corrected images in IMAGES_COALIGNED should not be used in this case, since they contain somewhat more data noise due to the additional interpolations.
help,image_pair,coaligned_pair
IMAGE_PAIR INT = Array[2, 2048, 2048]
COALIGNED_PAIR INT = Array[2, 2048, 2048]
print,dx,dy,roll
DX = -0.107665 , 0.0383115
DY = 0.241021 , 0.198999
ROLL = 0.0140537 , 0.050000