lsst.afw
g3a5ebb7d8a+28b83bf6a5
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
afw
fitsCompression.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
#ifndef LSST_AFW_fitsCompression_h_INCLUDED
3
#define LSST_AFW_fitsCompression_h_INCLUDED
4
5
#include <optional>
6
#include <string>
7
#include <type_traits>
8
#include <vector>
9
10
#include "ndarray.h"
11
#include "
lsst/afw/image/Image.h
"
12
#include "
lsst/afw/image/Mask.h
"
13
14
15
namespace
lsst
{
16
namespace
afw
{
17
namespace
fits
{
18
19
class
Fits
;
20
28
enum class
CompressionAlgorithm
{
29
GZIP_1_
,
30
GZIP_2_
,
31
RICE_1_
32
};
33
41
enum class
DitherAlgorithm
{
42
NO_DITHER_
,
43
SUBTRACTIVE_DITHER_1_
,
44
SUBTRACTIVE_DITHER_2_
,
45
};
46
48
enum class
ScalingAlgorithm
{
49
RANGE
,
50
STDEV_MASKED
,
51
STDEV_CFITSIO
,
52
MANUAL
,
53
};
54
56
struct
QuantizationOptions
{
58
DitherAlgorithm
dither
=
DitherAlgorithm::NO_DITHER_
;
59
61
ScalingAlgorithm
scaling
=
ScalingAlgorithm::STDEV_MASKED
;
62
66
std::vector<std::string>
mask_planes
= {
"NO_DATA"
};
67
75
float
level
= 0;
76
82
int
seed
= 0;
83
86
bool
uses_mask
()
const
{
87
switch
(
scaling
) {
88
case
ScalingAlgorithm::RANGE
:
89
case
ScalingAlgorithm::STDEV_MASKED
:
90
return
true
;
91
case
ScalingAlgorithm::STDEV_CFITSIO
:
92
case
ScalingAlgorithm::MANUAL
:
93
break
;
94
};
95
return
false
;
96
}
97
};
98
100
struct
CompressionOptions
{
101
103
CompressionAlgorithm
algorithm
=
CompressionAlgorithm::GZIP_2_
;
104
106
109
std::size_t
tile_width
= 0;
110
std::size_t
tile_height
= 1;
112
114
std::optional<QuantizationOptions>
quantization
= std::nullopt;
115
118
bool
uses_mask
()
const
{
119
return
quantization
.has_value() &&
quantization
.value().uses_mask();
120
}
121
};
122
123
}
// namespace fits
124
}
// namespace afw
125
}
// namespace lsst
126
127
#endif
// ifndef LSST_AFW_fitsCompression_h_INCLUDED
Mask.h
lsst::afw::fits::Fits
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition
fits.h:242
Image.h
lsst::afw::fits
Definition
fits.h:32
lsst::afw::fits::ScalingAlgorithm
ScalingAlgorithm
Algorithms used to compute the scaling factor used in quantization.
Definition
fitsCompression.h:48
lsst::afw::fits::ScalingAlgorithm::RANGE
@ RANGE
Scale to preserve dynamic range with bad pixels msasked out.
Definition
fitsCompression.h:49
lsst::afw::fits::ScalingAlgorithm::STDEV_MASKED
@ STDEV_MASKED
Scale based on the standard deviation with bad pixels masked out.
Definition
fitsCompression.h:50
lsst::afw::fits::ScalingAlgorithm::STDEV_CFITSIO
@ STDEV_CFITSIO
Let CFITSIO work out the scaling (per-tile; does not respect mask planes).
Definition
fitsCompression.h:51
lsst::afw::fits::ScalingAlgorithm::MANUAL
@ MANUAL
Scale set manually.
Definition
fitsCompression.h:52
lsst::afw::fits::CompressionAlgorithm
CompressionAlgorithm
FITS compression algorithms.
Definition
fitsCompression.h:28
lsst::afw::fits::CompressionAlgorithm::RICE_1_
@ RICE_1_
Definition
fitsCompression.h:31
lsst::afw::fits::CompressionAlgorithm::GZIP_1_
@ GZIP_1_
Definition
fitsCompression.h:29
lsst::afw::fits::CompressionAlgorithm::GZIP_2_
@ GZIP_2_
Definition
fitsCompression.h:30
lsst::afw::fits::DitherAlgorithm
DitherAlgorithm
FITS quantization algorithms.
Definition
fitsCompression.h:41
lsst::afw::fits::DitherAlgorithm::SUBTRACTIVE_DITHER_1_
@ SUBTRACTIVE_DITHER_1_
Definition
fitsCompression.h:43
lsst::afw::fits::DitherAlgorithm::NO_DITHER_
@ NO_DITHER_
Definition
fitsCompression.h:42
lsst::afw::fits::DitherAlgorithm::SUBTRACTIVE_DITHER_2_
@ SUBTRACTIVE_DITHER_2_
Definition
fitsCompression.h:44
lsst::afw
Definition
imageAlgorithm.dox:1
lsst
std::size_t
lsst::afw::fits::CompressionOptions
Options controlling image compression with FITS.
Definition
fitsCompression.h:100
lsst::afw::fits::CompressionOptions::uses_mask
bool uses_mask() const
Whether this compression configuration would make use of a Mask and the configured mask_planes.
Definition
fitsCompression.h:118
lsst::afw::fits::CompressionOptions::tile_height
std::size_t tile_height
Definition
fitsCompression.h:110
lsst::afw::fits::CompressionOptions::quantization
std::optional< QuantizationOptions > quantization
Options for quantizing a floating point image (i.e. lossy compression).
Definition
fitsCompression.h:114
lsst::afw::fits::CompressionOptions::tile_width
std::size_t tile_width
Shape of a compression tile.
Definition
fitsCompression.h:109
lsst::afw::fits::CompressionOptions::algorithm
CompressionAlgorithm algorithm
The compression algorithm to use.
Definition
fitsCompression.h:103
lsst::afw::fits::QuantizationOptions
Options controlling quantization for image compression with FITS.
Definition
fitsCompression.h:56
lsst::afw::fits::QuantizationOptions::dither
DitherAlgorithm dither
The method used to dither floating point values with random noise.
Definition
fitsCompression.h:58
lsst::afw::fits::QuantizationOptions::mask_planes
std::vector< std::string > mask_planes
Mask planes to ignore when doing statistics.
Definition
fitsCompression.h:66
lsst::afw::fits::QuantizationOptions::scaling
ScalingAlgorithm scaling
The algorithm used to determine the scaling for quantization.
Definition
fitsCompression.h:61
lsst::afw::fits::QuantizationOptions::seed
int seed
Random seed used for dithering.
Definition
fitsCompression.h:82
lsst::afw::fits::QuantizationOptions::uses_mask
bool uses_mask() const
Whether this quantization configuration would make use of a Mask and the configured mask_planes.
Definition
fitsCompression.h:86
lsst::afw::fits::QuantizationOptions::level
float level
Target quantization level.
Definition
fitsCompression.h:75
std::vector
Generated on
for lsst.afw by
1.17.0