casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef IMAGES_FITSERRORIMAGE_H
27#define IMAGES_FITSERRORIMAGE_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/images/Images/FITSImage.h>
32#include <casacore/casa/Arrays/ArrayFwd.h>
33#include <casacore/casa/BasicSL/String.h>
34
35namespace casacore { // # NAMESPACE CASACORE - BEGIN
36
37// # Forward Declarations
38class MaskSpecifier;
39class IPosition;
40class Slicer;
41
42// <summary>
43// Class providing native access to FITS Error images.
44// </summary>
45
46// <use visibility=export>
47
48// <reviewed reviewer="" date="" tests="tFITSErrorImage.cc">
49// </reviewed>
50
51// <prerequisite>
52// <li> <linkto class=FITSImage>FITSImage</linkto>
53// <li> <linkto class=FITSMask>FITSMask</linkto>
54// </prerequisite>
55
56// <etymology>
57// </etymology>
58
59// <synopsis>
60// </synopsis>
61
62// <example>
63// <srcblock>
64// </srcblock>
65// </example>
66
67// <motivation>
68// This provides native access to FITS error images.
69// </motivation>
70
71// # <todo asof="2011/08/17">
72// # </todo>
73
74class FITSErrorImage : public FITSImage {
75 public:
76 // The enum describes which types of error images exist. The type is fixed
77 // during object creation and can not be changed at a later time.
78 enum ErrorType {
79 MSE, // the values are "mean squared error" (=variance)
80 RMSE, // the values are "root mean squared error" (=sigma)
81 INVMSE, // the values are inverse "means squared error"
82 INVRMSE, // the values are inverse "root mean squared error"
83 UNKNOWN, // unknown type
85 };
86
87 // Construct a FITSImage from the disk FITS file name and extension and apply mask.
88 explicit FITSErrorImage(const String& name, uInt whichRep = 0, uInt whichHDU = 0,
90
91 // Construct a FITSImage from the disk FITS file name and extension and apply mask or not.
92 FITSErrorImage(const String& name, const MaskSpecifier& mask, uInt whichRep = 0,
94
95 // Copy constructor (reference semantics)
97
98 // Destructor
99 virtual ~FITSErrorImage();
100
101 // Assignment (reference semantics)
103
104 // Make a copy of the object with new (reference semantics).
106
107 // Get the image type (returns "FITSErrorImage").
108 virtual String imageType() const;
109
110 // Do the actual get of the data.
111 // Returns False as the data do not reference another Array
112 virtual Bool doGetSlice(Array<Float>& buffer, const Slicer& theSlice);
113
114 // The FITSImage is not writable, so this throws an exception.
115 virtual void doPutSlice(const Array<Float>& sourceBuffer, const IPosition& where,
116 const IPosition& stride);
117
118 // Return the error type.
119 virtual FITSErrorImage::ErrorType errorType() const { return errtype_p; };
120
121 // Convert an image type to String.
123
124 // Convert a String to an image type.
126
127 private:
128 // Set the correct masking.
129 void setupMask();
130
133};
134
135} // namespace casacore
136
137#endif
FITSErrorImage(const String &name, const MaskSpecifier &mask, uInt whichRep=0, uInt whichHDU=0, FITSErrorImage::ErrorType errtype=MSE)
Construct a FITSImage from the disk FITS file name and extension and apply mask or not.
virtual String imageType() const
Get the image type (returns "FITSErrorImage").
virtual ~FITSErrorImage()
Destructor.
FITSErrorImage & operator=(const FITSErrorImage &other)
Assignment (reference semantics).
FITSErrorImage(const FITSErrorImage &other)
Copy constructor (reference semantics).
FITSErrorImage::ErrorType errtype_p
virtual FITSErrorImage::ErrorType errorType() const
Return the error type.
static FITSErrorImage::ErrorType stringToErrorType(String errorTypeStr)
Convert an image type to String.
void setupMask()
Set the correct masking.
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).
static String errorTypeToString(FITSErrorImage::ErrorType errType)
Convert a String to an image type.
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.
virtual void doPutSlice(const Array< Float > &sourceBuffer, const IPosition &where, const IPosition &stride)
The FITSImage is not writable, so this throws an exception.
virtual Bool doGetSlice(Array< Float > &buffer, const Slicer &theSlice)
Do the actual get of the data.
uInt whichHDU() const
Return the HDU number.
Definition FITSImage.h:225
FITSImage(const String &name, uInt whichRep=0, uInt whichHDU=0)
Construct a FITSImage from the disk FITS file name and extension and apply mask.
virtual String name(Bool stripPath=False) const
Returns the name of the disk file.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40