RFDataMapper.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef FLAGGING_RFDATAMAPPER_H
00028 #define FLAGGING_RFDATAMAPPER_H
00029
00030 #include <flagging/Flagging/RFChunkStats.h>
00031 #include <flagging/Flagging/DDMapper.h>
00032 #include <casa/Arrays/Cube.h>
00033 #include <scimath/Mathematics/RigidVector.h>
00034 #include <casa/Containers/Block.h>
00035
00036 namespace casa {
00037
00038 class RFDataMapper;
00039 class VisBuffer;
00040
00041
00042 typedef Float (RFDataMapper::*RowMapperFunc)(uInt);
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 class RFDataMapper
00074 {
00075 public:
00076
00077 typedef enum { MAPROW,MAPCORR } MapperType;
00078
00079
00080 RFDataMapper( const String &col,DDMapper *map );
00081
00082 RFDataMapper( const Vector<String> &expr,const String &defcol = "" );
00083
00084 ~RFDataMapper();
00085
00086
00087 MapperType type ();
00088
00089
00090
00091 Double getValueCycle ();
00092
00093
00094 Double getValueBase ();
00095
00096
00097 Float mapValue ( uInt ich,uInt irow );
00098
00099 Float mapValue ( uInt irow );
00100
00101
00102 RFlagWord corrMask (const VisibilityIterator &vi);
00103
00104
00105 void setVisBuffer (VisBuffer &vb);
00106
00107
00108 String description () const;
00109
00110 String descExpression () const;
00111
00112
00113
00114 typedef Cube<Complex> * (*CubeMapperFunc)(VisBuffer &);
00115
00116 protected:
00117
00118
00119 static CubeMapperFunc getCubeMapper( const String &col,Bool throw_excp = False );
00120
00121 String expr_desc,desc;
00122 DDMapper *ddm;
00123 RowMapperFunc rowmapper;
00124 Cube<Complex> *pviscube;
00125 Vector<RigidVector<Double,3> > *puvw;
00126 CubeMapperFunc cubemap;
00127 MapperType mytype;
00128 Double full_cycle,cycle_base;
00129
00130
00131 Float dummyRowMapper (uInt);
00132 Float U_RowMapper (uInt);
00133 Float V_RowMapper (uInt);
00134 Float W_RowMapper (uInt);
00135 Float AbsU_RowMapper (uInt);
00136 Float AbsV_RowMapper (uInt);
00137 Float AbsW_RowMapper (uInt);
00138 Float UVD_RowMapper (uInt);
00139 Float UVA_RowMapper (uInt);
00140 Float HA_RowMapper (uInt);
00141
00142
00143 Double sin_dec;
00144 };
00145
00146 inline RFDataMapper::MapperType RFDataMapper::type ()
00147 { return mytype; }
00148
00149 inline Float RFDataMapper::mapValue ( uInt ich,uInt irow )
00150 {
00151 if (pviscube == NULL) {
00152 throw(AipsError("Visibility buffer is unset, cannot get value!"));
00153 }
00154 return ddm->map(*pviscube,ich,irow);
00155 }
00156
00157 inline Float RFDataMapper::mapValue ( uInt irow )
00158 { return (this->*rowmapper)(irow); }
00159
00160 inline String RFDataMapper::description () const
00161 { return desc; }
00162 inline String RFDataMapper::descExpression () const
00163 { return expr_desc; }
00164
00165 inline Double RFDataMapper::getValueCycle ()
00166 { return full_cycle; }
00167 inline Double RFDataMapper::getValueBase ()
00168 { return cycle_base; }
00169
00170
00171 }
00172
00173 #endif