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 << 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{
82public:
83 enum ObsType {
84 // Standard, optimizes i/o by using large tiles (128 kB)
86 // Fast Mosaic, specify this if you have many (>30) fields and you
87 // spend only a few integrations per pointing before moving on.
88 // Avoids useless i/o caching by using small tiles
90 };
91
92 // Suggest tile shape based on the data shape, the observing mode,
93 // the number of interferometers and the number of integrations per
94 // pointing.
95 //
96 // First argument should be a 2-dimensional IPosition with the data matrix
97 // shape.
98 // The second argument is one of the enums above specifying the type of
99 // observation.
100 // The third argument is an estimate of the number of interferometers
101 // present throughout most of the data.
102 // The last argument is an estimate of the number of integrations per
103 // pointing.
104 //
105 // The last three arguments only need to be specified if the observing mode
106 // is non Standard.
107 // Basically the choice is between large tiles for efficient I/O and small
108 // tiles when a common access pattern (field_id order) would result
109 // in very inefficient caching. The latter occurs for large tiles if the
110 // field_id changes rapidly AND there are many fields AND the data
111 // matrix is small (e.g., continuum mosaic of a large area with only
112 // one or two integrations per pointing). Note that accessing fast mosaic
113 // data with large tiles in field_id order can be 10-100 times slower than
114 // sequential access.
115 static IPosition tileShape(const IPosition& dataShape,
116 Int observationType = Standard,
117 Int nIfr = 0, Int nInt = 1);
118
119 // same as above, but pick standard nIfr (number of interferometers)
120 // for named array and default nInt.
121 static IPosition tileShape(const IPosition& dataShape,
122 Int observationType,
123 const String& array);
124};
125
126
127} //# NAMESPACE CASACORE - END
128
129#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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition ExprNode.h:1933
int Int
Definition aipstype.h:48