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