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
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
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 public:
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298 template <typename S>
00299 void write(const std::vector<long>& first,
00300 long nElements,
00301 const std::valarray<S>& data,
00302 S* nullValue);
00303
00304
00305 template <typename S>
00306 void write(long first,
00307 long nElements,
00308 const std::valarray<S>& data,
00309 S* nullValue);
00310
00311
00312 template <typename S>
00313 void write(const std::vector<long>& first,
00314 long nElements,
00315 const std::valarray<S>& data);
00316
00317
00318 template <typename S>
00319 void write(long first,
00320 long nElements,
00321 const std::valarray<S>& data);
00322
00323 template <typename S>
00324 void write(const std::vector<long>& firstVertex,
00325 const std::vector<long>& lastVertex,
00326 const std::vector<long>& stride,
00327 const std::valarray<S>& data);
00328
00329
00330
00331
00332 template<typename S>
00333 void read(std::valarray<S>& image) ;
00334
00335 template<typename S>
00336 void read (std::valarray<S>& image, long first,long nElements);
00337
00338 template<typename S>
00339 void read (std::valarray<S>& image, long first,long nElements, S* nullValue) ;
00340
00341 template<typename S>
00342 void read (std::valarray<S>& image, const std::vector<long>& first,long nElements) ;
00343
00344 template<typename S>
00345 void read (std::valarray<S>& image, const std::vector<long>& first, long nElements,
00346 S* nullValue);
00347
00348 template<typename S>
00349 void read (std::valarray<S>& image, const std::vector<long>& firstVertex,
00350 const std::vector<long>& lastVertex,
00351 const std::vector<long>& stride) ;
00352
00353 template<typename S>
00354 void read (std::valarray<S>& image, const std::vector<long>& firstVertex,
00355 const std::vector<long>& lastVertex,
00356 const std::vector<long>& stride,
00357 S* nullValue) ;
00358
00359
00360 protected:
00361 PHDU(const PHDU &right);
00362
00363
00364 PHDU (FITSBase* p, int bpix, int naxis, const std::vector<long>& axes);
00365
00366
00367
00368 PHDU (FITSBase* p = 0);
00369
00370 virtual void initRead ();
00371 bool simple () const;
00372 void simple (bool value);
00373 bool extend () const;
00374 void extend (bool value);
00375
00376
00377
00378 private:
00379
00380
00381 private:
00382
00383 bool m_simple;
00384 bool m_extend;
00385
00386
00387
00388 };
00389
00390
00391
00392 inline bool PHDU::simple () const
00393 {
00394 return m_simple;
00395 }
00396
00397 inline void PHDU::simple (bool value)
00398 {
00399 m_simple = value;
00400 }
00401
00402 inline bool PHDU::extend () const
00403 {
00404 return m_extend;
00405 }
00406
00407 inline void PHDU::extend (bool value)
00408 {
00409 m_extend = value;
00410 }
00411
00412 }
00413
00414
00415 #endif