casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FITSErrorImage.h
Go to the documentation of this file.
1 //# FITSErrorImage.h: Class providing native access to FITS images
2 //# Copyright (C) 2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef IMAGES_FITSERRORIMAGE_H
29 #define IMAGES_FITSERRORIMAGE_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 //# Forward Declarations
40 template <class T> class Array;
41 
42 //
43 class MaskSpecifier;
44 class IPosition;
45 class Slicer;
46 
47 // <summary>
48 // Class providing native access to FITS Error images.
49 // </summary>
50 
51 // <use visibility=export>
52 
53 // <reviewed reviewer="" date="" tests="tFITSErrorImage.cc">
54 // </reviewed>
55 
56 // <prerequisite>
57 // <li> <linkto class=FITSImage>FITSImage</linkto>
58 // <li> <linkto class=FITSMask>FITSMask</linkto>
59 // </prerequisite>
60 
61 // <etymology>
62 // </etymology>
63 
64 // <synopsis>
65 // </synopsis>
66 
67 // <example>
68 // <srcblock>
69 // </srcblock>
70 // </example>
71 
72 // <motivation>
73 // This provides native access to FITS error images.
74 // </motivation>
75 
76 //# <todo asof="2011/08/17">
77 //# </todo>
78 
80 {
81 public:
82 
83  // The enum describes which types of error images exist. The type is fixed
84  // during object creation and can not be changed at a later time.
85  enum ErrorType
86  {
87  MSE, // the values are "mean squared error" (=variance)
88  RMSE, // the values are "root mean squared error" (=sigma)
89  INVMSE, // the values are inverse "means squared error"
90  INVRMSE, // the values are inverse "root mean squared error"
91  UNKNOWN, // unknown type
93  };
94 
95  // Construct a FITSImage from the disk FITS file name and extension and apply mask.
96  explicit FITSErrorImage(const String& name, uInt whichRep=0, uInt whichHDU=0, FITSErrorImage::ErrorType errtype=MSE);
97 
98  // Construct a FITSImage from the disk FITS file name and extension and apply mask or not.
100 
101  // Copy constructor (reference semantics)
102  FITSErrorImage(const FITSErrorImage& other);
103 
104  // Destructor
105  virtual ~FITSErrorImage();
106 
107  // Assignment (reference semantics)
108  FITSErrorImage& operator=(const FITSErrorImage& other);
109 
110  // Make a copy of the object with new (reference semantics).
111  virtual ImageInterface<Float>* cloneII() const;
112 
113  // Get the image type (returns "FITSErrorImage").
114  virtual String imageType() const;
115 
116  // Do the actual get of the data.
117  // Returns False as the data do not reference another Array
118  virtual Bool doGetSlice (Array<Float>& buffer, const Slicer& theSlice);
119 
120  // The FITSImage is not writable, so this throws an exception.
121  virtual void doPutSlice (const Array<Float>& sourceBuffer,
122  const IPosition& where,
123  const IPosition& stride);
124 
125  // Return the error type.
127  {return errtype_p;};
128 
129  // Convert an image type to String.
131 
132  // Convert a String to an image type.
134 
135 private:
136 
137  // Set the correct masking.
138  void setupMask();
139 
142 };
143 
144 
145 
146 } //# NAMESPACE CASACORE - END
147 
148 #endif
149 
150 
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
FITSErrorImage & operator=(const FITSErrorImage &other)
Assignment (reference semantics)
Class providing native access to FITS Error images.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
FITSErrorImage::ErrorType errtype_p
virtual FITSErrorImage::ErrorType errorType() const
Return the error type.
void setupMask()
Set the correct masking.
static FITSErrorImage::ErrorType stringToErrorType(String errorTypeStr)
Convert an image type to String.
static String errorTypeToString(FITSErrorImage::ErrorType errType)
Convert a String to an image type.
virtual Bool doGetSlice(Array< Float > &buffer, const Slicer &theSlice)
Do the actual get of the data.
Class to specify which mask to use in an image.
Definition: MaskSpecifier.h:69
virtual String name(Bool stripPath=False) const
Returns the name of the disk file.
virtual String imageType() const
Get the image type (returns &quot;FITSErrorImage&quot;).
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
uInt whichHDU() const
Return the HDU number.
Definition: FITSImage.h:234
ErrorType
The enum describes which types of error images exist.
virtual ImageInterface< Float > * cloneII() const
Make a copy of the object with new (reference semantics).
Class providing native access to FITS images.
Definition: FITSImage.h:108
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:289
virtual void doPutSlice(const Array< Float > &sourceBuffer, const IPosition &where, const IPosition &stride)
The FITSImage is not writable, so this throws an exception.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual ~FITSErrorImage()
Destructor.
FITSErrorImage(const String &name, uInt whichRep=0, uInt whichHDU=0, FITSErrorImage::ErrorType errtype=MSE)
Construct a FITSImage from the disk FITS file name and extension and apply mask.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42