This HTML automatically generated with rman for NEMO
Table of Contents

Name

ccdcross - cross correlate images with a reference image

Synopsis

ccdcross [parameter=value]

Description

ccdcross finds the offset between a reference image and one (or more) images based on the cross-correlation between two images. By selecting a specific center= and a box= size, one can save compute time and focus on a specific area. All assuming the offset is less than the box-size.

The centroid is determined using an intensity weighted mean in the correllated image. A future version may fit a 2D gaussian or appropriate function to the correllation image.

Some caution is warrented as the results can depend on the size of the box (box=) and number of pixels (n=) to look around the correllation peak. See also clop= below.

Parameters

The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
in=ref,im1,...
Input image files, first image is the reference image. At least two images need to be given.
No default.
out=im
Output cross image. This image will be square and have a smaller size, 2*box+1.
By default no image is written.
center=x0,y0
X-Y Reference center around which a box (see box= below) is taken. These are 0-based integer pixels.
Default: center of first input image.
box=b_half
(Half) Size of correlation box. The output image is then forced to have an odd pixel size, 2*box+1. The shift between the images should not exceed box, or it will not find the center.
Although box= and center= can be used to subset an image on the fly, another approach is to use ccdsub(1NEMO) and make new images. This might be needed for large shifts.
By default half the mapsize is used, which can be computationally expensive.
n=n_half
Half size of box inside correllation box to find the center. See also clop= to limit the clip level in this correlation image.
By default half the box is used.
clip=clip_value
Only use values above this clip level in the input images will be used for the correlation.
By default values are not clipped.
clop=clip_value
Only use values above this clip level in the final correlation image. Units are loosely related to those of the input image times the number of pixels squared in the comparison area.
By default values are not clipped.
bad=bad_value
bad value to ignore.
By default there is no bad value recognized.

Caveat

Only 2D images are handled.

The WCS of the output image is not meaningfull, and remains in pixel space. Since the number of pixels is odd, the reported shift between the images is the shift from the central pixel, which is made the reference pixel.

Images should ideally be the same size, but nothing will stop the program from running off without that. The user is then responsible for computing the true offsets as all bets are off.

A wrong choice of box= and n= can cause a bias in the center. Using clop= can help making it more robust.

Only one clip= value can be given, ideally each input image should have it’s

own clip

Examples

Here two gaussian shaped sources with noise are created with a small 1 pixel offset from each other.

ccdgen - gauss 1,2 size=128,128 center=64,64 | ccdgen g64 noise spar=0,0.05 seed=64 in=-
ccdgen - gauss 1,2 size=128,128 center=65,65 | ccdgen g65 noise spar=0,0.05 seed=65 in=-
ccdcross g64,g65 shift.ccd box=16
...
### nemo Debug[0]: Using 2 images
### nemo Debug[0]: Image 0: pixel size 1 1 minmax -0.22856 0.971157 [g64]
### nemo Debug[0]: center=64,64
### nemo Debug[0]: Full box size 33
### nemo Debug[0]: Image 1: pixel size 1 1 minmax -0.20781 0.927271 [g65]
### nemo Debug[0]: 128 128 16 0 1
### nemo Debug[0]: New min and max in correlation image are: -0.597157 11.907974
### nemo Debug[0]: Max cross 11.908 @ 17 17
### nemo Debug[0]: MinMax in 49 pts: 3.40988 11.908, use clop= to clip the corr out image
### nemo Debug[0]: X,Y mean: -0.0561799 -0.0237276
### nemo Debug[0]: X,Y sig: 1.81226 1.81864
### nemo Debug[0]: Center at: 0.94382 0.976272

See Also

ccdblob(1NEMO) , ccdsub(1NEMO) , image(5NEMO)

Author

Peter Teuben

Update History


11-Apr-2022    V0.1 Created    PJT
3-aug-2023    V0.2 fix absolute coordinate    PJT
18-apr-2024    V0.3 add peak flux in correlation map    PJT


Table of Contents