IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of asinh_compression


Ignore:
Timestamp:
Mar 28, 2016, 5:22:04 PM (10 years ago)
Author:
watersc1
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • asinh_compression

    v1 v1  
     1= Short version =
     2
     3If you have a asinh compressed stack (C):
     4{{{
     5 L = BOFFSET + BSOFTEN * (exp(C / alpha) - exp(-C / alpha))
     6}}}
     7where BOFFSET and BSOFTEN are supplied in the header, and alpha = log10(exp(2.5)) = 1.0857362.
     8
     9If you want to compress something (L) with asinh compression:
     10{{{
     11  BOFFSET = mean(L)
     12  BSOFTEN = sqrt(alpha) * stddev(L)
     13  C = alpha * asinh( (L - BOFFSET) / (2.0 * BSOFTEN) )
     14}}}
     15
     16
     17= Long version =
     18
     19Due to the expected large range of data values in the final stacked
     20image, saving them as compressed 16-bit integer images with linear
     21BSCALE and BZERO scaling values is likely to offer poor
     22reconstructions of the stacked image.  This will lead either to
     23truncation of the extrema of the image, or quantized values that are
     24poorly spaced for the image histogram.  Saving the images as 32-bit
     25floating point values would alleviate this quantization issue, at the
     26cost of a large increase in the disk space required for the stacked
     27images.
     28
     29Transforming the data prior to writing to disk by taking the logarithm
     30of the pixel values can resolve this, with the complication that all
     31data values must first be made positive, which then sets the highest
     32quantization sampling near the lowest values in the image.  Following
     33techniques used by SDSS, we have instead opted to use the
     34inverse hyperbolic sine function to transform the data.  This domain
     35of this function allows any input value to be converted.  In addition,
     36the quantization sampling can be tuned by placing the zero of the
     37inverse hyperbolic sine function at the most interesting pixel values.
     38
     39Formally, prior to being written to disk, the pixel values are
     40transformed by C = alpha asinh( (L - BOFFSET) / (2.0 \cdot   
     41BSOFTEN) ), where L is the linear input pixel
     42values, C the transformed values, alpha = 2.5 log10(e), and
     43BOFFSET = \langle L \rangle and BSOFTEN =                                                                                                       
     44sqrt(alpha) * sigma_{L} are saved to the header as the scaling
     45parameters used.  The image is then passed to the standard BSCALE and
     46BZERO calculation and saved to disk.
     47
     48To reverse this process (on subsequent reads of the image, for example
     49in warp-stack difference calculations), the BOFFSET and BSOFTEN
     50parameters are read from the header and the transformation inverted,
     51such that: L = BOFFSET + BSOFTEN * (exp(C                                                                                               
     52/ alpha) - exp(-C / alpha) ).