LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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"
30 
31 namespace lsst { namespace afw { namespace table {
32 
37  LL,
38  LR,
39  UR,
40  UL,
41 };
42 
43 
44 class AmpInfoRecord;
45 class AmpInfoTable;
46 
76 class AmpInfoRecord : public BaseRecord {
77 public:
78 
83 
85  return boost::static_pointer_cast<AmpInfoTable const>(BaseRecord::getTable());
86  }
87 
89  std::string getName() const;
91  void setName(std::string const &name);
92 
93  geom::Box2I getBBox() const;
94  void setBBox(geom::Box2I const &bbox);
95 
96  double getGain() const;
97  void setGain(double gain);
98 
99  double getReadNoise() const;
100  void setReadNoise(double readNoise);
101 
102  int getSaturation() const;
103  void setSaturation(int saturation);
104 
107 
108  std::vector<double> getLinearityCoeffs() const;
109  void setLinearityCoeffs(std::vector<double> const &coeffs);
110 
111  std::string getLinearityType() const;
112  void setLinearityType(std::string const &type);
113 
114  bool getHasRawInfo() const;
115  void setHasRawInfo(bool hasRawInfo);
116 
117  geom::Box2I getRawBBox() const;
118  void setRawBBox(geom::Box2I const &bbox);
119 
120  geom::Box2I getRawDataBBox() const;
121  void setRawDataBBox(geom::Box2I const &bbox);
122 
123  bool getRawFlipX() const;
124  void setRawFlipX(bool rawFlipX);
125 
126  bool getRawFlipY() const;
127  void setRawFlipY(bool rawFlipY);
128 
130  void setRawXYOffset(geom::Extent2I const &xy);
131 
133  void setRawHorizontalOverscanBBox(geom::Box2I const &bbox);
134 
136  void setRawVerticalOverscanBBox(geom::Box2I const &bbox);
137 
139  void setRawPrescanBBox(geom::Box2I const &bbox);
140 
142 
143 protected:
144 
146 
147 };
148 
154 class AmpInfoTable : public BaseTable {
155 public:
156 
161  static int const MAX_NAME_LENGTH = 64; // max length for amplifier name
162  static int const MAX_LINEARITY_COEFFS = 4; // max number of linearity coefficients
163  static int const MAX_LINEARITY_TYPE_LENGTH = 64; // max length for linearity type
164 
170  static PTR(AmpInfoTable) make(Schema const & schema);
171 
181  r.disconnectAliases();
182  return r;
183  }
184 
191  static bool checkSchema(Schema const & other) {
192  return other.contains(getMinimalSchema().schema);
193  }
194 
196 
225 
227  PTR(AmpInfoTable) clone() const { return boost::static_pointer_cast<AmpInfoTable>(_clone()); }
228 
230  PTR(AmpInfoRecord) makeRecord() { return boost::static_pointer_cast<AmpInfoRecord>(_makeRecord()); }
231 
234  return boost::static_pointer_cast<AmpInfoRecord>(BaseTable::copyRecord(other));
235  }
236 
238  PTR(AmpInfoRecord) copyRecord(BaseRecord const & other, SchemaMapper const & mapper) {
239  return boost::static_pointer_cast<AmpInfoRecord>(BaseTable::copyRecord(other, mapper));
240  }
241 
242 protected:
243 
244  AmpInfoTable(Schema const & schema);
245 
246  AmpInfoTable(AmpInfoTable const & other);
247 
248 private:
249 
250  // Struct that holds the minimal schema and the special keys we've added to it.
251  struct MinimalSchema {
276  MinimalSchema();
277  };
278 
279  // Return the singleton minimal schema.
280  static MinimalSchema & getMinimalSchema();
281 
282  friend class io::FitsWriter;
283 
284  // Return a writer object that knows how to save in FITS format. See also FitsWriter.
285  virtual PTR(io::FitsWriter) makeFitsWriter(fits::Fits * fitsfile, int flags) const;
286 };
287 
288 }}} // namespace lsst::afw::table
289 
290 #endif // !AFW_TABLE_AmpInfo_h_INCLUDED
Defines the fields and offsets for a table.
Definition: Schema.h:46
static Key< Point< int > > getRawVerticalOverscanBBoxMinKey()
Definition: AmpInfo.h:220
std::string getName() const
Convenience accessors for the keys in the minimal reference schema.
#define CONST_PTR(...)
Definition: base.h:47
void setBBox(geom::Box2I const &bbox)
bounding box of amplifier pixels in assembled image
Key< Point< int > > rawVerticalOverscanBBoxMin
Definition: AmpInfo.h:272
Writer subclass for FITS binary tables.
Definition: FitsWriter.h:20
CatalogT< Record > Catalog
Definition: AmpInfo.h:159
static int const MAX_NAME_LENGTH
Definition: AmpInfo.h:161
static Key< int > getReadoutCornerKey()
Definition: AmpInfo.h:207
double getGain() const
Convenience accessors for the keys in the minimal reference schema.
AmpInfoTable(Schema const &schema)
Key< Point< int > > rawHorizontalOverscanBBoxMin
Definition: AmpInfo.h:270
Key< Point< int > > rawHorizontalOverscanBBoxExtent
Definition: AmpInfo.h:271
ReadoutCorner getReadoutCorner() const
Convenience accessors for the keys in the minimal reference schema.
boost::shared_ptr< AmpInfoRecord > makeRecord()
Default-construct an associated record.
Definition: AmpInfo.h:230
Geometry and electronic information about raw amplifier images.
Definition: AmpInfo.h:76
static int const MAX_LINEARITY_TYPE_LENGTH
Definition: AmpInfo.h:163
geom::Box2I getRawVerticalOverscanBBox() const
Convenience accessors for the keys in the minimal reference schema.
static Key< Flag > getRawFlipXKey()
Definition: AmpInfo.h:215
void setReadNoise(double readNoise)
amplifier read noise, in e-
A custom container class for records, based on std::vector.
Definition: Catalog.h:94
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:19
void setReadoutCorner(ReadoutCorner val)
set readout corner
boost::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
Definition: BaseRecord.h:51
static int const MAX_LINEARITY_COEFFS
Definition: AmpInfo.h:162
static Key< Point< int > > getRawXYOffsetKey()
Definition: AmpInfo.h:217
static Key< Flag > getHasRawInfoKey()
Definition: AmpInfo.h:210
static Key< Point< int > > getRawPrescanBBoxExtentKey()
Definition: AmpInfo.h:223
void setRawXYOffset(geom::Extent2I const &xy)
offset for assembling a raw CCD image: desired xy0 - raw xy0
void setRawHorizontalOverscanBBox(geom::Box2I const &bbox)
bounding box of usable horizontal overscan pixels
static Key< Point< int > > getBBoxMinKey()
Definition: AmpInfo.h:202
virtual boost::shared_ptr< BaseTable > _clone() const =0
Clone implementation with noncovariant return types.
#define PTR(...)
Definition: base.h:41
geom::Box2I getRawHorizontalOverscanBBox() const
Convenience accessors for the keys in the minimal reference schema.
static Key< Point< int > > getRawBBoxMinKey()
Definition: AmpInfo.h:211
static MinimalSchema & getMinimalSchema()
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid AmpInfoTable schema.
Definition: AmpInfo.h:191
virtual boost::shared_ptr< BaseRecord > _makeRecord()=0
Default-construct an associated record (protected implementation).
void setRawVerticalOverscanBBox(geom::Box2I const &bbox)
bounding box of usable vertical overscan pixels
geom::Box2I getRawPrescanBBox() const
Convenience accessors for the keys in the minimal reference schema.
CatalogT< Record const > ConstCatalog
Definition: AmpInfo.h:160
double getReadNoise() const
Convenience accessors for the keys in the minimal reference schema.
static Key< int > getSaturationKey()
Definition: AmpInfo.h:206
An integer coordinate rectangle.
Definition: Box.h:53
void setName(std::string const &name)
name of amplifier location in camera
CatalogT< AmpInfoRecord const > ConstCatalog
Definition: AmpInfo.h:82
bool getHasRawInfo() const
Convenience accessors for the keys in the minimal reference schema.
static Key< std::string > getNameKey()
Definition: AmpInfo.h:201
void setRawBBox(geom::Box2I const &bbox)
bounding box of all amplifier pixels on raw image
int getSaturation() const
Convenience accessors for the keys in the minimal reference schema.
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:233
static Key< Point< int > > getRawDataBBoxExtentKey()
Definition: AmpInfo.h:214
static Key< Flag > getRawFlipYKey()
Definition: AmpInfo.h:216
static Key< Point< int > > getRawHorizontalOverscanBBoxMinKey()
Definition: AmpInfo.h:218
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
void setLinearityType(std::string const &type)
name of linearity parameterization
tbl::Schema schema
Definition: CoaddPsf.cc:324
static Schema makeMinimalSchema()
Return a minimal schema for AmpInfo tables and records.
Definition: AmpInfo.h:179
CatalogT< AmpInfoRecord > Catalog
Definition: AmpInfo.h:81
boost::shared_ptr< AmpInfoTable const > getTable() const
Definition: AmpInfo.h:84
ColumnViewT< AmpInfoRecord > ColumnView
Definition: AmpInfo.h:158
geom::Extent2I getRawXYOffset() const
Convenience accessors for the keys in the minimal reference schema.
void setRawFlipX(bool rawFlipX)
flip row order to make assembled image?
bool getRawFlipX() const
Convenience accessors for the keys in the minimal reference schema.
static Key< Point< int > > getRawBBoxExtentKey()
Definition: AmpInfo.h:212
void setHasRawInfo(bool hasRawInfo)
does this table have raw amplifier information?
geom::Box2I getRawBBox() const
Convenience accessors for the keys in the minimal reference schema.
AmpInfoRecord(boost::shared_ptr< AmpInfoTable > const &table)
ColumnViewT< AmpInfoRecord > ColumnView
Definition: AmpInfo.h:80
static Key< Point< int > > getRawHorizontalOverscanBBoxExtentKey()
Definition: AmpInfo.h:219
boost::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
geom::Box2I getBBox() const
Convenience accessors for the keys in the minimal reference schema.
static Key< Array< double > > getLinearityCoeffsKey()
Definition: AmpInfo.h:208
std::string getLinearityType() const
Convenience accessors for the keys in the minimal reference schema.
Key< Array< double > > linearityCoeffs
Definition: AmpInfo.h:260
Base class for all records.
Definition: BaseRecord.h:27
geom::Box2I getRawDataBBox() const
Convenience accessors for the keys in the minimal reference schema.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
Key specialization for Flag.
Definition: Flag.h:82
static Key< Point< int > > getRawVerticalOverscanBBoxExtentKey()
Definition: AmpInfo.h:221
Key< Point< int > > rawVerticalOverscanBBoxExtent
Definition: AmpInfo.h:273
void setRawPrescanBBox(geom::Box2I const &bbox)
bounding box of usable (horizontal) prescan pixels on raw image
void setSaturation(int saturation)
saturation value, in ADU
virtual boost::shared_ptr< io::FitsWriter > makeFitsWriter(fits::Fits *fitsfile, int flags) const
static Key< Point< int > > getRawDataBBoxMinKey()
Definition: AmpInfo.h:213
Key< Point< int > > rawPrescanBBoxExtent
Definition: AmpInfo.h:275
static Key< Point< int > > getBBoxExtentKey()
Definition: AmpInfo.h:203
static Key< Point< int > > getRawPrescanBBoxMinKey()
Definition: AmpInfo.h:222
boost::shared_ptr< AmpInfoTable > clone() const
Return a polymorphic deep copy of the table.
Definition: AmpInfo.h:227
std::map< Citizen const *, CitizenInfo > table
Definition: Citizen.h:93
void setLinearityCoeffs(std::vector< double > const &coeffs)
vector of linearity coefficients
ImageT val
Definition: CR.cc:154
std::vector< double > getLinearityCoeffs() const
Convenience accessors for the keys in the minimal reference schema.
Table of amplifier information (AmpInfoRecord records)
Definition: AmpInfo.h:154
static boost::shared_ptr< AmpInfoTable > make(Schema const &schema)
Construct a new table.
static Key< double > getReadNoiseKey()
Definition: AmpInfo.h:205
static Key< std::string > getLinearityTypeKey()
Definition: AmpInfo.h:209
Base class for all tables.
Definition: BaseTable.h:44
static Key< double > getGainKey()
Definition: AmpInfo.h:204
void setGain(double gain)
amplifier gain in e-/ADU
void setRawDataBBox(geom::Box2I const &bbox)
bounding box of amplifier image pixels on raw image
void setRawFlipY(bool rawFlipY)
flip column order to make an assembled image?
bool getRawFlipY() const
Convenience accessors for the keys in the minimal reference schema.