casacore
Loading...
Searching...
No Matches
LCHDF5Mask.h
Go to the documentation of this file.
1//# LCHDF5Mask.h: Class to define a rectangular mask of interest
2//# Copyright (C) 2008
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 LATTICES_LCHDF5MASK_H
27#define LATTICES_LCHDF5MASK_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/lattices/LRegions/LCBox.h>
32#include <casacore/lattices/Lattices/HDF5Lattice.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36 // <summary>
37 // Class to define a rectangular mask as a region
38 // </summary>
39
40 // <use visibility=local>
41
42 // <reviewed reviewer="" date="" tests="">
43 // </reviewed>
44
45 // <prerequisite>
46 // <li> <linkto class=LCRegionSingle>LCRegionSingle</linkto>
47 // </prerequisite>
48
49 // <synopsis>
50 // The LCHDF5Mask class is a specialization of class
51 // <linkto class=LCRegionSingle>LCRegionSingle</linkto>.
52 // It holds a mask for an HDF5Image in an HDF5Lattice<Bool> object.
53 // </synopsis>
54
56 {
57 public:
59
60 // Construct an HDF5Mask object for (part of) a lattice.
61 // It is put in group Masks of the HDF5 file.
62 // The group is created if not existing yet.
63 // The box defines the position of the mask.
64 // The default mask shape is the lattice shape.
65 // <group>
67 const std::shared_ptr<HDF5File>& file, const String& maskName);
68 LCHDF5Mask (const TiledShape& maskShape, const LCBox& box,
69 const std::shared_ptr<HDF5File>& file, const String& maskName);
71 // </group>
72
73 // Copy constructor (copy semantics).
74 LCHDF5Mask (const LCHDF5Mask& other);
75
76 // Destructor
77 virtual ~LCHDF5Mask();
78
79 // Assignment (reference semantics).
81
82 // Comparison
83 virtual Bool operator==(const LCRegion& other) const;
84
85 // Make a copy of the derived object.
86 virtual LCRegion* cloneRegion() const;
87
88 // This function is used by the LatticeIterator class to generate an
89 // iterator of the correct type for this Lattice. Not recommended
90 // for general use.
92 (const LatticeNavigator& navigator,
93 Bool useRef) const;
94
95 // Returns the maximum recommended number of pixels for a cursor.
96 // This is the number of pixels in a tile.
97 virtual uInt advisedMaxPixels() const;
98
99 // Help the user pick a cursor for most efficient access.
100 virtual IPosition doNiceCursorShape (uInt maxPixels) const;
101
102 // Flush the data (but do not unlock).
103 virtual void flush();
104
105 // Get the class name (to store in the record).
107
108 // Region type. Returns class name.
109 virtual String type() const;
110
111 // Convert the (derived) object to a record.
112 virtual TableRecord toRecord (const String& tableName) const;
113
114 // Convert correct object from a record.
116 const String& tablename);
117
118 // An LCHDF5Mask is writable if the underlying HDF5Lattice is.
119 virtual Bool isWritable() const;
120
121 protected:
122 // Construct another LCHDF5Mask (for e.g. another lattice) by moving
123 // this one. It recalculates the bounding mask.
124 // A positive translation value indicates "to right".
125 virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
126 const IPosition& newLatticeShape) const;
127
128 private:
129 // Create the object from a record (for an existing mask).
131 const IPosition& blc,
132 const IPosition& latticeShape);
133
134
137 };
138
139
140
141} //# NAMESPACE CASACORE - END
142
143#endif
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCHDF5Mask (for e.g.
LCHDF5Mask & operator=(const LCHDF5Mask &other)
Assignment (reference semantics).
LCHDF5Mask(const TiledShape &latticeShape, const std::shared_ptr< HDF5File > &file, const String &maskName)
Construct an HDF5Mask object for (part of) a lattice.
virtual void flush()
Flush the data (but do not unlock).
LCHDF5Mask(HDF5Lattice< Bool > &mask, const IPosition &blc, const IPosition &latticeShape)
Create the object from a record (for an existing mask).
virtual uInt advisedMaxPixels() const
Returns the maximum recommended number of pixels for a cursor.
LCHDF5Mask(HDF5Lattice< Bool > &mask, const LCBox &box)
virtual Bool operator==(const LCRegion &other) const
Comparison.
LCHDF5Mask(const LCHDF5Mask &other)
Copy constructor (copy semantics).
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Help the user pick a cursor for most efficient access.
LCHDF5Mask(const TiledShape &maskShape, const LCBox &box, const std::shared_ptr< HDF5File > &file, const String &maskName)
HDF5Lattice< Bool > itsMask
Definition LCHDF5Mask.h:136
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
virtual String type() const
Region type.
virtual ~LCHDF5Mask()
Destructor.
virtual Bool isWritable() const
An LCHDF5Mask is writable if the underlying HDF5Lattice is.
static String className()
Get the class name (to store in the record).
static LCHDF5Mask * fromRecord(const TableRecord &, const String &tablename)
Convert correct object from a record.
virtual LatticeIterInterface< Bool > * makeIter(const LatticeNavigator &navigator, Bool useRef) const
This function is used by the LatticeIterator class to generate an iterator of the correct type for th...
const IPosition & latticeShape() const
Give the full lattice shape.
Definition LCRegion.h:229
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