FitsFile.h
Go to the documentation of this file.
1 /* -*- mode:c++ -*- */
2 
14 #ifndef _FitsFile_h
15 #define _FitsFile_h
16 
17 #include "FitsFileBase.h"
18 
19 #ifndef _MSC_VER
20 #include <inttypes.h>
21 #endif
22 
23 #include <vector>
24 
25 namespace hippodraw {
26 
39 class FitsFile : public FitsFileBase {
40 
41 private:
42 
46  int fillFromTableColumn ( std::vector < double > & v,
47  int column );
48 
53  int fillFromImage ( std::vector < double > & vec, unsigned int axis );
54 
58  int fillColumnNamesFromTable ( std::vector < std::string > & labels );
59 
62  int fillColumnNamesFromImage ( std::vector < std::string > & labels );
63 
79  int fillIntVectorFromColumn ( std::vector < int > & vec, int column );
80 
81  public:
82 
84  FitsFile ( const std::string & filename , bool write = false );
85 
89  void fillHDUNames ( std::vector < std::string > & names );
90 
94  int fillColumnNames ( std::vector < std::string > & labels );
95 
113  int fillDoubleVectorFromColumn ( std::vector < double > &vec,
114  int column );
115 
120  int fillAxisSizes ( std::vector < long > & vec ) const;
121 
127  void fillShape ( std::vector < intptr_t > & shape, int column );
128 
132  void fillImageDeltas ( std::vector < double > & deltas ) const;
133 
137  void fillRefPixelIndices ( std::vector < int > & indices ) const;
138 
142  void fillRefPixelValues ( std::vector < double > & values ) const;
143 
147  bool isHammerAitoff () const;
148 
149  void writeHDU ( long rows, int columns,
150  const std::vector < std::string > & names,
151  const std::vector < std::vector < int > > & shapes,
152  const std::string & extname );
153 
154  void writeImageHDU ( long x, long y );
155 
158  void writeColumn ( int c, const std::vector < double > & data );
159 
160  void writePix ( long x, long y,
161  const std::vector <double > & data );
162 
163  void writeCloseFile ();
164 
165  bool pixCenter () const;
166 
167  void writeRefPixelValues ( double value1, double value2 );
168 
169 };
170 
171 } // namespace hippodraw
172 
173 #endif // _FitsFile_h
bool pixCenter() const
Definition: FitsFile.cxx:448
int fillIntVectorFromColumn(std::vector< int > &vec, int column)
Read elements from an ASCII or binary table column (in the CDU) and fill STL vector&lt;int&gt; with its con...
Definition: FitsFile.cxx:337
void fillRefPixelIndices(std::vector< int > &indices) const
Clears and fills the vector with the reference pixel&#39;s indexes.
Definition: FitsFile.cxx:234
int fillColumnNamesFromTable(std::vector< std::string > &labels)
Clears and fills the vector with the column labels of binary or ASCII table.
Definition: FitsFile.cxx:75
A base class for the concrete classes that wrap the cfitsio library.
Definition: FitsFileBase.h:32
void writeRefPixelValues(double value1, double value2)
Definition: FitsFile.cxx:464
hippodraw::FitsFileBase interface
void * data(numeric::array arr)
Definition: num_util.cpp:389
int fillFromImage(std::vector< double > &vec, unsigned int axis)
Fills the vector vec from an image HDU.
Definition: FitsFile.cxx:309
column
The column indices for 2 dimension data point tuple.
std::vector< intptr_t > shape(numeric::array arr)
Definition: num_util.cpp:317
void writeColumn(int c, const std::vector< double > &data)
Writes the vector to FITS table.
Definition: FitsFile.cxx:419
int fillFromTableColumn(std::vector< double > &v, int column)
Fills the vector v from a table column.
Definition: FitsFile.cxx:143
int fillColumnNamesFromImage(std::vector< std::string > &labels)
Clears and fills the vector with the column labels of a image.
Definition: FitsFile.cxx:100
Wrapper class to CFITSIO.
Definition: FitsFile.h:39
ViewBase * v
Definition: PlotTable.cxx:104
void fillImageDeltas(std::vector< double > &deltas) const
Clears and fills the vector with the delta values of an image.
Definition: FitsFile.cxx:209
void writeHDU(long rows, int columns, const std::vector< std::string > &names, const std::vector< std::vector< int > > &shapes, const std::string &extname)
Definition: FitsFile.cxx:355
int fillDoubleVectorFromColumn(std::vector< double > &vec, int column)
Read elements from an ASCII or binary table column (in the CDU) and fill the vector with its contents...
Definition: FitsFile.cxx:125
void fillHDUNames(std::vector< std::string > &names)
Clears and fills the vector with the HDU names.
Definition: FitsFile.cxx:35
int fillColumnNames(std::vector< std::string > &labels)
Clears and fills the vector with the column labels of the current HDU table.
Definition: FitsFile.cxx:60
void writePix(long x, long y, const std::vector< double > &data)
Definition: FitsFile.cxx:430
FitsFile(const std::string &filename, bool write=false)
Public construction taking a filename as argument.
Definition: FitsFile.cxx:28
int fillAxisSizes(std::vector< long > &vec) const
Clears and fills the vector vec with the size of each dimension of an image.
Definition: FitsFile.cxx:192
void fillRefPixelValues(std::vector< double > &values) const
Clears and fills the vector with the reference pixel&#39;s values.
Definition: FitsFile.cxx:259
void writeImageHDU(long x, long y)
Definition: FitsFile.cxx:410
int write(const std::vector< double > &a)
Given the vector it writes it to std stream.
Definition: NumLinAlg.cxx:421
bool isHammerAitoff() const
Returns true if coordinate system of the axis is should undergo Hammer-Aitoff transformation.
Definition: FitsFile.cxx:284
void fillShape(std::vector< intptr_t > &shape, int column)
Fills the vector with the shape of the column.
Definition: FitsFile.cxx:160

Generated for HippoDraw Class Library by doxygen