casacore
Loading...
Searching...
No Matches
LCLELMask.h
Go to the documentation of this file.
1//# LCLELMask.h: Class to define a mask as a LEL expression
2//# Copyright (C) 2000
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
27
28#ifndef LATTICES_LCLELMASK_H
29#define LATTICES_LCLELMASK_H
30
31//# Includes
32#include <casacore/casa/aips.h>
33#include <casacore/lattices/LRegions/LCRegionSingle.h>
34#include <casacore/lattices/LRegions/LCBox.h>
35#include <casacore/lattices/LEL/LatticeExpr.h>
36
37
38namespace casacore { //# NAMESPACE CASACORE - BEGIN
39
40//# Forward Declarations
41class TableRecord;
42class IPosition;
43
44
45// <summary>
46// Class to define a mask as a LEL expression
47// </summary>
48
49// <use visibility=export>
50
51// <reviewed reviewer="" date="" tests="">
52// </reviewed>
53
54// <prerequisite>
55// <li> <linkto class=LCRegion>LCRegion</linkto>
56// <li> <linkto class=ImageExpr>ImageExpr</linkto>
57// </prerequisite>
58
59// <synopsis>
60// The LCLELMask class is a specialization of class
61// <linkto class=LCRegion>LCRegion</linkto>.
62// <br>
63// It can be used to define an on-the-fly mask for a lattice
64// using a boolean <linkto class=LatticeExpr>LatticeExpr</linkto>.
65// The contents of the mask are calculated on the fly from the expression.
66// Thus the mask may change if the data in the lattice(s) used in the
67// expression change.
68// <note role=caution>
69// This mask is not persistent, thus it cannot be saved with an image.
70// Use class <linkto class=WCLELMask>WCLELMask</linkto> to have a
71// persistent on-the-fly mask. It means that normally a WCLELMask should
72// be used (which gets converted to an LCLELMask when applied to an image).
73// </note>
74// </synopsis>
75
76// <example>
77// </example>
78
79// <motivation>
80// LCLELMask is needed to make
81// </motivation>
82
83//# <todo asof="1998/05/20">
84//# <li>
85//# </todo>
86
88{
89public:
91
92 // Construct from vectors of world coordinates
93 // defining the box corners. It is assumed that the
94 // order of the values is in the order of the pixel axes.
95 explicit LCLELMask (const LatticeExpr<Bool>& expr);
96
97 // Copy constructor (copy semantics).
98 LCLELMask (const LCLELMask& other);
99
100 // Destructor
101 virtual ~LCLELMask();
102
103 // Assignment (copy semantics)
105
106 // Comparison
107 virtual Bool operator== (const LCRegion& other) const;
108
109 // Clone a LCLELMask object.
110 virtual LCRegion* cloneRegion() const;
111
112 // Handle the (un)locking.
113 // <group>
114 virtual Bool lock (FileLocker::LockType, uInt nattempts);
115 virtual void unlock();
117 // </group>
118
119 // Resynchronize the PagedArray object with the lattice file.
120 // This function is only useful if no read-locking is used, ie.
121 // if the table lock option is UserNoReadLocking or AutoNoReadLocking.
122 // In that cases the table system does not acquire a read-lock, thus
123 // does not synchronize itself automatically.
124 virtual void resync();
125
126 // Temporarily close the lattice.
127 // It will be reopened automatically on the next access.
128 virtual void tempClose();
129
130 // Explicitly reopen the temporarily closed lattice.
131 virtual void reopen();
132
133 // Returns LCLELMask
135
136 // Return region type. Returns the class name
137 virtual String type() const;
138
139 // Convert the LCLELMask object to a record.
140 // This cannot be done as a Lattice expression cannot be made persistent
141 // (only Image expressions can, thus only WCLELMask is persistent).
142 // <br>So this function throws an exception.
143 virtual TableRecord toRecord (const String& tableName) const;
144
145
146protected:
147 // Translating an LCLELMask is not possible, so it throws an exception.
148 virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
149 const IPosition& newLatticeShape) const;
150
151private:
154};
155
156
157
158} //# NAMESPACE CASACORE - END
159
160#endif
LockType
Define the possible lock types.
Definition FileLocker.h:93
virtual Bool operator==(const LCRegion &other) const
Comparison.
virtual Bool hasLock(FileLocker::LockType) const
virtual void reopen()
Explicitly reopen the temporarily closed lattice.
LatticeExpr< Bool > itsExpr
Definition LCLELMask.h:153
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Translating an LCLELMask is not possible, so it throws an exception.
virtual void unlock()
LCLELMask & operator=(const LCLELMask &other)
Assignment (copy semantics)
virtual ~LCLELMask()
Destructor.
virtual void tempClose()
Temporarily close the lattice.
virtual LCRegion * cloneRegion() const
Clone a LCLELMask object.
virtual void resync()
Resynchronize the PagedArray object with the lattice file.
LCLELMask(const LCLELMask &other)
Copy constructor (copy semantics).
virtual TableRecord toRecord(const String &tableName) const
Convert the LCLELMask object to a record.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle the (un)locking.
LCLELMask(const LatticeExpr< Bool > &expr)
Construct from vectors of world coordinates defining the box corners.
static String className()
Returns LCLELMask.
virtual String type() const
Return region type.
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
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40