casacore
Loading...
Searching...
No Matches
MSTileLayout.h
Go to the documentation of this file.
1// # MSTileLayout.h: Determine appropriate tiling for a MeasurementSet
2// # Copyright (C) 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 MS_MSTILELAYOUT_H
27#define MS_MSTILELAYOUT_H
28
29#include <casacore/casa/aips.h>
30
31namespace casacore { // # NAMESPACE CASACORE - BEGIN
32
33// # forward decl
34class IPosition;
35class String;
36
37// <summary>
38// An helper class for deciding on tile shapes in MeasurementSets
39// </summary>
40
41// <use visibility=export>
42
43// <prerequisite>
44// <li> <linkto class="MeasurementSet:description">MeasurementSet</linkto>
45// <li> <linkto class="TiledStMan:description">TiledStMan</linkto>
46// </prerequisite>
47//
48// <etymology>
49// MSTileLayout stands for the MeasurementSet tile layout chooser
50// </etymology>
51//
52// <synopsis>
53// MSTileLayout is a class to determine an appropriate tile shape choice
54// for the MeasurementSet DATA columns, based on the shape of the DATA,
55// the observing mode and the number of interferometers
56// </synopsis>
57//
58// <example>
59// <srcblock>
60// // The following code returns the tile shape given the DATA shape,
61// // the observing type and the array name.
62// IPosition dataShape(2,4,1024); // 4 polarizations, 1024 channels
63// IPosition tileShape = MSTileLayout::tileShape(dataShape,
64// MSTileLayout::FastMosaic,
65// "ATCA");
66// cout << "tileShape = "<< tileShape << std::endl;
67// // Output is:
68// tileShape = (4,11,15)
69// </srcblock>
70// </example>
71
72// <motivation>
73// This class is intended to replace bits of code scattered throughout various
74// fillers and collect all tiling decisions in one place.
75// </motivation>
76//
77// <todo>
78// </todo>
79
81 public:
82 enum ObsType {
83 // Standard, optimizes i/o by using large tiles (128 kB)
85 // Fast Mosaic, specify this if you have many (>30) fields and you
86 // spend only a few integrations per pointing before moving on.
87 // Avoids useless i/o caching by using small tiles
89 };
90
91 // Suggest tile shape based on the data shape, the observing mode,
92 // the number of interferometers and the number of integrations per
93 // pointing.
94 //
95 // First argument should be a 2-dimensional IPosition with the data matrix
96 // shape.
97 // The second argument is one of the enums above specifying the type of
98 // observation.
99 // The third argument is an estimate of the number of interferometers
100 // present throughout most of the data.
101 // The last argument is an estimate of the number of integrations per
102 // pointing.
103 //
104 // The last three arguments only need to be specified if the observing mode
105 // is non Standard.
106 // Basically the choice is between large tiles for efficient I/O and small
107 // tiles when a common access pattern (field_id order) would result
108 // in very inefficient caching. The latter occurs for large tiles if the
109 // field_id changes rapidly AND there are many fields AND the data
110 // matrix is small (e.g., continuum mosaic of a large area with only
111 // one or two integrations per pointing). Note that accessing fast mosaic
112 // data with large tiles in field_id order can be 10-100 times slower than
113 // sequential access.
114 static IPosition tileShape(const IPosition& dataShape, Int observationType = Standard,
115 Int nIfr = 0, Int nInt = 1);
116
117 // same as above, but pick standard nIfr (number of interferometers)
118 // for named array and default nInt.
119 static IPosition tileShape(const IPosition& dataShape, Int observationType, const String& array);
120};
121
122} // namespace casacore
123
124#endif
static IPosition tileShape(const IPosition &dataShape, Int observationType, const String &array)
same as above, but pick standard nIfr (number of interferometers) for named array and default nInt.
static IPosition tileShape(const IPosition &dataShape, Int observationType=Standard, Int nIfr=0, Int nInt=1)
Suggest tile shape based on the data shape, the observing mode, the number of interferometers and the...
@ Standard
Standard, optimizes i/o by using large tiles (128 kB).
@ FastMosaic
Fast Mosaic, specify this if you have many (>30) fields and you spend only a few integrations per poi...
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
T * array
The actual storage.
Definition Block.h:689
int Int
Definition aipstype.h:48