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
213
214
215
216
217
218
219
220
|
# APTEST - Self testing procedure for the APPHOT package.
procedure aptest (imname)
string imname {prompt="Name of the output test image"}
string aplogfile {"", prompt="Name of the output log file"}
string applotfile {"", prompt="Name of the output plot file"}
begin
# Declare local variables.
string im, aplog, applot, apcoords
# Check that the user truly wants to proceed.
s1 = ""
print ("")
print ("APTEST INITIALIZES THE APPHOT TASK PARAMETERS")
print ("TYPE q or Q TO QUIT, ANY OTHER KEY TO PROCEED")
if (scan (s1) != EOF) {
if (s1 == "q" || s1 == "Q") {
print ("TERMINATING THE APTEST TASK")
bye
}
}
print ("")
# Define some local variables.
im = imname
aplog = aplogfile
if (aplog == "") {
aplog = im // ".log"
}
applot = applotfile
if (applot == "") {
applot = im // ".plot"
}
# Read in the fits file and check for existance of the log and
# plot files.
if (! access (im // ".imh") && ! access (im // ".hhh")) {
rfits ("apphot$test/fits3.fits", "0", im, make_image=yes,
long_header=no, short_header=yes, datatype="",blank=0,
scale=yes,oldirafname=no,offset=0, >& "dev$null")
} else {
error (0, "Error: The image already exists on disk")
}
if (access (aplog)) {
error (0, "Error: The log file already exists on disk")
}
if (access (applot)) {
error (0, "Error: The plot file already exists on disk")
}
# Initialize the APPHOT package.
print ("INITIALIZE THE APPHOT PACKAGE", >> aplog)
print ("", >> aplog)
print ("")
print ("INITIALIZE THE APPHOT PACKAGE")
print ("")
unlearn ("txdump")
unlearn ("center")
unlearn ("centerpars")
unlearn ("daofind")
unlearn ("datapars")
unlearn ("findpars")
unlearn ("fitpsf")
unlearn ("fitsky")
unlearn ("fitskypars")
unlearn ("phot")
unlearn ("photpars")
unlearn ("polymark")
unlearn ("polyphot")
unlearn ("polypars")
unlearn ("qphot")
unlearn ("radprof")
unlearn ("wphot")
# Test the DAOFIND task.
print ("TESTING THE DAOFIND TASK", >> aplog)
print ("TESTING THE DAOFIND TASK")
print ("", >> aplog)
datapars.fwhmpsf=2.354820
datapars.sigma=10.0
findpars.threshold=3.0
apcoords = im // ".coo.1"
daofind (im, output=apcoords, interactive-, verify-)
concat (apcoords, aplog, append=yes)
# Test the CENTER task.
print ("", >> aplog)
print ("TESTING THE CENTER TASK", >> aplog)
print ("TESTING THE CENTER TASK")
print ("", >> aplog)
center (im, coords=apcoords, interactive-, verify-)
concat (im // ".ctr.1", aplog, append=yes)
delete (im // ".ctr.1", ver-, >& "dev$null")
# Test the FITSKY task.
print ("", >> aplog)
print ("TESTING THE FITSKY TASK", >> aplog)
print ("TESTING THE FITSKY TASK")
print ("", >> aplog)
fitskypars.annulus=6.0
fitskypars.dannulus=7.0
fitsky (im, coords=apcoords, interactive-, verify-)
concat (im // ".sky.1", aplog, append=yes)
delete (im // ".sky.1", ver-, >& "dev$null")
# Test the QPHOT task.
print ("", >> aplog)
print ("TESTING THE QPHOT TASK", >> aplog)
print ("TESTING THE QPHOT TASK")
print ("", >> aplog)
qphot (im, 5.0, 6.0, 7.0, "3.0,5.0", coords=apcoords, interactive-)
concat (im // ".mag.1", aplog, append=yes)
delete (im // ".mag.1", ver-, >& "dev$null")
# Test the PHOT task.
print ("", >> aplog)
print ("TESTING THE PHOT TASK", >> aplog)
print ("TESTING THE PHOT TASK")
print ("", >> aplog)
photpars.apertures="3.0,5.0"
phot (im, coords=apcoords, interactive-, verify-)
concat (im // ".mag.1", aplog, append=yes)
delete (im // ".mag.1", ver-, >& "dev$null")
# Test the WPHOT task.
print ("", >> aplog)
print ("TESTING THE WPHOT TASK", >> aplog)
print ("TESTING THE WPHOT TASK")
print ("", >> aplog)
photpars.weighting="gauss"
wphot (im, coords=apcoords, interactive-, verify-)
concat (im // ".omag.1", aplog, append=yes)
delete (im // ".omag.1", ver-, >& "dev$null")
# Test the POLYPHOT task.
print ("", >> aplog)
print ("TESTING THE POLYPHOT TASK", >> aplog)
print ("TESTING THE POLYPHOT TASK")
print ("", >> aplog)
print ("COPY OF THE POLYGONS FILE", >> aplog)
print ("", >> aplog)
concat ("apphot$test/polygons.dat", aplog, append=yes)
print ("", >> aplog)
polyphot (im, coords=apcoords, polygons="apphot$test/polygons.dat",
interactive-, verify-)
concat (im // ".ply.1", aplog, append=yes)
delete (im // ".ply.1", ver-, >& "dev$null")
# Test the RADPROF task.
print ("", >> aplog)
print ("TESTING THE RADPROF TASK", >> aplog)
print ("TESTING THE RADPROF TASK")
print ("", >> aplog)
radprof (im, 8.0, 0.25, coords=apcoords, output="default",
plotfile=applot, order=4, nreject=3, kreject=3.0, interactive-,
verify-)
concat (im // ".prf.1", aplog, append=yes)
delete (im // ".prf.1", ver-, >& "dev$null")
# Test the FITPSF task.
print ("", >> aplog)
print ("TESTING THE FITPSF TASK", >> aplog)
print ("TESTING THE FITPSF TASK")
print ("", >> aplog)
fitpsf (im, 7.0, coords=apcoords, interactive-, verify-)
concat (im // ".psf.1", aplog, append=yes)
delete (im // ".psf.1", ver-, >& "dev$null")
print ("", >> aplog)
print ("APPHOT PACKAGE TESTS COMPLETED", >> aplog)
print ("")
print ("APPHOT PACKAGE TESTS COMPLETED")
print ("", >> aplog)
# Clean up.
delete (apcoords, ver-, >& "dev$null")
unlearn ("txdump")
unlearn ("center")
unlearn ("centerpars")
unlearn ("daofind")
unlearn ("datapars")
unlearn ("findpars")
unlearn ("fitpsf")
unlearn ("fitsky")
unlearn ("fitskypars")
unlearn ("phot")
unlearn ("photpars")
unlearn ("polymark")
unlearn ("polyphot")
unlearn ("polypars")
unlearn ("qphot")
unlearn ("radprof")
unlearn ("wphot")
bye
end
|