-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdragon_scales.xml
214 lines (198 loc) · 7.84 KB
/
dragon_scales.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cxchelptopics SYSTEM "CXCHelp.dtd">
<cxchelptopics>
<ENTRY
context="tools"
key="dragon_scales"
refkeywords="region dragon scales scale tile roof circle box diamond map mask adaptive bin group grow max tessellation"
seealsogroups="dmimgtools"
>
<SYNOPSIS>
Adaptively bin image using overlapping regions
</SYNOPSIS>
<DESC>
<PARA>
dragon_scales works by locating the maximum pixel
value in the image and grouping all pixels in a
circular region around it. It then repeats this
for the maximum pixel not already in a group. This continues
until all pixels are grouped. Since the max is often at the
edge of an existing group, the regions this tool creates
often overlap; giving the visual appearance of scales
on a reptile.
</PARA>
<PARA>
The radius of the circle is either a single number used
for all pixels, or users can supply a map which provides
different radius values at all locations. The shape
of the region can also be changed from a circle to
a box (square) or diamond (rotated square).
</PARA>
<PARA>
The output file is the map file: an image
whose pixel values indicate which pixels are grouped together.
If the binimg parameter is set, the tool will
apply the map file to the input image to create an
adaptively binned image.
</PARA>
<PARA>
This algorithm works best if the input image is smoothed slightly;
but smoothing is not required.
</PARA>
<PARA>
This algorithm can generate many small isolated pixel groups
between larger groups as it "fills in the gap" between them.
The post-processing script, merge_too_small, is often needed
to purge these insignificant regions.
</PARA>
</DESC>
<QEXAMPLELIST>
<QEXAMPLE>
<SYNTAX>
<LINE>% dragon_scales sm_img.fits 10 out.map</LINE>
<LINE>% merge_too_small out.map min10px.map minval=10 method=area</LINE>
</SYNTAX>
<DESC>
<PARA>
In this example the smoothed input image is adaptively
smoothed using the overlapping regions algorithm where
the radius of the circular regions is set to 10 logical
pixels.
</PARA>
<PARA>
The output is then processed through the merge_too_small
script to reassign any small groups, less than 10 pixels,
to their largest neighbor.
</PARA>
</DESC>
</QEXAMPLE>
<QEXAMPLE>
<SYNTAX>
<LINE>% mkpsfmap sm_img.fits psf.map ecf=0.95 energy=1.0 units=logical</LINE>
<LINE>% dragon_scales sm_img.fits psf.map vary.map</LINE>
</SYNTAX>
<DESC>
<PARA>
This shows how to supply a map file as input. The
output from mkpsfmap is an image whose pixel values
represent the size of the PSF, in this example the
95% radius at 1.0keV. The units of the psffile must
be in logical (image) pixels.
</PARA>
<PARA>
The PSF map is then input to dragon_scales. When
dragon_scales locates a pixel maximum, it looks up
the radius of the shape at that location in the psffile
and groups the pixels out to that distance.
</PARA>
</DESC>
</QEXAMPLE>
<QEXAMPLE>
<SYNTAX>
<LINE>
$ dragon_scales img.fits 15 square.map shape=box binimg=square.img
</LINE>
</SYNTAX>
<DESC>
<PARA>
Use squares (boxes) instead of circles; the total side length
of the squares is twice the input radius (logical pixels).
The binned image is also created by applying the output
map file to the input image.
</PARA>
</DESC>
</QEXAMPLE>
</QEXAMPLELIST>
<PARAMLIST>
<PARAM name="infile" type="file" filetype="input" reqd="yes">
<SYNOPSIS>
Input image.
</SYNOPSIS>
<DESC>
<PARA>The image to be grouped. Generally this
algorithm works better if it is slightly smoothed.
</PARA>
<PARA>
Null and NaN pixels, as well as those pixels outside the
image subspace will not be grouped.
</PARA>
</DESC>
</PARAM>
<PARAM name="radius" type="file" filetype="input" reqd="yes">
<SYNOPSIS>Radius. Either a single value or filename</SYNOPSIS>
<DESC>
<PARA>
The radius for the regions is provided in logical (image)
pixel sizes. This parameter may either take a single value,
or a file name. If a file name is used, it must have the
same size as infile; the pixel value will be used as
the radius at that location. Typical radius input files
could be a map of the PSF size or a map containing the
radii to achieve a fixed number of counts.
</PARA>
</DESC>
</PARAM>
<PARAM name="outfile" type="file" filetype="output" reqd="yes">
<SYNOPSIS>
Output map file
</SYNOPSIS>
<DESC>
<PARA>
The outfile is a map file containing integer pixel values.
The pixel values indicate which pixels are grouped
together by the algorithm. A pixel value of 0 are pixels
which are ungrouped (ie outside the image subspace).
</PARA>
</DESC>
</PARAM>
<PARAM name="binimg" type="file" filetype="output">
<SYNOPSIS>Optional, output binned image</SYNOPSIS>
<DESC>
<PARA>
If the binimg file is specified, the script
will use the input image and the output map file to
create a binned version of the input image.
</PARA>
</DESC>
</PARAM>
<PARAM name="shape" type="string" def="circle">
<SYNOPSIS>Shape of overlapping regions: circle|box|diamond|hexagon|triangle|itriangle</SYNOPSIS>
<DESC>
<PARA>
The shape of the region to draw at maximum pixel value.
It can be either a cirlce, a box (square), a
diamond (rotated square), a hexagon, a triangle, or
an inverted triangle (itrangle).
</PARA>
</DESC>
</PARAM>
<PARAM name="gradient" type="boolean" def="yes">
<SYNOPSIS>Rotate shape to match local gradient</SYNOPSIS>
<DESC>
<PARA>
The shape can be rotated to match the gradient at the
location of the local maximum.
</PARA>
</DESC>
</PARAM>
<PARAM name="verbose" type="integer" def="1" min="0" max="5">
<SYNOPSIS>
Amount of chatter from the tool.
</SYNOPSIS>
</PARAM>
<PARAM name="clobber" type="boolean" def="no">
<SYNOPSIS>
Delete outfile if it already exists?
</SYNOPSIS>
</PARAM>
</PARAMLIST>
<BUGS>
<PARA>
See the
<HREF link="http://cxc.harvard.edu/ciao/bugs/index.html">CIAO
website</HREF> for an up-to-date listing of known bugs.
</PARA>
</BUGS>
<LASTMODIFIED>January 2019</LASTMODIFIED>
</ENTRY>
</cxchelptopics>