LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
AmpInfo.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008, 2009, 2010, 2011 LSST Corporation.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 #ifndef AFW_TABLE_AmpInfo_h_INCLUDED
24 #define AFW_TABLE_AmpInfo_h_INCLUDED
25 
28 #include "lsst/afw/table/Catalog.h"
31 
32 namespace lsst { namespace afw { namespace table {
33 
38  LL,
39  LR,
40  UR,
41  UL,
42 };
43 
44 
45 class AmpInfoRecord;
46 class AmpInfoTable;
47 
77 class AmpInfoRecord : public BaseRecord {
78 public:
79 
84 
86  return std::static_pointer_cast<AmpInfoTable const>(BaseRecord::getTable());
87  }
88 
90  std::string getName() const;
92  void setName(std::string const &name);
93 
94  geom::Box2I getBBox() const;
95  void setBBox(geom::Box2I const &bbox);
96 
97  double getGain() const;
98  void setGain(double gain);
99 
100  double getReadNoise() const;
101  void setReadNoise(double readNoise);
102 
103  double getSaturation() const;
104  void setSaturation(double saturation);
105 
107  double getSuspectLevel() const;
108  void setSuspectLevel(double suspectLevel);
109 
115 
116  std::vector<double> getLinearityCoeffs() const;
117  void setLinearityCoeffs(std::vector<double> const &coeffs);
118 
119  std::string getLinearityType() const;
120  void setLinearityType(std::string const &type);
121 
122  bool getHasRawInfo() const;
123  void setHasRawInfo(bool hasRawInfo);
124 
125  geom::Box2I getRawBBox() const;
126  void setRawBBox(geom::Box2I const &bbox);
127 
128  geom::Box2I getRawDataBBox() const;
129  void setRawDataBBox(geom::Box2I const &bbox);
130 
131  bool getRawFlipX() const;
132  void setRawFlipX(bool rawFlipX);
133 
134  bool getRawFlipY() const;
135  void setRawFlipY(bool rawFlipY);
136 
138  void setRawXYOffset(geom::Extent2I const &xy);
139 
141  void setRawHorizontalOverscanBBox(geom::Box2I const &bbox);
142 
144  void setRawVerticalOverscanBBox(geom::Box2I const &bbox);
145 
147  void setRawPrescanBBox(geom::Box2I const &bbox);
148 
150 
151 protected:
152 
154 
155 };
156 
162 class AmpInfoTable : public BaseTable {
163 public:
164 
169  static int const MAX_NAME_LENGTH = 64; // max length for amplifier name
170  static int const MAX_LINEARITY_COEFFS = 4; // max number of linearity coefficients
171  static int const MAX_LINEARITY_TYPE_LENGTH = 64; // max length for linearity type
172 
178  static PTR(AmpInfoTable) make(Schema const & schema);
179 
189  r.disconnectAliases();
190  return r;
191  }
192 
199  static bool checkSchema(Schema const & other) {
200  return other.contains(getMinimalSchema().schema);
201  }
202 
204 
234 
236  PTR(AmpInfoTable) clone() const { return std::static_pointer_cast<AmpInfoTable>(_clone()); }
237 
239  PTR(AmpInfoRecord) makeRecord() { return std::static_pointer_cast<AmpInfoRecord>(_makeRecord()); }
240 
243  return std::static_pointer_cast<AmpInfoRecord>(BaseTable::copyRecord(other));
244  }
245 
247  PTR(AmpInfoRecord) copyRecord(BaseRecord const & other, SchemaMapper const & mapper) {
248  return std::static_pointer_cast<AmpInfoRecord>(BaseTable::copyRecord(other, mapper));
249  }
250 
251 protected:
252 
253  AmpInfoTable(Schema const & schema);
254 
255  AmpInfoTable(AmpInfoTable const & other);
256 
257 private:
258 
259  // Struct that holds the minimal schema and the special keys we've added to it.
260  struct MinimalSchema {
286  MinimalSchema();
287  };
288 
289  // Return the singleton minimal schema.
290  static MinimalSchema & getMinimalSchema();
291 
292  friend class io::FitsWriter;
293 
294  // Return a writer object that knows how to save in FITS format. See also FitsWriter.
295  virtual PTR(io::FitsWriter) makeFitsWriter(fits::Fits * fitsfile, int flags) const;
296 };
297 
298 }}} // namespace lsst::afw::table
299 
300 #endif // !AFW_TABLE_AmpInfo_h_INCLUDED
Defines the fields and offsets for a table.
Definition: Schema.h:44
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
ColumnViewT< AmpInfoRecord > ColumnView
Definition: AmpInfo.h:81
bool getRawFlipY() const
Convenience accessors for the keys in the minimal reference schema.
static PointKey< int > getRawDataBBoxMinKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:222
static PointKey< int > getRawBBoxMinKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:220
virtual boost::shared_ptr< io::FitsWriter > makeFitsWriter(fits::Fits *fitsfile, int flags) const
geom::Box2I getRawDataBBox() const
Convenience accessors for the keys in the minimal reference schema.
CatalogT< Record const > ConstCatalog
Definition: AmpInfo.h:168
Writer object for FITS binary tables.
Definition: FitsWriter.h:22
CatalogT< Record > Catalog
Definition: AmpInfo.h:167
table::Key< std::string > name
Definition: ApCorrMap.cc:71
Geometry and electronic information about raw amplifier images.
Definition: AmpInfo.h:77
static Key< std::string > getNameKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:209
static PointKey< int > getRawXYOffsetKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:226
void setReadNoise(double readNoise)
amplifier read noise, in e-
static Key< Flag > getRawFlipYKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:225
A custom container class for records, based on std::vector.
Definition: Catalog.h:95
static MinimalSchema & getMinimalSchema()
static Key< double > getSaturationKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:214
afw::table::Schema schema
Definition: GaussianPsf.cc:41
boost::shared_ptr< AmpInfoRecord > copyRecord(BaseRecord const &other)
Deep-copy a record, requiring that it have the same schema as this table.
Definition: AmpInfo.h:242
static PointKey< int > getRawHorizontalOverscanBBoxMinKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:227
static int const MAX_LINEARITY_TYPE_LENGTH
Definition: AmpInfo.h:171
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:19
void setRawVerticalOverscanBBox(geom::Box2I const &bbox)
bounding box of usable vertical overscan pixels
static Key< double > getSuspectLevelKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:215
Key< Array< double > > linearityCoeffs
Definition: AmpInfo.h:270
geom::Box2I getRawVerticalOverscanBBox() const
Convenience accessors for the keys in the minimal reference schema.
void setReadoutCorner(ReadoutCorner val)
set readout corner
geom::Box2I getBBox() const
Convenience accessors for the keys in the minimal reference schema.
static int const MAX_LINEARITY_COEFFS
Definition: AmpInfo.h:170
CatalogT< AmpInfoRecord const > ConstCatalog
Definition: AmpInfo.h:83
ColumnViewT< AmpInfoRecord > ColumnView
Definition: AmpInfo.h:166
double getGain() const
Convenience accessors for the keys in the minimal reference schema.
boost::shared_ptr< AmpInfoTable const > getTable() const
Definition: AmpInfo.h:85
bool getHasRawInfo() const
Convenience accessors for the keys in the minimal reference schema.
double getSaturation() const
Convenience accessors for the keys in the minimal reference schema.
void setRawXYOffset(geom::Extent2I const &xy)
offset for assembling a raw CCD image: desired xy0 - raw xy0
An integer coordinate rectangle.
Definition: Box.h:53
geom::Box2I getRawPrescanBBox() const
Convenience accessors for the keys in the minimal reference schema.
static Key< Flag > getHasRawInfoKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:219
static PointKey< int > getRawBBoxExtentKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:221
void setLinearityType(std::string const &type)
name of linearity parameterization
static PointKey< int > getRawVerticalOverscanBBoxExtentKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:230
static int const MAX_NAME_LENGTH
Definition: AmpInfo.h:169
double getSuspectLevel() const
Convenience accessors for the keys in the minimal reference schema.
static boost::shared_ptr< AmpInfoTable > make(Schema const &schema)
Construct a new table.
static Schema makeMinimalSchema()
Return a minimal schema for AmpInfo tables and records.
Definition: AmpInfo.h:187
void setGain(double gain)
amplifier gain in e-/ADU
std::string getName() const
Convenience accessors for the keys in the minimal reference schema.
void setRawFlipY(bool rawFlipY)
flip column order to make an assembled image?
static Key< std::string > getLinearityTypeKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:218
double getReadNoise() const
Convenience accessors for the keys in the minimal reference schema.
void setSaturation(double saturation)
level in ADU above which pixels are considered saturated;
std::string getLinearityType() const
Convenience accessors for the keys in the minimal reference schema.
void setLinearityCoeffs(std::vector< double > const &coeffs)
vector of linearity coefficients
geom::Extent2I getRawXYOffset() const
Convenience accessors for the keys in the minimal reference schema.
ReadoutCorner getReadoutCorner() const
Convenience accessors for the keys in the minimal reference schema.
std::map< Citizen const *, CitizenInfo > table
Definition: Citizen.h:90
AmpInfoRecord(boost::shared_ptr< AmpInfoTable > const &table)
geom::Box2I getRawBBox() const
Convenience accessors for the keys in the minimal reference schema.
void setName(std::string const &name)
name of amplifier location in camera
geom::Box2I getRawHorizontalOverscanBBox() const
Convenience accessors for the keys in the minimal reference schema.
virtual boost::shared_ptr< BaseTable > _clone() const =0
Clone implementation with noncovariant return types.
void setRawHorizontalOverscanBBox(geom::Box2I const &bbox)
bounding box of usable horizontal overscan pixels
void setBBox(geom::Box2I const &bbox)
bounding box of amplifier pixels in assembled image
boost::shared_ptr< AmpInfoTable > clone() const
Return a polymorphic deep copy of the table.
Definition: AmpInfo.h:236
virtual boost::shared_ptr< BaseRecord > _makeRecord()=0
Default-construct an associated record (protected implementation).
static PointKey< int > getRawPrescanBBoxMinKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:231
ReadoutCorner
Readout corner, in the frame of reference of the assembled image.
Definition: AmpInfo.h:37
boost::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
Definition: BaseRecord.h:60
static Key< double > getReadNoiseKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:213
Base class for all records.
Definition: BaseRecord.h:27
void setRawDataBBox(geom::Box2I const &bbox)
bounding box of amplifier image pixels on raw image
Key specialization for Flag.
Definition: Flag.h:84
#define PTR(...)
Definition: base.h:41
static PointKey< int > getRawDataBBoxExtentKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:223
void setRawBBox(geom::Box2I const &bbox)
bounding box of all amplifier pixels on raw image
bool getRawFlipX() const
Convenience accessors for the keys in the minimal reference schema.
boost::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
static PointKey< int > getRawVerticalOverscanBBoxMinKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:229
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid AmpInfoTable schema.
Definition: AmpInfo.h:199
static Key< int > getReadoutCornerKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:216
AmpInfoTable(Schema const &schema)
static PointKey< int > getRawHorizontalOverscanBBoxExtentKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:228
static PointKey< int > getRawPrescanBBoxExtentKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:232
#define CONST_PTR(...)
A shared pointer to a const object.
Definition: base.h:47
void setHasRawInfo(bool hasRawInfo)
does this table have raw amplifier information?
boost::shared_ptr< AmpInfoRecord > makeRecord()
Default-construct an associated record.
Definition: AmpInfo.h:239
void setRawFlipX(bool rawFlipX)
flip row order to make assembled image?
void setSuspectLevel(double suspectLevel)
level in ADU above which pixels are considered suspicious,
static Key< Flag > getRawFlipXKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:224
ImageT val
Definition: CR.cc:159
static Key< Array< double > > getLinearityCoeffsKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:217
void setRawPrescanBBox(geom::Box2I const &bbox)
bounding box of usable (horizontal) prescan pixels on raw image
Table of amplifier information (AmpInfoRecord records)
Definition: AmpInfo.h:162
static PointKey< int > getBBoxExtentKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:211
CatalogT< AmpInfoRecord > Catalog
Definition: AmpInfo.h:82
Base class for all tables.
Definition: BaseTable.h:43
static Key< double > getGainKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:212
static PointKey< int > getBBoxMinKey()
Get keys for standard fields shared by all references.
Definition: AmpInfo.h:210
std::vector< double > getLinearityCoeffs() const
Convenience accessors for the keys in the minimal reference schema.