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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/images/Images/FITSImage.h>
33#include <casacore/casa/Arrays/ArrayFwd.h>
34#include <casacore/casa/BasicSL/String.h>
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38//# Forward Declarations
39class MaskSpecifier;
40class IPosition;
41class Slicer;
42
43// <summary>
44// Class providing native access to FITS Error images.
45// </summary>
46
47// <use visibility=export>
48
49// <reviewed reviewer="" date="" tests="tFITSErrorImage.cc">
50// </reviewed>
51
52// <prerequisite>
53// <li> <linkto class=FITSImage>FITSImage</linkto>
54// <li> <linkto class=FITSMask>FITSMask</linkto>
55// </prerequisite>
56
57// <etymology>
58// </etymology>
59
60// <synopsis>
61// </synopsis>
62
63// <example>
64// <srcblock>
65// </srcblock>
66// </example>
67
68// <motivation>
69// This provides native access to FITS error images.
70// </motivation>
71
72//# <todo asof="2011/08/17">
73//# </todo>
74
76{
77public:
78
79 // The enum describes which types of error images exist. The type is fixed
80 // during object creation and can not be changed at a later time.
82 {
83 MSE, // the values are "mean squared error" (=variance)
84 RMSE, // the values are "root mean squared error" (=sigma)
85 INVMSE, // the values are inverse "means squared error"
86 INVRMSE, // the values are inverse "root mean squared error"
87 UNKNOWN, // unknown type
89 };
90
91 // Construct a FITSImage from the disk FITS file name and extension and apply mask.
92 explicit FITSErrorImage(const String& name, uInt whichRep=0, uInt whichHDU=0, FITSErrorImage::ErrorType errtype=MSE);
93
94 // Construct a FITSImage from the disk FITS file name and extension and apply mask or not.
96
97 // Copy constructor (reference semantics)
99
100 // Destructor
102
103 // Assignment (reference semantics)
105
106 // Make a copy of the object with new (reference semantics).
108
109 // Get the image type (returns "FITSErrorImage").
110 virtual String imageType() const;
111
112 // Do the actual get of the data.
113 // Returns False as the data do not reference another Array
114 virtual Bool doGetSlice (Array<Float>& buffer, const Slicer& theSlice);
115
116 // The FITSImage is not writable, so this throws an exception.
117 virtual void doPutSlice (const Array<Float>& sourceBuffer,
118 const IPosition& where,
119 const IPosition& stride);
120
121 // Return the error type.
123 {return errtype_p;};
124
125 // Convert an image type to String.
127
128 // Convert a String to an image type.
130
131private:
132
133 // Set the correct masking.
134 void setupMask();
135
138};
139
140
141
142} //# NAMESPACE CASACORE - END
143
144#endif
145
146
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:232
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:223
this file contains all the compiler specific defines
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