LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
|
Namespaces | |
displayLib | |
ds9 | |
ds9Regions | |
interface | |
rgb | |
utils | |
virtualDevice | |
Functions | |
PYBIND11_MODULE (_simpleFits, mod) | |
PYBIND11_MODULE (rgb, mod) | |
template<typename ImageT > | |
void | replaceSaturatedPixels (ImageT &rim, ImageT &gim, ImageT &bim, int borderWidth=2, float saturatedPixelValue=65535) |
template<class T > | |
std::pair< double, double > | getZScale (image::Image< T > const &image, int const nSamples=1000, double const contrast=0.25) |
Calculate an IRAF/ds9-style zscaling. More... | |
template void | replaceSaturatedPixels (image::MaskedImage< float > &rim, image::MaskedImage< float > &gim, image::MaskedImage< float > &bim, int borderWidth, float saturatedPixelValue) |
template std::pair< double, double > | getZScale (image::Image< std::uint16_t > const &image, int const nSamples, double const contrast) |
template std::pair< double, double > | getZScale (image::Image< float > const &image, int const nSamples, double const contrast) |
template<typename ImageT > | |
void | writeBasicFits (int fd, ImageT const &data, geom::SkyWcs const *Wcs, char const *title) |
template<typename ImageT > | |
void | writeBasicFits (std::string const &filename, ImageT const &data, geom::SkyWcs const *Wcs, char const *title) |
template<typename ImageT > | |
void | writeBasicFits (int fd, ImageT const &data, lsst::afw::geom::SkyWcs const *Wcs=NULL, char const *title=NULL) |
template<typename ImageT > | |
void | writeBasicFits (std::string const &filename, ImageT const &data, lsst::afw::geom::SkyWcs const *Wcs=NULL, const char *title=NULL) |
template std::pair<double, double> lsst::afw::display::getZScale | ( | image::Image< float > const & | image, |
int const | nSamples, | ||
double const | contrast | ||
) |
template std::pair<double, double> lsst::afw::display::getZScale | ( | image::Image< std::uint16_t > const & | image, |
int const | nSamples, | ||
double const | contrast | ||
) |
std::pair< double, double > lsst::afw::display::getZScale | ( | image::Image< T > const & | image, |
int const | nSamples = 1000 , |
||
double const | contrast = 0.25 |
||
) |
Calculate an IRAF/ds9-style zscaling.
To quote Frank Valdes (http://iraf.net/forum/viewtopic.php?showtopic=134139)
ZSCALE ALGORITHM
The zscale algorithm is designed to display the image values near the median image value without the time consuming process of computing a full image histogram. This is particularly useful for astronomical images which generally have a very peaked histogram corresponding to the background sky in direct imaging or the continuum in a two dimensional spectrum. The sample of pixels, specified by values greater than zero in the sample mask zmask or by an image section, is selected up to a maximum of nsample pixels. If a bad pixel mask is specified by the bpmask parameter then any pixels with mask values which are greater than zero are not counted in the sample. Only the first pixels up to the limit are selected where the order is by line beginning from the first line. If no mask is specified then a grid of pixels with even spacing along lines and columns that make up a number less than or equal to the maximum sample size is used. If a contrast of zero is specified (or the zrange flag is used and the image does not have a valid minimum/maximum value) then the minimum and maximum of the sample is used for the intensity mapping range. If the contrast is not zero the sample pixels are ranked in brightness to form the function I(i) where i is the rank of the pixel and I is its value. Generally the midpoint of this function (the median) is very near the peak of the image histogram and there is a well defined slope about the midpoint which is related to the width of the histogram. At the ends of the I(i) function there are a few very bright and dark pixels due to objects and defects in the field. To determine the slope a linear function is fit with iterative rejection; <code> I(i) = intercept + slope * (i - midpoint) </code> If more than half of the points are rejected then there is no well defined slope and the full range of the sample defines z1 and z2. Otherwise the endpoints of the linear function are used (provided they are within the original range of the sample): <code> z1 = I(midpoint) + (slope / contrast) * (1 - midpoint) z2 = I(midpoint) + (slope / contrast) * (npoints - midpoint) </code> As can be seen, the parameter contrast may be used to adjust the contrast produced by this algorithm.
image | The image we wish to stretch |
nSamples | Number of samples to use |
contrast | Stretch parameter; see description |
Definition at line 167 of file scaling.cc.
lsst::afw::display::PYBIND11_MODULE | ( | _simpleFits | , |
mod | |||
) |
Definition at line 53 of file _simpleFits.cc.
lsst::afw::display::PYBIND11_MODULE | ( | rgb | , |
mod | |||
) |
Definition at line 37 of file rgb.cc.
template void lsst::afw::display::replaceSaturatedPixels | ( | image::MaskedImage< float > & | rim, |
image::MaskedImage< float > & | gim, | ||
image::MaskedImage< float > & | bim, | ||
int | borderWidth, | ||
float | saturatedPixelValue | ||
) |
void lsst::afw::display::replaceSaturatedPixels | ( | ImageT & | rim, |
ImageT & | gim, | ||
ImageT & | bim, | ||
int | borderWidth = 2 , |
||
float | saturatedPixelValue = 65535 |
||
) |
Definition at line 30 of file saturated.cc.
void lsst::afw::display::writeBasicFits | ( | int | fd, |
ImageT const & | data, | ||
geom::SkyWcs const * | Wcs, | ||
char const * | title | ||
) |
Definition at line 363 of file simpleFits.cc.
void lsst::afw::display::writeBasicFits | ( | int | fd, |
ImageT const & | data, | ||
lsst::afw::geom::SkyWcs const * | Wcs = NULL , |
||
char const * | title = NULL |
||
) |
void lsst::afw::display::writeBasicFits | ( | std::string const & | filename, |
ImageT const & | data, | ||
geom::SkyWcs const * | Wcs, | ||
char const * | title | ||
) |
Definition at line 449 of file simpleFits.cc.
void lsst::afw::display::writeBasicFits | ( | std::string const & | filename, |
ImageT const & | data, | ||
lsst::afw::geom::SkyWcs const * | Wcs = NULL , |
||
const char * | title = NULL |
||
) |