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 | |
---|
36 | namespace 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 | using Beam::define; |
---|
54 | void define(float maj, float min, float pa, BEAM_ORIGIN origin); |
---|
55 | void setFWHM(float fwhm, BEAM_ORIGIN origin); |
---|
56 | void setArea(float area, BEAM_ORIGIN origin); |
---|
57 | |
---|
58 | BEAM_ORIGIN origin(){return itsOrigin;}; |
---|
59 | std::string originString(); |
---|
60 | bool isDefined(){return (itsOrigin != EMPTY);}; |
---|
61 | |
---|
62 | void define(Param &par,bool warn=true); // do we need this? How to define directly? |
---|
63 | |
---|
64 | void readFromFITS(fitsfile *fptr, Param &par, float pixelScale); // read from file a la headerIO.cc |
---|
65 | void writeToFITS(fitsfile *fptr); // write to file, but only if itsOrigin==HEADER. Use cfitsio commands directly. |
---|
66 | |
---|
67 | protected: |
---|
68 | BEAM_ORIGIN itsOrigin; |
---|
69 | float itsPixelScale; |
---|
70 | |
---|
71 | }; |
---|
72 | |
---|
73 | } |
---|
74 | |
---|
75 | #endif |
---|