LSSTApplications  16.0-1-gce273f5+17,16.0-1-gf77f410+12,16.0-10-g5a5abec+8,16.0-10-gc1446dd+12,16.0-12-g1dc09ba+6,16.0-12-g569485f,16.0-12-ga22ed6e+1,16.0-13-g4c33ca5+12,16.0-13-gb122224+3,16.0-13-gd9b1b71+12,16.0-14-g22e2ff2,16.0-14-g71e547a+8,16.0-17-g0bdc215+4,16.0-17-g6a7bfb3b+12,16.0-2-g0febb12+14,16.0-2-g839ba83+50,16.0-2-g9d5294e+39,16.0-20-ga7ad2685,16.0-3-g404ea43+9,16.0-3-gbc759ec+10,16.0-3-gcfd6c53+37,16.0-4-g03cf288+28,16.0-4-g13a27c5+14,16.0-4-g5f3a788+13,16.0-4-g8a0f11a+34,16.0-4-ga3eb747+3,16.0-45-g4805a823c,16.0-5-g1991253+12,16.0-5-g1e9226d+1,16.0-5-g865efd9+12,16.0-5-gb3f8a4b+44,16.0-5-gd0f1235+6,16.0-6-gf0acd13+31,16.0-6-gf9cb114+13,16.0-7-g6043bfc,16.0-7-ga8e1655+8,16.0-8-g23bbf3f+3,16.0-8-g4dec96c+25,16.0-8-gfd407c0+2,master-g965b868a3d+1,master-gdc6be1965f+1,w.2018.39
LSSTDataManagementBasePackage
Utils.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 /*
26  * A set of classes of general utility in connection with images
27  *
28  * We provide representations of points, bounding boxes, circles etc.
29  */
30 #ifndef LSST_AFW_IMAGE_UTILS_H
31 #define LSST_AFW_IMAGE_UTILS_H
32 
33 #include <climits>
34 #include <list>
35 #include <map>
36 #include <string>
37 #include <utility>
38 
39 #include "boost/format.hpp"
40 #include "boost/mpl/bool.hpp"
41 #include <memory>
42 
43 #include "lsst/afw/image/lsstGil.h"
44 #include "lsst/daf/base.h"
45 #include "lsst/daf/base/Citizen.h"
46 #include "lsst/pex/exceptions.h"
47 #include "lsst/afw/fits.h"
48 
49 namespace lsst {
50 namespace afw {
51 namespace image {
52 
65  int hdu = fits::DEFAULT_HDU,
66  bool strip = false) {
67  return afw::fits::readMetadata(fileName, hdu, strip);
68 }
69 
77 template <typename ImageT>
78 typename ImageT::SinglePixel badPixel(
79  typename ImageT::Pixel bad = 0
80 ) {
81  typedef typename ImageT::SinglePixel SinglePixelT;
84  : bad);
85 }
86 } // namespace image
87 } // namespace afw
88 } // namespace lsst
89 
90 #endif
float Pixel
Typedefs to be used for pixel values.
Definition: common.h:37
std::shared_ptr< daf::base::PropertyList > readMetadata(std::string const &fileName, int hdu=fits::DEFAULT_HDU, bool strip=false)
Return the metadata (header entries) from a FITS file.
Definition: Utils.h:64
ImageT::SinglePixel badPixel(typename ImageT::Pixel bad=0)
Return a value indicating a bad pixel for the given Image type.
Definition: Utils.h:78
STL class.
A base class for image defects.
Definition: cameraGeom.dox:3
bool strip
Definition: fits.cc:817
const int DEFAULT_HDU
Specify that the default HDU should be read.
Definition: fitsDefaults.h:18
std::shared_ptr< daf::base::PropertyList > readMetadata(std::string const &fileName, int hdu=DEFAULT_HDU, bool strip=false)
Read FITS header.
Definition: fits.cc:1496