00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef PHDU_H
00011 #define PHDU_H 1
00012
00013
00014 #include <valarray>
00015
00016 #include "HDU.h"
00017
00018 #include "FITS.h"
00019
00020 #include "FITSUtil.h"
00021
00022 namespace CCfits {
00023 class FITSBase;
00024
00025 }
00026
00027 #ifdef _MSC_VER
00028 #include "MSconfig.h"
00029 #endif
00030
00031
00032 namespace CCfits {
00033
00068
00069
00070
00071
00072
00073
00074
00075
00076
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00265 class PHDU : public HDU
00266 {
00267
00268 public:
00269 virtual ~PHDU();
00270
00271
00272
00273
00274 virtual void readData (bool readFlag = false, const std::vector<String>& keys = std::vector<String>()) = 0;
00275 virtual PHDU * clone (FITSBase* p) const = 0;
00276 virtual void zero (double value);
00277 virtual void scale (double value);
00278 virtual double zero () const;
00279 virtual double scale () const;
00280
00281 public:
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296 template <typename S>
00297 void write(const std::vector<long>& first,
00298 long nElements,
00299 const std::valarray<S>& data,
00300 S* nullValue);
00301
00302
00303 template <typename S>
00304 void write(long first,
00305 long nElements,
00306 const std::valarray<S>& data,
00307 S* nullValue);
00308
00309
00310 template <typename S>
00311 void write(const std::vector<long>& first,
00312 long nElements,
00313 const std::valarray<S>& data);
00314
00315
00316 template <typename S>
00317 void write(long first,
00318 long nElements,
00319 const std::valarray<S>& data);
00320
00321 template <typename S>
00322 void write(const std::vector<long>& firstVertex,
00323 const std::vector<long>& lastVertex,
00324 const std::vector<long>& stride,
00325 const std::valarray<S>& data);
00326
00327
00328
00329
00330 template<typename S>
00331 void read(std::valarray<S>& image) ;
00332
00333 template<typename S>
00334 void read (std::valarray<S>& image, long first,long nElements);
00335
00336 template<typename S>
00337 void read (std::valarray<S>& image, long first,long nElements, S* nullValue) ;
00338
00339 template<typename S>
00340 void read (std::valarray<S>& image, const std::vector<long>& first,long nElements) ;
00341
00342 template<typename S>
00343 void read (std::valarray<S>& image, const std::vector<long>& first, long nElements,
00344 S* nullValue);
00345
00346 template<typename S>
00347 void read (std::valarray<S>& image, const std::vector<long>& firstVertex,
00348 const std::vector<long>& lastVertex,
00349 const std::vector<long>& stride) ;
00350
00351 template<typename S>
00352 void read (std::valarray<S>& image, const std::vector<long>& firstVertex,
00353 const std::vector<long>& lastVertex,
00354 const std::vector<long>& stride,
00355 S* nullValue) ;
00356
00357
00358 protected:
00359 PHDU(const PHDU &right);
00360
00361
00362 PHDU (FITSBase* p, int bpix, int naxis, const std::vector<long>& axes);
00363
00364
00365
00366 PHDU (FITSBase* p = 0);
00367
00368 virtual void initRead ();
00369 bool simple () const;
00370 void simple (bool value);
00371 bool extend () const;
00372 void extend (bool value);
00373
00374
00375
00376 private:
00377
00378
00379 private:
00380
00381 bool m_simple;
00382 bool m_extend;
00383
00384
00385
00386 };
00387
00388
00389
00390 inline bool PHDU::simple () const
00391 {
00392 return m_simple;
00393 }
00394
00395 inline void PHDU::simple (bool value)
00396 {
00397 m_simple = value;
00398 }
00399
00400 inline bool PHDU::extend () const
00401 {
00402 return m_extend;
00403 }
00404
00405 inline void PHDU::extend (bool value)
00406 {
00407 m_extend = value;
00408 }
00409
00410 }
00411
00412
00413 #endif