aboutsummaryrefslogtreecommitdiff
path: root/noao/nproto/doc/irmatch2d.hlp
blob: 80f8b42ea226fe2a1f0ca1b852ac396f5787801c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.help irmatch2d Jan90 noao.nproto
.ih
NAME
irmatch2d -- align and match the elements of the mosaiced image
.ih
USAGE
irmatch2d input output database coords
.ih
PARAMETERS
.ls input
The mosaiced image to be aligned. This image must have been produced by
the IRMOSAIC task and have an accompanying database file specified by
\fIdatabase\fR.
.le
.ls output
The aligned and matched image produced by IRMATCH2D.
.le
.ls database
The database file from the IRMOSAIC task.
.le
.ls coords
If \fIalignment\fR = "coords", then \fBcoords\fR is
the text file listing the coordinates of objects in the input
image one object per line in the following
format: 1) the x and y coordinates of the object in the first subraster
2) the x and y coordinates of the same object in the second subraster
3) the x and y coordinates of the next object in the first subraster
etc.
If \fIalignment\fR = "file", then \fBcoords\fR is the text file listing
the x, y and intensity shifts in columns 1, 2 and 3 respectively,
of each input subraster relative to the reference subraster. The
most common use of this option is to make fine adjustments by hand
to the output of IRMATCH2D by editing the computed shifts slightly and rerunning
IRMATCH2D with the new shifts.
.le
.ls xshift
The x shift in pixel units if \fIalignment\fR = "shifts".
.le
.ls yshift
The x shift in pixel units if \fIalignment\fR = "shifts".
.le
.ls alignment = "coords"
The method of aligning the subraster.
.ls coords
The x and y positions of the marker points are listed in a file in the
format specified by the \fIcoords\fR parameter.
.le
.ls shifts
The x and y shifts of a subraster with respect to its neighbour are
set to \fIxshift\fR and \fIyshift\fR.
.le
.ls file
The x,  y  and intensity shifts of each input subraster with respect to the
reference subraster image.
.le
.le
.ls match = "*"
Match intensities using the overlap region between adjacent subrasters. The
median intensity is computed in the overlap region
and the intensity scale of the current subraster is scaled to that of
the previous subraster. Intensities are matched in two dimensions, first
in the order in which they
were placed in the output image and then in the orthogonal dimension.
The default is match everything.
Those subrasters to be matched must be listed by number. For example to
match intensities for subrasters 1 to 5 and 10 to 20 set match = "1-5,10-20".
To match all the subrasters set match = "1-999" or match="*".
.le
.ls nxrsub = INDEF, nyrsub = INDEF
The column and row index of the reference subraster. This will default
to the central subraster.
.le
.ls xref = 0, yref = 0
The x and y offset of the reference subraster in the output image. By default
the reference subraster is placed in the same position in the output image
that it occupied in the input image.
.le
.ls trimlimits = "[1:1,1:1]"
The number of rows and columns to be trimmed off each input subraster
before it is copied to the output image in section notation.
The default is to trim 1 row and column off each edge of the input
subraster.
.le
.ls nimcols = INDEF, nimlines = INDEF
The number of columns and lines in the output image. The default is the
number of lines and columns in the input image.
.le
.ls oval = INDEF
The value of undefined pixels in the output image. The default is the value
in the database file from IRMOSAIC.
.le
.ls interpolant = linear
The type of interpolant used to shift the subrasters. The options are:
.ls nearest
Nearest neighbour interpolation.
.le
.ls linear
Bilinear interpolation.
.le
.ls poly3
Bicubic polynomial interpolation.
.le
.ls poly5
Biquintic polynomial interpolation.
.le
.ls spline3
Bicubic spline interpolation.
.le
.le
.ls verbose = yes
Print messages on the terminal describing the progress of the task.
.le
.ih
DESCRIPTION
IRMATCH2D takes the mosaiced image \fIinput\fR, the database file \fIdatabase\fR
generated by IRMOSAIC and a list of coordinates \fIcoords\fR and computes
an output image \fIoutput\fR in which all the individual subrasters are aligned.
If \fIalignment\fR = "coords", IRMATCH2D accumulates the relative shifts
between adjacent subrasters
into a total shift with respect to the reference subraster. Shifts which
do not correspond to adjacent subrasters are ignored.
For subrasters which have no direct shift information, IRMATCH2D makes
a best guess at the x and y shift based on the shifts of nearby subrasters
which do have direct shift information. If the x and y shifts
are sufficiently uniform over the whole input image the user may set
\fIalignment\fR = shifts and input values of \fIxshift\fR and \fIyshift\fR.
Alternatively the shifts may be read for the file \fIcoords\fR if
\fIalignment\fR = "file".

Coordinate lists may be generated interactively on the Sun workstations
using the IRAF imtool facility and centered using the APPHOT CENTER
and APSELECT tasks.

The subrasters are inserted into the output image using the
interpolation scheme defined by 
\fIinterpolant\fR and is made with reference to the subraster defined
by \fInxrsub\fR and \fInyrsub\fR, using the shifts defined by
the coordinates in the file \fIcoords\fR.
Subrasters are inserted into the output image in the order they were
inserted into the original mosaic with pixels in the most recently
placed subrasters replacing those placed earlier in the overlap regions.
Undefined pixels in the output image
are given the value \fIoval\fR. The position of the reference subraster
in the output image can be shifted by setting the parameters \fIxref\fR and
\fIyref\fR. The \fItrimlimits\fR parameter can be used to trim each
input subraster before it is inserted into the output image.

Intensities of adjacent subrasters can be matched using the \fImatch\fR
parameter. At present matching is done by computing the median in the
overlap region between adjacent subrasters and applying difference in
these two numbers to the subraster in question. Intensity matching is
done in two dimensions,  first along the direction in which subrasters
were inserted into the mosaic and then in the orthogonal dimension.
For example if IRMOSAIC was run with \fIcorner\fR = "ll", \fIdirection\fR =
"row" and \fIraster\fR = "no", then the matching would proceed along
each row starting with the lower-left hand corner and then along
each column beginning again in the lower-left corner.

.ih
EXAMPLES

1. Align an 8 by 8 mosaic with respect to subraster 6, 5.

.nf
    pr> irmatch2d mosaic mosaic.al mosaic.db coords nxrsub=6 \
	nyrsub=5
.fi

2. Align an 8 by 8 mosaic as 1 above but shift the position of the
reference subraster in the output image by 2 pixels in x and 3 pixels
in y.

.nf
    pr> irmatch2d mosaic mosaic.al mosaic.db coords nxrsub=6 \
	nyrsub=5 xref=2 yref=3
.fi

3. Align an 8 by 8 mosaic as 1 above but trim 2 rows and columns off
of each input image before inserting into the output image.

.nf
    pr> irmatch2d mosaic mosaic.al mosaic.db coords nxrsub=6 \
	nyrsub=5 trimlimits="[2:2,2:2]"
.fi

4. Rerun the above example saving the verbose output in a file. Use the 
PROTO package fields task to select the xshift, yshift and intensity
shift fields, edit the shifts slightly and rerun irmatch2d with the
new shifts.

.nf
    pr> irmatch2d mosaic mosaic.al mosaic.db coords nxrsub=6 \
	nyrsub=5 trimlimits="[2:2,2:2]" > shifts1

    pr> fields shifts1 3,4,6 > shifts2

    pr> edit shifts2

	... make whatever changes are desired

    pr> irmatch2d mosaic mosaic.al mosaic.db shifts2 align=file \
	nxrsub=6 nyrsub=5 trimlimits="[2:2,2:2]"
.fi

.ih
TIME REQUIREMENTS
.ih
BUGS
.ih
SEE ALSO
irmosaic, iralign, irmatch1d, apphot.center, apphot.apselect
.endhelp