Changeset 8725 for trunk/MagicSoft/Mars/mpointing
- Timestamp:
- 09/02/07 14:53:56 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mpointing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MPointing.cc
r8720 r8725 18 18 ! Author(s): Thomas Bretz, 2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 63 63 // Double_t fAcec ; // [rad] Azimuth Centering Error (cos) 64 64 // 65 // Double_t fMagic1;// [rad] ZA Hysteresis65 // Double_t fMagic1;// [rad] MAGIC culmination hysteresis 66 66 // Double_t fMagic2;// [rad] undefined 67 // 68 // Double_t fDx; // [rad] X-offset in camera (for starguider calibration) 69 // Double_t fDy; // [rad] Y-offset in camera (for starguider calibration) 70 // 71 // 72 // Class Version 2: 73 // ---------------- 74 // + fPx 75 // + fPy 76 // + fDx 77 // + fDy 78 // 67 79 // 68 80 //////////////////////////////////////////////////////////////////////////// … … 70 82 71 83 #include <fstream> 72 73 #include <TVector3.h>74 84 75 85 #include <TMinuit.h> … … 90 100 #define DEBUG(txt) 91 101 92 const Int_t MPointing::fgNumPar=19;93 94 102 void MPointing::Init(const char *name, const char *title) 95 103 { … … 97 105 fTitle = title ? title : "Pointing correction model for the MAGIC telescope"; 98 106 99 fCoeff = new Double_t*[fgNumPar]; 100 fNames = new TString[fgNumPar]; 101 fDescr = new TString[fgNumPar]; 102 103 fCoeff[ 0] = &fIa; fNames[ 0] = "IA"; 104 fCoeff[ 1] = &fIe; fNames[ 1] = "IE"; 105 fCoeff[ 2] = &fFlop; fNames[ 2] = "FLOP"; 106 fCoeff[ 3] = &fAn; fNames[ 3] = "AN"; 107 fCoeff[ 4] = &fAw; fNames[ 4] = "AW"; 108 fCoeff[ 5] = &fNpae; fNames[ 5] = "NPAE"; 109 fCoeff[ 6] = &fCa; fNames[ 6] = "CA"; 110 fCoeff[ 7] = &fTf; fNames[ 7] = "TF"; 111 fCoeff[ 8] = &fTx; fNames[ 8] = "TX"; 112 fCoeff[ 9] = &fEces; fNames[ 9] = "ECES"; 113 fCoeff[10] = &fAces; fNames[10] = "ACES"; 114 fCoeff[11] = &fEcec; fNames[11] = "ECEC"; 115 fCoeff[12] = &fAcec; fNames[12] = "ACEC"; 116 fCoeff[13] = &fNrx; fNames[13] = "NRX"; 117 fCoeff[14] = &fNry; fNames[14] = "NRY"; 118 fCoeff[15] = &fCrx; fNames[15] = "CRX"; 119 fCoeff[16] = &fCry; fNames[16] = "CRY"; 120 fCoeff[17] = &fMagic1; fNames[17] = "MAGIC1"; 121 fCoeff[18] = &fMagic2; fNames[18] = "MAGIC2"; 122 123 fDescr[ 0] = "Index Error Azimuth"; 124 fDescr[ 1] = "Index Error Zenith Distance"; 125 fDescr[ 2] = "Vertical Sag"; 126 fDescr[ 3] = "Azimuth Axis Misalignment (N-S)"; 127 fDescr[ 4] = "Azimuth Axis Misalignment (E-W)"; 128 fDescr[ 5] = "Az-El Nonperpendicularity"; 129 fDescr[ 6] = "Left-Right Collimation Error"; 130 fDescr[ 7] = "Tube fluxture (sin)"; 131 fDescr[ 8] = "Tube fluxture (tan)"; 132 fDescr[ 9] = "Elevation Centering Error (sin)"; 133 fDescr[10] = "Azimuth Centering Error (sin)"; 134 fDescr[11] = "Elevation Centering Error (cos)"; 135 fDescr[12] = "Azimuth Centering Error (cos)"; 136 fDescr[13] = "Nasmyth rotator displacement (horizontal)"; 137 fDescr[14] = "Nasmyth rotator displacement (vertical)"; 138 fDescr[15] = "Alt/Az Coude Displacement (N-S)"; 139 fDescr[16] = "Alt/Az Coude Displacement (E-W)"; 140 fDescr[17] = "n/a <ZA Hysteresis>"; 141 fDescr[18] = "n/a"; 107 fCoeff = new Double_t*[kNumPar]; 108 fNames = new TString[kNumPar]; 109 fDescr = new TString[kNumPar]; 110 111 fCoeff[kIA] = &fIa; fNames[kIA] = "IA"; 112 fCoeff[kIE] = &fIe; fNames[kIE] = "IE"; 113 fCoeff[kFLOP] = &fFlop; fNames[kFLOP] = "FLOP"; 114 fCoeff[kAN] = &fAn; fNames[kAN] = "AN"; 115 fCoeff[kAW] = &fAw; fNames[kAW] = "AW"; 116 fCoeff[kNPAE] = &fNpae; fNames[kNPAE] = "NPAE"; 117 fCoeff[kCA] = &fCa; fNames[kCA] = "CA"; 118 fCoeff[kTF] = &fTf; fNames[kTF] = "TF"; 119 fCoeff[kTX] = &fTx; fNames[kTX] = "TX"; 120 fCoeff[kECES] = &fEces; fNames[kECES] = "ECES"; 121 fCoeff[kACES] = &fAces; fNames[kACES] = "ACES"; 122 fCoeff[kECEC] = &fEcec; fNames[kECEC] = "ECEC"; 123 fCoeff[kACEC] = &fAcec; fNames[kACEC] = "ACEC"; 124 fCoeff[kNRX] = &fNrx; fNames[kNRX] = "NRX"; 125 fCoeff[kNRY] = &fNry; fNames[kNRY] = "NRY"; 126 fCoeff[kCRX] = &fCrx; fNames[kCRX] = "CRX"; 127 fCoeff[kCRY] = &fCry; fNames[kCRY] = "CRY"; 128 fCoeff[kMAGIC1] = &fMagic1; fNames[kMAGIC1] = "MAGIC1"; 129 fCoeff[kMAGIC2] = &fMagic2; fNames[kMAGIC2] = "MAGIC2"; 130 fCoeff[kPX] = &fPx; fNames[kPX] = "PX"; 131 fCoeff[kPY] = &fPy; fNames[kPY] = "PY"; 132 fCoeff[kDX] = &fDx; fNames[kDX] = "DX"; 133 fCoeff[kDY] = &fDy; fNames[kDY] = "DY"; 134 135 fDescr[kIA] = "Index Error Azimuth"; 136 fDescr[kIE] = "Index Error Zenith Distance"; 137 fDescr[kFLOP] = "Vertical Sag"; 138 fDescr[kAN] = "Azimuth Axis Misalignment (N-S)"; 139 fDescr[kAW] = "Azimuth Axis Misalignment (E-W)"; 140 fDescr[kNPAE] = "Az-El Nonperpendicularity"; 141 fDescr[kCA] = "Left-Right Collimation Error"; 142 fDescr[kTF] = "Tube fluxture (sin)"; 143 fDescr[kTX] = "Tube fluxture (tan)"; 144 fDescr[kECES] = "Elevation Centering Error (sin)"; 145 fDescr[kACES] = "Azimuth Centering Error (sin)"; 146 fDescr[kECEC] = "Elevation Centering Error (cos)"; 147 fDescr[kACEC] = "Azimuth Centering Error (cos)"; 148 fDescr[kNRX] = "Nasmyth rotator displacement (horizontal)"; 149 fDescr[kNRY] = "Nasmyth rotator displacement (vertical)"; 150 fDescr[kCRX] = "Alt/Az Coude Displacement (N-S)"; 151 fDescr[kCRY] = "Alt/Az Coude Displacement (E-W)"; 152 fDescr[kMAGIC1] = "MAGIC culmination hysteresis"; 153 fDescr[kMAGIC2] = "n/a"; 154 fDescr[kPX] = "Starguider calibration fixed offset x"; 155 fDescr[kPY] = "Starguider calibration fixed offset y"; 156 fDescr[kDX] = "Starguider calibration additional offset dx"; 157 fDescr[kDY] = "Starguider calibration additional offset dy"; 142 158 } 143 159 … … 195 211 *fLog << endl; 196 212 197 *fLog << " & = Name Value Sigma" << endl;213 *fLog << " & = Name Value Sigma " << endl; 198 214 *fLog << "--------------------------------------------------" << endl; 199 215 … … 213 229 break; 214 230 231 TString sout; 232 215 233 if (str[0]=='#') 216 234 continue; … … 218 236 if (str[0]=='&') 219 237 { 220 *fLog <<" & ";238 sout += " & "; 221 239 str.Remove(0); 222 240 } 223 241 else 224 *fLog <<" ";242 sout += " "; 225 243 226 244 if (str[1]=='=') 227 245 { 228 *fLog <<"= ";246 sout += "= "; 229 247 str.Remove(0); 230 248 } 231 249 else 232 *fLog <<" ";250 sout += " "; 233 251 234 252 fin >> val; 235 *fLog << str << "\t" << setw(11) << val << "° \t"; 253 254 sout += str; 255 sout += '\t'; 256 sout += Form("%11f", val); 257 sout += "° \t"; 236 258 val *= TMath::DegToRad(); 237 259 238 260 // Find parameter 239 261 Int_t n = -1; 240 for (int i=0; i< fgNumPar; i++)262 for (int i=0; i<kNumPar; i++) 241 263 if (str==fNames[i]) 242 264 { … … 247 269 248 270 fin >> val; 249 *fLog << setw(9) << val << "°" << endl; 271 sout += Form("%9f°", val); 272 273 if (*fCoeff[n]!=0 || val>0) 274 *fLog << sout << endl; 250 275 251 276 if (!fin) … … 298 323 fout << "S 00 000000 000000 0000000" << endl; 299 324 fout << setprecision(8); 300 for (int i=0; i< fgNumPar; i++)325 for (int i=0; i<kNumPar; i++) 301 326 { 302 327 fout << " " << setw(6) << GetVarName(i) << " "; … … 684 709 { 685 710 if (n<0) 686 n = fgNumPar;711 n = kNumPar; 687 712 688 713 Int_t ierflg = 0; -
trunk/MagicSoft/Mars/mpointing/MPointing.h
r8593 r8725 4 4 #ifndef ROOT_TArrayD 5 5 #include <TArrayD.h> 6 #endif 7 8 #ifndef ROOT_TVector2 9 #include <TVector2.h> 6 10 #endif 7 11 … … 19 23 //#include "coord.h" 20 24 //#else 21 #include <TVector2.h>22 25 class AltAz : public TVector2 23 26 { … … 51 54 { 52 55 private: 53 static const Int_t fgNumPar; 56 enum { 57 kIA, // [rad] Index Error in Elevation 58 kIE, // [rad] Index Error in Azimuth 59 kFLOP, // [rad] Vertical Sag 60 kAN, // [rad] Az-El Nonperpendicularity 61 kAW, // [rad] Left-Right Collimation Error 62 kNPAE, // [rad] Azimuth Axis Misalignment (N-S) 63 kCA, // [rad] Azimuth Axis Misalignment (E-W) 64 kTF, // [rad] Tube fluxture (sin) 65 kTX, // [rad] Tube fluxture (tan) 66 kECES, // [rad] Nasmyth rotator displacement, horizontal 67 kACES, // [rad] Nasmyth rotator displacement, vertical 68 kECEC, // [rad] Alt/Az Coude Displacement (N-S) 69 kACEC, // [rad] Alt/Az Coude Displacement (E-W) 70 kNRX, // [rad] Elevation Centering Error (sin) 71 kNRY, // [rad] Azimuth Centering Error (sin) 72 kCRX, // [rad] Elevation Centering Error (cos) 73 kCRY, // [rad] Azimuth Centering Error (cos) 74 kMAGIC1, // [rad] Magic Term (what is it?) 75 kMAGIC2, // [rad] Magic Term (what is it?) 76 kPX, // [rad] Starguider calibration fixed offset x 77 kPY, // [rad] Starguider calibration fixed offset y 78 kDX, // [rad] Starguider calibration additional offset dx 79 kDY, // [rad] Starguider calibration additional offset dy 80 kNumPar // Number of elements 81 }; 82 54 83 55 84 Double_t fIe ; // [rad] Index Error in Elevation … … 73 102 Double_t fMagic2; // [rad] Magic Term (what is it?) 74 103 104 Double_t fPx; // [rad] Starguider calibration fixed offset x 105 Double_t fPy; // [rad] Starguider calibration fixed offset y 106 Double_t fDx; // [rad] Starguider calibration additional offset dx 107 Double_t fDy; // [rad] Starguider calibration additional offset dy 108 75 109 Double_t **fCoeff; //! 76 110 TString *fNames; //! … … 83 117 void Clear(Option_t *o="") 84 118 { 85 for (int i=0; i< fgNumPar; i++)119 for (int i=0; i<kNumPar; i++) 86 120 { 87 121 *fCoeff[i] = 0; 88 fError[i] = 0;122 fError[i] = -1; 89 123 } 90 124 } … … 94 128 95 129 public: 96 MPointing() { fError.Set(fgNumPar);Init(); Clear(); }97 MPointing(const char *name) { fError.Set(fgNumPar);Init(); Clear(); Load(name); }130 MPointing() : fError(kNumPar) { Init(); Clear(); } 131 MPointing(const char *name) : fError(kNumPar) { Init(); Clear(); Load(name); } 98 132 virtual ~MPointing() { delete [] fNames; delete [] fCoeff; delete [] fDescr; } 99 133 … … 117 151 ZdAz operator()(const ZdAz &zdaz, void (*fcn)(ZdAz &zdaz, Double_t *par)) const 118 152 { 119 Double_t par[ fgNumPar];153 Double_t par[kNumPar]; 120 154 GetParameters(par); 121 155 ZdAz za = zdaz; … … 126 160 AltAz operator()(const AltAz &aaz, void (*fcn)(AltAz &aaz, Double_t *par)) const 127 161 { 128 Double_t par[ fgNumPar];162 Double_t par[kNumPar]; 129 163 GetParameters(par); 130 164 AltAz aa = aaz; … … 135 169 TVector3 operator()(const TVector3 &aaz, void (*fcn)(TVector3 &aaz, Double_t *par)) const 136 170 { 137 Double_t par[ fgNumPar];171 Double_t par[kNumPar]; 138 172 GetParameters(par); 139 173 TVector3 v = aaz; … … 174 208 } 175 209 176 void SetParameters(const Double_t *par, Int_t n= fgNumPar);177 void GetParameters(Double_t *par, Int_t n= fgNumPar) const;210 void SetParameters(const Double_t *par, Int_t n=kNumPar); 211 void GetParameters(Double_t *par, Int_t n=kNumPar) const; 178 212 179 213 void SetParameters(const TArrayD &par) … … 183 217 void GetParameters(TArrayD &par) const 184 218 { 185 par.Set( fgNumPar);219 par.Set(kNumPar); 186 220 GetParameters(par.GetArray()); 187 221 } … … 189 223 { 190 224 par = fError; 191 for (int i=0; i< fgNumPar; i++)225 for (int i=0; i<kNumPar; i++) 192 226 par[i] *= TMath::RadToDeg(); 193 227 } … … 217 251 */ 218 252 219 static const Int_t GetNumPar() { return fgNumPar; } 220 221 ClassDef(MPointing, 1) // Pointing Model for MAGIC 253 TVector2 GetDxy() const { return TVector2(fDx, fDy)*TMath::RadToDeg(); } 254 255 Double_t GetPx() const { return fPx*TMath::RadToDeg(); } 256 Double_t GetPy() const { return fPy*TMath::RadToDeg(); } 257 258 Bool_t IsPxValid() const { return fError[kPX]>0; } 259 Bool_t IsPyValid() const { return fError[kPY]>0; } 260 261 static const Int_t GetNumPar() { return kNumPar; } 262 263 ClassDef(MPointing, 2) // Pointing Model for MAGIC 222 264 }; 223 265 -
trunk/MagicSoft/Mars/mpointing/MPointingDev.h
r7600 r8725 15 15 Double_t fDevAz; // [deg] Pointing offset azimuth as calculated from starguider dat 16 16 17 Double_t fDevX; // [ mm]18 Double_t fDevY; // [ mm]17 Double_t fDevX; // [deg] Pointing offset in x 18 Double_t fDevY; // [deg] Pointing offset in y 19 19 20 20 public: … … 27 27 void SetDevZdAz(Double_t devzd, Double_t devaz) { fDevZd=devzd; fDevAz=devaz; } 28 28 void SetDevXY(Double_t dx, Double_t dy) { fDevX=dx; fDevY=dy; } 29 void SetDevXY(const TVector2 &d) { fDevX=d.X(); fDevY=d.Y(); } 29 30 30 31 Double_t GetDevZd() const { return fDevZd; } -
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
r8719 r8725 388 388 389 389 if (fDeviation) 390 v -= fDeviation->GetDevXY() ;390 v -= fDeviation->GetDevXY()/fGeom->GetConvMm2Deg(); 391 391 392 392 SetSrcPos(v);
Note:
See TracChangeset
for help on using the changeset viewer.