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