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
|
include "../lib/apphot.h"
include "../lib/radprof.h"
include "../lib/fitpsf.h"
# AP_CRPROF -- Read the radial profile size off the radial profile plot.
real procedure ap_crprof (ap, gd, out, stid, rmin, rmax, imin, imax)
pointer ap # pointer to the apphot structure
pointer gd # pointer to the grapics stream
int out # output file descriptor
int stid # output file sequence number
real rmin, rmax # x axis limits
real imin, imax # y axis limits
int wcs, key, stat
pointer sp, cmd
real scale, radius, xjunk, yjunk
int clgcur()
real apstatr(), ap_vrpradius()
begin
call smark (sp)
call salloc (cmd, SZ_LINE, TY_CHAR)
scale = apstatr (ap, SCALE)
# Estimate the minimum (maximum) data level.
# Mark maximum radius of the radial profile.
call printf ("Mark maximum radius for profile (%g) pixels:")
call pargr (apstatr (ap, RPRADIUS) * scale)
call gscur (gd, apstatr (ap, RPRADIUS) * scale, (imin + imax) / 2.0)
stat = clgcur ("gcommands", xjunk, yjunk, wcs, key, Memc[cmd], SZ_LINE)
if (stat == EOF || xjunk < 0.0 || xjunk > rmax)
radius = apstatr (ap, RPRADIUS)
else
radius = xjunk / scale
# Verify the results.
call apsetr (ap, RPRADIUS, radius)
radius = ap_vrpradius (ap)
# Store the results.
if (out != NULL && stid > 1)
call ap_rparam (out, KY_RPRADIUS, radius, UN_RSCALEUNIT,
"fitting radius")
call sfree (sp)
return (radius)
end
# AP_CRPSTEP -- Read the radial profile size off the radial profile plot.
real procedure ap_crpstep (ap, gd, out, stid, rmin, rmax, imin, imax)
pointer ap # pointer to the apphot structure
pointer gd # pointer to the grapics stream
int out # output file descriptor
int stid # output file sequence number
real rmin, rmax # x axis limits
real imin, imax # y axis limits
int wcs, key, stat
pointer sp, cmd
real scale, step, xjunk, yjunk
int clgcur()
real apstatr(), ap_vstep()
begin
call smark (sp)
call salloc (cmd, SZ_LINE, TY_CHAR)
scale = apstatr (ap, SCALE)
# Mark the radial profile step size.
call printf ("Mark step size (%g) pixels:")
call pargr (apstatr (ap, RPSTEP) * scale)
call gscur (gd, apstatr (ap, RPSTEP) * scale, (imin + imax) / 2.0)
stat = clgcur ("gcommands", xjunk, yjunk, wcs, key, Memc[cmd], SZ_LINE)
if (stat == EOF || xjunk < 0.0 || xjunk > rmax)
step = apstatr (ap, RPSTEP)
else
step = xjunk / scale
# Verify the results.
call apsetr (ap, RPSTEP, step)
step = ap_vstep (ap)
# Store the results.
if (out != NULL && stid > 1)
call ap_rparam (out, KY_RPSTEP, step, UN_RSCALEUNIT,
"step size in pixels")
call sfree (sp)
return (step)
end
# AP_CPAPERT -- Read the fitting radius on the radial profile plot.
real procedure ap_cpapert (ap, gd, out, stid, rmin, rmax, imin, imax)
pointer ap # pointer to the apphot structure
pointer gd # pointer to the grapics stream
int out # output file descriptor
int stid # output file sequence number
real rmin, rmax # x axis limits
real imin, imax # y axis limits
int wcs, key, stat
pointer sp, cmd
real scale, psfapert, xjunk, yjunk
int clgcur()
real apstatr(), ap_vpsfapert()
begin
call smark (sp)
call salloc (cmd, SZ_LINE, TY_CHAR)
scale = apstatr (ap, SCALE)
# Mark the fitting radius on the plot.
call printf ("Mark fitting box half width (%g) pixels:")
call pargr (apstatr (ap, PSFAPERT) * scale)
call gscur (gd, apstatr (ap, PSFAPERT) * scale, (imin + imax) / 2.0)
stat = clgcur ("gcommands", xjunk, yjunk, wcs, key, Memc[cmd], SZ_LINE)
if (stat == EOF || xjunk <= 0.0 || xjunk > rmax)
psfapert = apstatr (ap, PSFAPERT)
else
psfapert = xjunk / scale
# Verify the results.
call apsetr (ap, PSFAPERT, psfapert)
psfapert = ap_vpsfapert (ap)
# Store the results.
if (out != NULL && stid > 1)
call ap_rparam (out, KY_PSFAPERT, 2.0 * psfapert, UN_PSFSCALEUNIT,
"width of the fitting box")
call sfree (sp)
return (psfapert)
end
|