Davinci - Sigma-Clip-Average Usage Notes, PDF
Davinci - Sigma-Clip-Average Usage Notes, PDF
ClarkVision.com
Home Galleries Articles Reviews Best Gear Science New About Contact
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of the program must retain the above copyright notice, this list of conditions and the following
disclaimer.
Neither Roger N. Clark, clarkvision.com nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Usage
If you install davinci http://davinci.asu.edu/ on linux, macs, or windows, this code should run. I adapted this code from some
spectroscopy code I wrote. This version pulls in one color channel at a time, but converts each image plane to floating point.
Thus a 20 megabyte image requires 40 megabytes of memory. Stacking 10 images would then require 400 megabytes to store
all the images, one color plus the program and intermediate and results data. It is a little slow: I do 3 iterations as I found it
does a better job than ImagesPlus even using a higher clip level. On a I7-950 machine at 3 GHz, it takes about a minute per
20-megapixel RGB image and the code is not multi threaded.
Davinci reads some tif files issuing the following message which you can ignore:
https://clarkvision.com/articles/astrophotography.software/davinci.sigma-clip-average-notes.html Page 1 of 3
davinci.sigma-clip-average usage notes, Clarkvision.com 2020-04-18, 2:05 PM
Davinci is scientific data language used in planetary and terrestrial sciences, where the common formats are not tif files
(NASA PDS and other science image formats like vicar). It does have fits extensions, but seem difficult to get working so I
have ignored that
Davinci also has a quirk which the developers have not yet fixed. It can't write multi-band 16-bit tiffs, so I write png files. But
davinci writes png with 16-bit signed integers. So I then read the png result into photoshop and and use levels tool, moving
the right slider to 128 and write a tiff.
And relax for a while. The above is case sensitive. If you try this on windows, please let me know if it works.
With davinci you can also easily subtract a dark frame. No need for commercial software. And if there are any developers out
there who want to contribute code or fixes to davinci, I am sure the team at ASU would be accepting.
Windows
Any davinci program will be the same as rnc-color-stretch. In windows, copy the launcher batch file, LaunchConsole.bat
from the rnc-color-stretch install and the davinci script, e.g. davinci.sigma-clip-average-3pass to the directory and with
windows explorer, double click on the LaunchConsole.bat file. That stars a terminal session with everything set up. Then
type:
e.g. type:
or
On macs and linux, follow the install directions for rnc-color-stretch, then simply copy davinci.sigma-clip-average-3pass to
/usr/local/bin and make it executable. You can then use a terminal to cd to the directory where your images are located, and
typr the command. e.g.:
Home Galleries Articles Reviews Best Gear Science New About Contact
http://www.clarkvision.com/articles/astrophotography.software
https://clarkvision.com/articles/astrophotography.software/davinci.sigma-clip-average-notes.html Page 2 of 3
davinci.sigma-clip-average usage notes, Clarkvision.com 2020-04-18, 2:05 PM
https://clarkvision.com/articles/astrophotography.software/davinci.sigma-clip-average-notes.html Page 3 of 3