Skip to content

Commit ba4635a

Browse files
committed
Add section on different stacks, add commandline option for sigma-clipped average
1 parent 32f6180 commit ba4635a

File tree

1 file changed

+85
-10
lines changed

1 file changed

+85
-10
lines changed

doc/source/usage.rst

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ there's a similar area with good enough correlation and that feature
5050
is selected, ruining the whole stack.
5151

5252
Alignment can benefit from multiple processors, see ``-p``
53-
command-line option.
53+
commandline option.
5454

5555

56-
Command-line options
57-
____________________
56+
Commandline options
57+
___________________
5858

5959
``python bin/halostack_cli.py [options] <list of filenames>``
6060

@@ -78,6 +78,20 @@ ____________________
7878
- ``-d median_stack.png``
7979
- output filename of the median stack
8080

81+
- ``-S, --sigma-stack``
82+
83+
- ``-S sigma_stack.png``
84+
- output filename of the sigma clipped average stack
85+
86+
- ``-k, --kappa-sigma-params``
87+
88+
- ``-k <kappa>,<iterations>``
89+
- parameters for the sigma clipped average stack
90+
- kappa: threshold how many standard deviations are allowed
91+
- iterations: how many iterations to perform
92+
- eg. ``-k 2.2,3`` removes all data from stack where value is more than 2.2 standard deviations from the average, and runs maximum of three iterations over the stack
93+
- default: ``2.0,max(1, <number_of_images>/8)``
94+
8195
- ``-t, --correlation-threshold``
8296

8397
- ``-t 0.9``
@@ -148,11 +162,72 @@ ____________________
148162
- ``IMG_0001.jpg IMG_0002.jpg IMG_0003.jpg``
149163

150164

165+
Different stacks
166+
________________
167+
168+
Average
169+
=======
170+
171+
- Commandline option: ``-a average.png``
172+
173+
In this stacking mode the images (after possible alignment) are simply
174+
averaged. This is the most common one to use, as it smoothens the
175+
cloud movements and lowers the noise.
176+
177+
Minimum
178+
=======
179+
180+
- Commandline option: ``-m minimum.png``
181+
182+
Collects the minimum value for each pixel from the images. Maybe not
183+
that useful for halo photographs, but might still be useful for special cases.
184+
185+
Maximum
186+
=======
187+
188+
- Commandline option: ``-M maximum.png``
189+
190+
Collects the maximum value for each pixel from the images. Most
191+
common use for this stack type is surface halos, where it's nice to
192+
get all the distinct rays maximally visible.
193+
194+
Median
195+
======
196+
197+
- Commandline option: ``-d median.png``
198+
199+
Calculates the median value from the images for each pixel.
200+
201+
**NOTE**: This method keeps all the images in memory, so it's a good
202+
idea to scale the images to smaller size.
203+
204+
Sigma-clipped average
205+
=====================
206+
207+
- Commandline option: ``-S sigma.png``
208+
209+
Calculates average of the images, but first discards outliers (too
210+
small and/or large values) iteratively. Discarding is done in the
211+
following way:
212+
213+
1. calculate average value of the stack for each pixel location
214+
2. find pixel locations where the value is greater than abs(kappa *x* <average value>)
215+
3. mask these values
216+
4. repeat until no data are discarded or maximum iterations are reached
217+
218+
User can supply the maximum deviation (kappa) and number of iterations
219+
using commandline option ``-k``. If these are not given, values kappa
220+
= 2.0 and <number of images>/8 iterations are used.
221+
222+
**NOTE**: This method keeps all the images in memory, so it's a good idea to
223+
scale the images to smaller size.
224+
225+
151226
Configuration file
152227
__________________
153228

154-
Everything that can be set with the command-line options can also be
155-
setup in a configuration file. Command-line options will override
229+
Everything that can be set with the commandline options can also be
230+
setup in a configuration file. Commandline options will override
156231
settings obtained from the configuration file.
157232

158233
Below is an example configuration::
@@ -189,7 +264,7 @@ ________________________
189264

190265
This *tries* to be a complete list of image pre- and post-processing
191266
options available in Halostack. These enhancements can be applied
192-
using ``-e`` and ``-E`` command-line switches, or corresponding
267+
using ``-e`` and ``-E`` commandline options, or corresponding
193268
configuration file options ``enhance_images`` and ``enhance_stacks``.
194269
All the examples on the green background are used in conjunction with
195270
these switches (eg. ``-e br``) or given in configuration file.
@@ -212,7 +287,7 @@ Unsharp mask
212287

213288
Unsharp mask, or USM in short, is a way to enhance halos by increasing
214289
the image contrast. USM is mostly used in *postprocessing* with
215-
``-E`` command-line switch, but some use it also in *preprocessing*.
290+
``-E`` commandline switch, but some use it also in *preprocessing*.
216291

217292
The user can give the USM four parameters:
218293

@@ -257,7 +332,7 @@ Emboss
257332

258333
Emboss makes a relief of the image based on local contrast. In some
259334
cases this can show the halos more clearly. Emboss is used in
260-
postprocessing with ``-E`` command-line switch.
335+
postprocessing with ``-E`` commandline switch.
261336

262337
Syntax::
263338

@@ -324,7 +399,7 @@ Syntax::
324399
-E gr:1.5
325400

326401
Blue - Green
327-
+++++++++++
402+
++++++++++++
328403

329404
The Blue - Green method is otherwise equal to the Blue - Red method
330405
described above, but in this case the channels re different. This
@@ -361,7 +436,7 @@ The smaller the sigma is, the smaller the influence of the more remote
361436
values are. The default of 1/3rd of the radius seems to work well.
362437

363438
Gradient removal benefits from using multiple processors, see ``-p``
364-
command-line parameter.
439+
commandline parameter.
365440

366441

367442
Luminance subtraction

0 commit comments

Comments
 (0)