GSpline.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
00028
00029 #ifndef SYNTHESIS_GSPLINE_H
00030 #define SYNTHESIS_GSPLINE_H
00031
00032 #include <synthesis/MeasurementComponents/SolvableVisCal.h>
00033 #include <synthesis/MeasurementComponents/StandardVisCal.h>
00034 #include <synthesis/CalTables/GJonesMBuf.h>
00035 #include <casa/Containers/SimOrdMap.h>
00036
00037 namespace casa {
00038
00039
00040
00041
00042
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 VisEquation;
00074
00075 class GJonesSpline : public GJones {
00076 public:
00077
00078
00079 GJonesSpline (VisSet& vs);
00080
00081
00082 virtual ~GJonesSpline();
00083
00084
00085 virtual Type type() { return VisCal::G; };
00086
00087
00088 virtual String typeName() { return "GSPLINE"; };
00089 virtual String longTypeName() { return "G Jones SPLINE (elec. gain)"; };
00090
00091
00092
00093 virtual Bool useGenericGatherForSolve() { return False; };
00094
00095
00096
00097 virtual Jones::JonesType jonesType() { return Jones::Diagonal; };
00098
00099
00100 using GJones::setSolve;
00101 virtual void setSolve(const Record& solvepar);
00102
00103
00104 using GJones::setApply;
00105 virtual void setApply(const Record& applypar);
00106
00107
00108 virtual void selfGatherAndSolve (VisSet& vs, VisEquation& ve);
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 protected:
00119
00120
00121
00122 virtual Int nPar() { return 2; };
00123
00124
00125 virtual void calcPar();
00126
00127 private:
00128
00129
00130 VisSet* vs_p;
00131
00132
00133 Bool solveAmp_p, solvePhase_p;
00134 Double splinetime_p;
00135
00136
00137 Double cacheTimeValid_p;
00138
00139
00140
00141 GJonesSplineMBuf* calBuffer_p;
00142
00143
00144
00145 VisSet* rawvs_p;
00146 Bool rawPhaseRemoval_p;
00147 SimpleOrderedMap<String, Int> timeValueMap_p;
00148 Matrix<Double> rawPhase_p;
00149
00150
00151 Double solTimeStamp_p;
00152
00153
00154
00155 void newCalBuffer (const Vector<Int>& fieldIdKeys,
00156 const Vector<Int>& antennaId);
00157
00158
00159 Int getKnots (const Vector<Double>& times, Vector<Double>& knots);
00160
00161
00162 virtual void updateCalTable (const Vector<Int>& fieldIdKeys,
00163 const Vector<Int>& antennaId,
00164 const Vector<String>& freqGrpName,
00165 const Vector<String>& polyType,
00166 const Vector<String>& polyMode,
00167 const Vector<Complex>& scaleFactor,
00168 const Matrix<Double>& polyCoeffAmp,
00169 const Matrix<Double>& polyCoeffPhase,
00170 const Vector<String>& phaseUnits,
00171 const Vector<Double>& splineKnotsAmp,
00172 const Vector<Double>& splineKnotsPhase,
00173 const Vector<MFrequency>& refFreq,
00174 const Vector<Int>& refAnt);
00175
00176
00177 Double getSplineVal (Double x, Vector<Double>& knots,
00178 Vector<Double>& coeff);
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191 void plotsolve(const Vector<Double>& x,
00192 const Matrix<Double>& yall,
00193 const Matrix<Double>& weightall,
00194 const Vector<Double>& errall,
00195 Matrix<Double>& coeff, Bool phasesoln);
00196
00197
00198 Vector<Int> fieldIdRange();
00199
00200
00201 void writeAsciiLog(const String& filename, const Matrix<Double>& coeff, const Vector<Double>& rmsFit, Bool phasesoln);
00202
00203 Int numpoint_p;
00204 Double phaseWrap_p;
00205
00206
00207 };
00208
00209
00210 }
00211
00212 #endif
00213
00214