source: tags/release-1.2.2/src/FitsIO/DuchampBeam.hh

Last change on this file was 1069, checked in by MatthewWhiting, 12 years ago

Adding the licensing text to files that didn't have it.

File size: 2.6 KB
Line 
1// -----------------------------------------------------------------------
2// DuchampBeam.hh: Handling of a beam in the Duchamp context, with Param and
3//                 FITS I/O interfaces
4// -----------------------------------------------------------------------
5// Copyright (C) 2006, Matthew Whiting, ATNF
6//
7// This program is free software; you can redistribute it and/or modify it
8// under the terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 2 of the License, or (at your
10// option) any later version.
11//
12// Duchamp is distributed in the hope that it will be useful, but WITHOUT
13// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15// for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with Duchamp; if not, write to the Free Software Foundation,
19// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20//
21// Correspondence concerning Duchamp may be directed to:
22//    Internet email: Matthew.Whiting [at] atnf.csiro.au
23//    Postal address: Dr. Matthew Whiting
24//                    Australia Telescope National Facility, CSIRO
25//                    PO Box 76
26//                    Epping NSW 1710
27//                    AUSTRALIA
28// -----------------------------------------------------------------------
29#ifndef DUCHAMP_DUCHAMPBEAM_HH
30#define DUCHAMP_DUCHAMPBEAM_HH
31#include <duchamp/duchamp.hh>
32#include <duchamp/FitsIO/Beam.hh>
33
34#include <fitsio.h>
35
36namespace duchamp
37{
38 
39  enum BEAM_ORIGIN { EMPTY,HEADER, PARAM };
40  class Param;
41
42  class DuchampBeam : public Beam
43  {
44  public:
45    DuchampBeam();
46    DuchampBeam(float maj, float min, float pa);
47    virtual ~DuchampBeam(){};
48    DuchampBeam(const Beam &b);
49    DuchampBeam(const DuchampBeam &b);
50    DuchampBeam& operator=(const DuchampBeam &b);
51
52    void empty();
53    void define(float maj, float min, float pa, BEAM_ORIGIN origin);
54    void setFWHM(float fwhm, BEAM_ORIGIN origin);
55    void setArea(float area, BEAM_ORIGIN origin);
56
57    BEAM_ORIGIN origin(){return itsOrigin;};
58    std::string originString();
59    bool isDefined(){return (itsOrigin != EMPTY);};
60   
61    void define(Param &par,bool warn=true); // do we need this? How to define directly?
62
63    void readFromFITS(fitsfile *fptr, Param &par, float pixelScale); // read from file a la headerIO.cc
64    void writeToFITS(fitsfile *fptr); // write to file, but only if itsOrigin==HEADER. Use cfitsio commands directly.
65
66  protected:
67    BEAM_ORIGIN itsOrigin;
68    float itsPixelScale;
69
70  };
71
72}
73
74#endif
Note: See TracBrowser for help on using the repository browser.