source: trunk/src/FitsIO/DuchampBeam.hh @ 788

Last change on this file since 788 was 788, checked in by MatthewWhiting, 13 years ago

First part of dealing with #110. Have defined a Beam & DuchampBeam? class and use these to hold the beam information. FitsHeader? holds the one that we work with, and copies it to Param for use with outputs. Parameters will be taken into account if no header information is present. Still need to add code to deal with the case of neither being present (the beam being EMPTY) and how that affects the integrated flux calculations.

File size: 1.1 KB
Line 
1#ifndef DUCHAMP_DUCHAMPBEAM_HH
2#define DUCHAMP_DUCHAMPBEAM_HH
3#include <duchamp/duchamp.hh>
4#include <duchamp/FitsIO/Beam.hh>
5
6#include <fitsio.h>
7
8namespace duchamp
9{
10 
11  enum BEAM_ORIGIN { EMPTY,HEADER, PARAM };
12  class Param;
13
14  class DuchampBeam : public Beam
15  {
16  public:
17    DuchampBeam();
18    DuchampBeam(float maj, float min, float pa);
19    virtual ~DuchampBeam(){};
20    DuchampBeam(const Beam &b);
21    DuchampBeam(const DuchampBeam &b);
22    DuchampBeam& operator=(const DuchampBeam &b);
23
24    void empty();
25    void define(float maj, float min, float pa, BEAM_ORIGIN origin);
26    void setFWHM(float fwhm, BEAM_ORIGIN origin);
27    void setArea(float area, BEAM_ORIGIN origin);
28
29    BEAM_ORIGIN origin(){return itsOrigin;};
30    bool isDefined(){return (itsOrigin != EMPTY);};
31   
32    void define(Param &par,bool warn=true); // do we need this? How to define directly?
33
34    void readFromFITS(fitsfile *fptr, Param &par, float pixelScale); // read from file a la headerIO.cc
35    void writeToFITS(fitsfile *fptr); // write to file, but only if itsOrigin==HEADER. Use cfitsio commands directly.
36
37  protected:
38    BEAM_ORIGIN itsOrigin;
39
40  };
41
42}
43
44#endif
Note: See TracBrowser for help on using the repository browser.