Line data Source code
1 : //# AsdmColumn.h: A column in the ASDM Storage Manager 2 : //# Copyright (C) 2012 3 : //# Associated Universities, Inc. Washington DC, USA. 4 : //# (c) European Southern Observatory, 2012 5 : //# Copyright by ESO (in the framework of the ALMA collaboration) 6 : //# 7 : //# This library is free software; you can redistribute it and/or modify it 8 : //# under the terms of the GNU Library General Public License as published by 9 : //# the Free Software Foundation; either version 2 of the License, or (at your 10 : //# option) any later version. 11 : //# 12 : //# This library is distributed in the hope that it will be useful, but WITHOUT 13 : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 : //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 15 : //# License for more details. 16 : //# 17 : //# You should have receied a copy of the GNU Library General Public License 18 : //# along with this library; if not, write to the Free Software Foundation, 19 : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 20 : //# 21 : //# Correspondence concerning AIPS++ should be addressed as follows: 22 : //# Internet email: aips2-request@nrao.edu. 23 : //# Postal address: AIPS++ Project Office 24 : //# National Radio Astronomy Observatory 25 : //# 520 Edgemont Road 26 : //# Charlottesville, VA 22903-2475 USA 27 : //# 28 : //# $Id: AsdmColumn.h 19324 2011-11-21 07:29:55Z diepen $ 29 : 30 : #ifndef ASDM_ASDMCOLUMN_H 31 : #define ASDM_ASDMCOLUMN_H 32 : 33 : 34 : //# Includes 35 : #include <asdmstman/AsdmStMan.h> 36 : #include <casacore/tables/DataMan/StManColumn.h> 37 : #include <casacore/casa/Arrays/IPosition.h> 38 : #include <casacore/casa/Containers/Block.h> 39 : #include <casacore/casa/OS/Conversion.h> 40 : 41 : namespace casa { 42 : 43 : // <summary> 44 : // A column in the ASDM Storage Manager. 45 : // </summary> 46 : 47 : // <use visibility=local> 48 : 49 : // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tAsdmStMan.cc"> 50 : // </reviewed> 51 : 52 : // <prerequisite> 53 : //# Classes you should understand before using this one. 54 : // <li> <linkto class=AsdmStMan>AsdmStMan</linkto> 55 : // </prerequisite> 56 : 57 : // <synopsis> 58 : // For each column a specific Column class exists. 59 : // </synopsis> 60 : 61 : class AsdmColumn : public casacore::StManColumn 62 : { 63 : public: 64 263 : explicit AsdmColumn (AsdmStMan* parent, int dtype) 65 263 : : casacore::StManColumn (dtype), 66 263 : itsParent (parent) 67 263 : {} 68 : virtual ~AsdmColumn(); 69 : // All columns are not writable. 70 : // However, we let AsdmColumn::isWritable() return true. If an actual write is done, 71 : // an exception will be thrown. This ensures that the StMan will work with MSMainColumns. 72 : virtual casacore::Bool isWritable() const; 73 : // Set column shape of fixed shape columns; it does nothing. 74 : virtual void setShapeColumn (const casacore::IPosition& shape); 75 : // Prepare the column. By default it does nothing. 76 : virtual void prepareCol(); 77 : 78 : protected: 79 : 80 : template <typename T> 81 : void getSlice (casacore::uInt rowNumber, 82 : const casacore::Slicer & slicer, 83 : casacore::Array<T> * destination); 84 : 85 : AsdmStMan* itsParent; 86 : }; 87 : 88 : // <summary>DATA column in the ASDM Storage Manager.</summary> 89 : // <use visibility=local> 90 : class AsdmDataColumn : public AsdmColumn 91 : { 92 : public: 93 225 : explicit AsdmDataColumn (AsdmStMan* parent, int dtype) 94 225 : : AsdmColumn(parent, dtype) {} 95 : virtual ~AsdmDataColumn(); 96 : virtual casacore::IPosition shape (casacore::uInt rownr); 97 : virtual void getArrayComplexV (casacore::uInt rowNr, casacore::Array<casacore::Complex>* dataPtr); 98 : virtual void getSliceComplexV (casacore::uInt rowNumber, const casacore::Slicer & slicer, 99 : casacore::Array<casacore::Complex> * destination); 100 : }; 101 : 102 : // <summary>FLOAT_DATA column in the ASDM Storage Manager.</summary> 103 : // <use visibility=local> 104 : class AsdmFloatDataColumn : public AsdmColumn 105 : { 106 : public: 107 38 : explicit AsdmFloatDataColumn (AsdmStMan* parent, int dtype) 108 38 : : AsdmColumn(parent, dtype) {} 109 : virtual ~AsdmFloatDataColumn(); 110 : virtual casacore::IPosition shape (casacore::uInt rownr); 111 : virtual void getArrayfloatV (casacore::uInt rowNr, casacore::Array<casacore::Float> * dataPtr); 112 : virtual void getSlicefloatV (casacore::uInt rowNumber, const casacore::Slicer & slicer, 113 : casacore::Array<casacore::Float> * destination); 114 : }; 115 : 116 : // <summary>FLAG column in the ASDM Storage Manager.</summary> 117 : // <use visibility=local> 118 : class AsdmFlagColumn : public AsdmColumn 119 : { 120 : public: 121 0 : explicit AsdmFlagColumn (AsdmStMan* parent, int dtype) 122 0 : : AsdmColumn(parent, dtype) {} 123 : virtual ~AsdmFlagColumn(); 124 : virtual casacore::IPosition shape (casacore::uInt rownr); 125 : virtual void getArrayBoolV (casacore::uInt rowNr, 126 : casacore::Array<casacore::Bool>* dataPtr); 127 : virtual void getSliceBoolV (casacore::uInt rowNumber, const casacore::Slicer & slicer, 128 : casacore::Array<casacore::Bool> * destination); 129 : }; 130 : 131 : // <summary>WEIGHT column in the ASDM Storage Manager.</summary> 132 : // <use visibility=local> 133 : class AsdmWeightColumn : public AsdmColumn 134 : { 135 : public: 136 0 : explicit AsdmWeightColumn (AsdmStMan* parent, int dtype) 137 0 : : AsdmColumn(parent, dtype) {} 138 : virtual ~AsdmWeightColumn(); 139 : virtual casacore::IPosition shape (casacore::uInt rownr); 140 : virtual void getArrayfloatV (casacore::uInt rowNr, 141 : casacore::Array<casacore::Float>* dataPtr); 142 : virtual void getSlicefloatV (casacore::uInt rowNumber, const casacore::Slicer & slicer, 143 : casacore::Array<casacore::Float> * destination); 144 : }; 145 : 146 : // <summary>SIGMA column in the ASDM Storage Manager.</summary> 147 : // <use visibility=local> 148 : class AsdmSigmaColumn : public AsdmColumn 149 : { 150 : public: 151 0 : explicit AsdmSigmaColumn (AsdmStMan* parent, int dtype) 152 0 : : AsdmColumn(parent, dtype) {} 153 : virtual ~AsdmSigmaColumn(); 154 : virtual casacore::IPosition shape (casacore::uInt rownr); 155 : virtual void getArrayfloatV (casacore::uInt rowNr, 156 : casacore::Array<casacore::Float>* dataPtr); 157 : virtual void getSlicefloatV (casacore::uInt rowNumber, const casacore::Slicer & slicer, 158 : casacore::Array<casacore::Float> * destination); 159 : }; 160 : 161 : 162 : } //# end namespace 163 : 164 : #endif