WIRE Focal-Plane-Array Alignment Software


Description

Perl script FPAalign.pl computes a least-squares fit to source positions extracted from 12-µm and corresponding 25-µm WIRE images to determine parameters fpadx, fpady, and fpadtheta, which characterize the alignment between the 12-µm and 25-µm WIRE FPAs, and, hence, the associated imagery. The software requires the x and y focal lengths of the optics for both bands, as well as a distortion map transformations if distortion exists, in order to make the necessary scaling/distortion corrections to the input image data prior to the data fitting. For verification of the relative changes in input focal lengths between the two bands, a second fit that additionally solves for inter-band x and y scale changes is also done.

The fit parameters fpadx, fpady, and fpadtheta are command-line input parameters used by the WIRE coadder to shift and rotate the 25-µm coadd image so that it is co-aligned with its 12-µm coadd image counterpart.

If source positions are extracted from coadd images, then the applicable value of nrep should be specified on the command line. Also, in this case and if scaling/distortion corrections have already been made to the input image data, then the system nominal value of 1000 mm should be used (this is the default value) for the x and y focal lengths of both bands.

The source-position data-fitting equations are:

x' = (x + fpadx) cos(fpadtheta) - (y + fpady) sin(fpadtheta)

y' = (x + fpadx) sin(fpadtheta) + (y + fpady) cos(fpadtheta)

where the source position coordinates are (x, y) in the 25-µm image, and (x', y') in the 12-µm image. The nonlinear least-squares fitting module rotlsqdrv2.f does the actual 3-parameter data fitting for fpadx, fpady, and fpadtheta. The iterated linear least-squares fitting module lsqtrsdrv.f does the actual 5-parameter data fitting for fpadx, fpady, fpadtheta, scalex and scaley.

A weight should be assigned to the position data for each source to indicate the confidence in the data (the higher the weight, the more accurate the data). The weights, along with an estimate of the weighted-average standard deviation of the source position data, are used to compute individual data point standard deviations, which are needed for the data fitting to compute the goodness-of-fit measure chi2.

The software is now under both CVS version control (/proj/wire/cvsroot/da/russ/acs), and make control (makefile.p-bin). The executables have been delivered to /proj/wire/tst/bin. The source codes are located in /proj/wire/russ/acs.

Required and Optional Inputs

The required inputs for FPAalign.pl consist of positions and weights of sources common to a set of 12-µm and corresponding 25-µm WIRE images.

The source positions and weights should be stored in an ASCII data file, where the first line gives the number of sources and subsequent lines give the data for each source on a separate line. The data values for each source are; x and y pixel positions in the 25-µm image; x' and y' pixel positions in the 12-µm image; and the associated confidence weight. Fraction pixel positions, of course, are allowed. Use white space as a data delimeter (no commas, etc., please). An example data file is given as follows (this is FPAalign2.dat, referred to in the "Usage and Sample Results" section below):

7
532   373   532   464   1
438   446   438   538   1
397   466   399   560   1
360   483   363   577   1
391   321   390   413   1
420   244   420   337   1
132   281   133   376   1


The table below describes the available command-line inputs. Note that only the first is required.

Command-line input Definition
-indat or -ind filename Filename of ASCII data file of source positions and confidence weights.
-nrep or -nr value Pixel size of input data relative to a WIRE pixel. The default value is 1.
-f12x value Focal length in x-dimension corresponding to the x scale of the 12-µm input image data. The default value is 1000 mm.
-f12y value Focal length in y-dimension corresponding to the y scale of the 12-µm input image data. The default value is 1000 mm.
-f25x value Focal length in x-dimension corresponding to the x scale of the 25-µm input image data. The default value is 1000 mm.
-f25y value Focal length in y-dimension corresponding to the y scale of the 25-µm input image data. The default value is 1000 mm.
-xdc value X-coordinate of distortion center on WIRE FPA (assumed to be band independent). The default value is 64.5 pixels.
-ydc value Y-coordinate of distortion center on WIRE FPA (assumed to be band independent). The default value is 64.5 pixels.
-distortflag or -df Enables distortion corrections. The software must be modified to have the correct distortion map transformations. Default is no distortion correction.
-noscale or -nos Switch that causes the image plate scales to be fixed at their current values, so that the 5-parameter iterated linear least-squares fit module will solve for only 3 parameters (and these parameters are the same as solved for by the nonlinear least-squares fit module).
-verbose or -v Verbose mode. Shows final outputs from the least-squares fitting modules. Default is off.
-execPath or -xp path Pathname for the binaries used by FPAalign.pl.
-nsigLim or -nsl value Outlier rejection parameter (see lsqtrsdrv.f documentation for npostol). The default value is 5.
-radtol or -rad value Outlier rejection parameter (see lsqtrsdrv.f documentation). The default value is 0.25 pixels.
-chi2tol or -chi value Outlier rejection parameter (see lsqtrsdrv.f documentation). The default value is 0.8.
-siginp or -sig value Estimated weighted-average standard deviation of the source position data (see lsqtrsdrv.f documentation). The default value is 0.05 pixels (= 0.8 arcseconds for WIRE pixels).

Outputs

The basic outputs are fpadx, fpady, and fpadtheta, which are the x and y shifts (WIRE pixels) and rotation (degrees) required to co-register a 25-µm image to a corresponding 12-µm image (positive fpadtheta, fpadx,and fpady mean rotate counter-clockwise, and shift right and up the 25 µm image). These values are used by the WIRE coadder to co-align 25-µm coadd images with their 12-µm counterparts.

Other important outputs are the image plate scales: scalex and scaley. These values indicate whether the 25-um focal lengths differ from the 12-um focal lengths (Cf. these results with those derivable from Calboresight.pl or Calboresightexec.pl).

See the next section for sample results.

Usage and Sample Results

Example of how to execute FPAalign.pl for input source positions and weights stored in FPAalign2.dat (the actual values in this file are listed above in the "Required and Optional Inputs" section):
   FPAalign.pl -ind FPAalign2.dat -nrep 4 -chi2tol 1.0

The corresponding outputs are:
FPAalign.pl version $Id: FPAalign.pl,v 1.10 1998/04/06 16:17:53 laher Exp $  update Mon_1998/04/06(096)_09:18:38 , PID=12669
Date/time: Mon_1998/04/06(096)_09:21:17   PCPU: 1.02/0.17/6  CCPU: 0.04/0.06


Named parameters for Fpaalign.pl:
  indat = /proj/wire/russ/acs/FPAalign2.dat; debug = undef; 
  execpath = /proj/wire/tst/bin/; verbose = undef; log = undef; nsiglim = 5; 
  radtol = 0.25; chi2tol = 1; siginp = 0.05; nrep = 4; f12x = 1000; 
  f12y = 1000; f25x = 1000; f25y = 1000; xdc = 64.5; ydc = 64.5; 
  distortflag = undef; noscale = undef; 

Derived alignment between 12-um and 25-um FPAs from 3-parameter fit:
   Number of sources used by fit = 7
   chi2                          = 4338.5887520471
   # degs frdm                   = 11
   FPADX (WIRE pixels)           = -0.91570119988132
   FPADY (WIRE pixels)           = 24.1380193716928
   FPADTHETA (degrees)           = -0.535636

Derived alignment between 12-um and 25-um FPAs from 5-parameter fit:
   Number of sources used by fit                 = 7
   chi2                                          = 2931.6558397654
   # degs frdm                                   = 9
   FPADX (WIRE pixels)                           = -0.542666904420641
   FPADY (WIRE pixels)                           = 23.8895062242047
   FPADTHETA (degrees)                           = -0.61623380295535
   X-SCALE of 25-um FPA (relative to 12-um FPA)  = 0.99429664766449
   Y-SCALE of 25-um FPA (relative to 12-um FPA)  = 1.0040603487701
   New x focal length for 25-um image data* (mm) = 994.29664766449
   New y focal length for 25-um image data* (mm) = 1004.0603487701
   *USE ONLY FOR IMAGE DATA ALREADY SCALED WITH OLD FOCAL LENGTHS.


End of FPAalign.pl status 0, PID=12669
Date/time: Mon_1998/04/06(096)_09:21:19   PCPU: 1.17/0.18/8  CCPU: 0.34/0.2


Analysis of the sample results: The input data in FPAalign2.dat were found by doing Skyview picks on sources in a set of 12-µm and 25-µm coadd images of a segment's worth of simulated WIRE data with nrep=4. Corrections for image scale were done by the coadder (using f12x = f25x = 940 mm and f12y = f25y = 1000 mm). To suppress the outlier rejection that is done in the 5-parameter iterated linear least-squares fit module, a chi2tol value of 1.0 was used (note that the nonlinear least-squares fit module also performs outlier rejection, but no outliers are rejected for this case unless chi2tol is set to ~0.25). There is disagreement between the 3-parameter and 5-parameter fit results, and the results from the 5-parameter fit indicate that the 25-µm input data need to be rescaled with x and y focal lengths of 994.3 mm and 1004.1 mm, respectively, in order to normalize the plate scales of the 25-µm image data relative to the 12-µm image data, and achieve a better fit. Since the simulated data have identical focal lengths for both bands, errors in the input data are probably responsible for the discrepancies between the fits, which is not surprising given the crudeness of the employed source extraction method.

The effects of applying the derived values of fpadx, fpady, and fpadtheta are shown below. After co-alignment, notice how the sources have the same positions in both the 12-µm and 25-µm coadd images, whereas before co-alignment they did not.

12-µm coadd image versus 25-µm coadd image, before co-alignment
12-µm coadd image versus 25-µm coadd image, after co-alignment


Last revised: April 6, 1998

Software developer: Russ Laher (laher@ipac.caltech.edu)

URL: http://spider.ipac.caltech.edu/staff/laher/FPAalign.html

Return to Home Page