Changeset 8140
- Timestamp:
- 10/20/06 19:26:01 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8139 r8140 18 18 19 19 -*-*- END OF LINE -*-*- 20 2006/10/20 Thomas Bretz 21 22 * datacenter/macros/plotoptical.C: 23 - improved with more interesting values 24 25 * mastro/MAstro.h: 26 - added new constant for conversion from and into hours 27 28 * mbadpixels/MBadPixelsIntensityCam.[h,cc], 29 mcalib/MCalibrationIntensityCam.[h,cc]: 30 - added a RemoveOldCam member function 31 - commented out unused GetCam functions 32 33 * mcalib/MCalibCalcFromPast.cc: 34 - removed some obsolete output in the case FindCreateObj fains 35 - if a new cam is added to the intensity cam list the old 36 cam is deleted now which fixes the bigges memory leak in callisto 37 38 39 20 40 2006/10/20 Daniela Dorner 21 41 -
trunk/MagicSoft/Mars/NEWS
r8136 r8140 7 7 - database: For sequences there is now also the stoptime available on the 8 8 websites. 9 10 - database: Order-by is now working also on printtable.php and when11 group-by is chosen.12 9 13 10 - database: Removed ManuallyChanged flag from sequence-info websites, … … 33 30 over all possible set of weights. This also gives correct numbers 34 31 for the lo-gains which were totally wrong before. 32 33 - callisto: drastically reduced memory consumption by not storing 34 all intermediate calibration results in memory anymore (we might 35 write them into a file in the future) 35 36 36 37 - ganymed: To get a nice Theta-Sq plot (instead of the all-information -
trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C
r8134 r8140 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1. 1 2006-10-19 18:45:51tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.2 2006-10-20 18:26:00 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 101 101 102 102 TString fCondition; 103 Bool_t fGroupBy; 103 104 104 105 void PlotTable(TSQLResult &res, TString name, Float_t fmin, Float_t fmax, Float_t resolution) … … 298 299 299 300 gz.DrawClone("AP"); 301 300 302 if (gz0.GetN()>0) 301 303 gz0.DrawClone("P"); … … 306 308 public: 307 309 MPlot(MSQLMagic &server) : fServer(server), fDataSet(NULL), 308 fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1) 310 fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1), fGroupBy(kFALSE) 309 311 { 310 312 } … … 335 337 { fCondition = cond; } 336 338 void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; } 339 void EnableGroupBy(Bool_t b=kTRUE) { fGroupBy=b; } 337 340 338 341 Int_t QueryKeyOfSource(TString src) … … 343 346 Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0) 344 347 { 345 TString named = "OpticalData.fTime stamp";346 TString named2 = "fSkyLevel";348 TString named = "OpticalData.fTimeStamp"; 349 TString named2 = fGroupBy ? "AVG(fZenithDistance)" : "fZenithDistance"; 347 350 TString namev = value; 348 351 TString join = "fSequenceFirst"; … … 355 358 356 359 TString query; 357 query = Form("select %s, %s, %s ", valued.Data(), named2.Data(), value v.Data());360 query = Form("select %s, %s, %s ", valued.Data(), named2.Data(), value); 358 361 query += Form("from %s ", tabled.Data()); 359 362 360 const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull(); 361 362 if (!fDataSet && !interval && tabled=="Star") 363 { 364 if (!query.Contains("Star.fSequenceFirst")) 365 query += "left join Star on Sequences.fSequenceFirst=Star.fSequenceFirst "; 366 query += "where Star.fEffOnTime>300 "; 367 } 368 369 if (interval) 370 { 371 query += query.Contains(" where ") ? "and " : "where "; 372 query += Form("fRunStart between '%s' and '%s' ", 373 fRequestFrom.Data(), fRequestTo.Data()); 363 //const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull(); 364 365 if (TString(value).Contains("Object.")) 366 { 367 query += "left join Object on Object.fObjectKEY=OpticalData.fObjectKEY "; 374 368 } 375 369 … … 381 375 } 382 376 383 query += "order by fTimestamp"; 377 if (fGroupBy) 378 query += " GROUP BY fTimeStamp "; 379 380 query += "order by fTimeStamp"; 384 381 385 382 TSQLResult *res = fServer.Query(query); … … 421 418 plot.SetDescription("Aperture Radius;R_{A}", "ApRad"); 422 419 plot.Plot("OpticalData.fApertureRadius", 0, 10, 1); 423 420 /* 424 421 plot.SetDescription("Instrumental Magnitude;M_{I}\\cdot s^{-1}", "InstMag/s"); 425 422 plot.Plot("OpticalData.fInstrumentalMag/OpticalData.fExposure", 0, 0.2, 0.005); … … 433 430 plot.SetDescription("Instrumental Magnitude Error;\\sigma_{M}", "MagErr"); 434 431 plot.Plot("OpticalData.fInstrumentalMagErr", 0, 1, 0.01); 432 */ 433 plot.SetDescription("m_{1};m_{1}", "M1"); 434 plot.Plot("OpticalData.fInstrumentalMag+2.5*log10(OpticalData.fExposure)", 10, 35, 0.2); 435 436 cond += " and Object.fObjectName not like '%/BL' and not IsNull(Object.fMagnitude) "; 437 plot.SetCondition(cond); 438 439 TString ext("3080/25.0*pow(10, (OpticalData.fInstrumentalMag+2.5*log10(OpticalData.fExposure)-Object.fMagnitude)/-2.5)"); 440 ext += "+0.0028*fZenithDistance-0.08"; 441 /* 442 plot.SetDescription("m_{1}-m_{true} (Extinction per Object);m_{1}-m_{true}", "ExtObj"); 443 plot.Plot(ext, 0.5, 1.2, 0.01); 444 */ 445 446 plot.EnableGroupBy(); 447 plot.SetDescription("m_{1}-m_{true} (Extinction per Image);m_{1}-m_{true}", "ExtImg"); 448 plot.Plot(Form("AVG(%s)", ext.Data()), 0.05, 1.2, 0.01); 449 450 plot.SetDescription("Error m_{1}-m_{true} (Extinction per Image);ERR m_{1}-m_{true}", "ExtImgErr"); 451 plot.Plot(Form("STD(%s)", ext.Data()), 0, 0.3, 0.005); 452 453 plot.SetDescription("m_{1}-m_{true} (Extinction per Hour);m_{1}-m_{true}", "ExtHour"); 454 plot.Plot(Form("AVG(%s), date_format(fTimeStamp, '%%Y-%%m-%%d %%H') as fTimeStamp", ext.Data()), 455 0.5, 1.2, 0.01); 456 457 plot.SetDescription("m_{1}-m_{true} (Extinction per Night);m_{1}-m_{true}", "ExtNight"); 458 plot.Plot(Form("AVG(%s), date_format(adddate(fTimeStamp,Interval 12 hour),'%%Y-%%m-%%d') as fTimeStamp", ext.Data()), 459 0.5, 1.2, 0.01); 435 460 } 436 461 -
trunk/MagicSoft/Mars/mastro/MAstro.h
r8066 r8140 28 28 static Double_t Parsec2Lighyear() { return 3.2615644; } 29 29 30 static Double_t DegToHor() { return 15; } 31 static Double_t HorToDeg() { return 1./15; } 32 33 static Double_t RadToHor() { return 15/TMath::TwoPi(); } 34 static Double_t HorToRad() { return TMath::TwoPi()/15; } 30 35 31 36 // Angle/Time conversion functions -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.cc
r7804 r8140 234 234 return static_cast<MBadPixelsCam*>(i==-1 ? fCams->Last() : fCams->At(i)); 235 235 } 236 236 /* 237 237 // -------------------------------------------------------------------------- 238 238 // … … 252 252 return static_cast<MBadPixelsCam*>(fCams->FindObject(name)); 253 253 } 254 254 */ 255 255 // -------------------------------------------------------------------------- 256 256 // -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.h
r7189 r8140 15 15 #endif 16 16 17 class TOrdCollection; 17 #ifndef ROOT_TOrdCollection 18 #include <TOrdCollection.h> 19 #endif 20 18 21 class TGraph; 19 22 class MHCamera; 23 20 24 class MBadPixelsIntensityCam : public MParContainer, public MCamEvent 21 25 { … … 42 46 MBadPixelsCam *GetCam ( Int_t i=-1); 43 47 const MBadPixelsCam *GetCam ( Int_t i=-1) const; 44 48 /* 45 49 MBadPixelsCam *GetCam ( const char *name ); 46 50 const MBadPixelsCam *GetCam ( const char *name ) const; 51 */ 52 53 // The "DeleteOldCam" function must not delete the first entry in 54 // the array because it is a special cam from the MParList. (see above) 55 void DeleteOldCam(MBadPixelsCam *cam) {/* if (fCams->IndexOf(cam)>0) delete fCams->Remove(cam);*/ } 47 56 48 57 MBadPixelsPix &operator[] ( Int_t i ); -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
r7829 r8140 167 167 fIntensConst = (MCalibrationIntensityConstCam*) pList->FindCreateObj("MCalibrationIntensityConstCam"); 168 168 169 if (!fIntensCharge) 170 return kFALSE; 171 if (!fIntensQE) 172 return kFALSE; 173 if (!fIntensConst) 174 return kFALSE; 175 176 169 177 MCalibrationChargeCam *chargeinit = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam"); 170 178 MCalibrationQECam *qeinit = (MCalibrationQECam*) pList->FindObject("MCalibrationQECam"); … … 190 198 *fLog << inf << "Found MHCalibrationChargeCam ... " << flush; 191 199 192 if (!fIntensCharge)193 {194 *fLog << err << "Could not find nor create MCalibrationIntensityChargeCam abort... " << endl;195 return kFALSE;196 }197 198 if (!fIntensQE)199 {200 *fLog << err << "Could not find nor create MCalibrationIntensityQECam abort... " << endl;201 return kFALSE;202 }203 204 200 if (!fChargeCalc) 205 201 { … … 388 384 const Int_t runnumber = fRunHeader->GetRunNumber(); 389 385 386 // The "DeleteOldCam" function must not delete the first entry in 387 // the array because it is a special cam from the MParList. (see above) 388 390 389 if (fIntensBad) 391 { 390 { 391 *fLog << "MBadPixelsCam..."; 392 MBadPixelsCam *cold = fIntensBad->GetCam(); 392 393 fIntensBad->AddToList(Form("MBadPixelsCam%04d",fNumCam),*fGeom); 393 *fLog << "MBadPixelsCam..."; 394 } 394 if (cold) 395 fIntensBad->DeleteOldCam(cold); 396 } 395 397 396 398 if (fIntensCharge) 397 { 399 { 400 *fLog << "MCalibrationChargeCam..."; 398 401 MCalibrationChargeCam *cold = (MCalibrationChargeCam*)fIntensCharge->GetCam(); 399 402 … … 404 407 405 408 if (cold) 409 { 406 410 cnew->MergeHiLoConversionFactors(*cold); 407 408 *fLog << "MCalibrationChargeCam..."; 409 } 411 fIntensCharge->DeleteOldCam(cold); 412 } 413 } 414 410 415 if (fIntensQE) 411 { 416 { 417 *fLog << "MCalibrationQECam..."; 418 MCalibrationCam *cold = fIntensQE->GetCam(); 412 419 fIntensQE->AddToList(Form("MCalibrationQECam%04d",fNumCam),*fGeom); 413 420 fIntensQE->GetCam()->SetRunNumber(runnumber); 414 *fLog << "MCalibrationQECam..."; 415 } 421 if (cold) 422 fIntensQE->DeleteOldCam(cold); 423 } 416 424 if (fIntensBlind) 417 { 425 { 426 *fLog << "MCalibrationBlindCam..."; 427 MCalibrationCam *cold = fIntensBlind->GetCam(); 418 428 fIntensBlind->AddToList(Form("MCalibrationBlindCam%04d",fNumCam),*fGeom); 419 429 fIntensBlind->GetCam()->SetRunNumber(runnumber); 420 *fLog << "MCalibrationBlindCam..."; 421 } 430 if (cold) 431 fIntensBlind->DeleteOldCam(cold); 432 } 422 433 423 434 *fLog << endl; -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc
r7804 r8140 289 289 // Get camera with name 'name' 290 290 // 291 /* 291 292 MCalibrationCam *MCalibrationIntensityCam::GetCam(const char *name) 292 293 { … … 302 303 return static_cast<MCalibrationCam*>(fCams->FindObject(name)); 303 304 } 304 305 */ 305 306 // -------------------------------------------------------------------------- 306 307 // -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.h
r7189 r8140 42 42 void AddHist(const MHCalibrationCam *cam); 43 43 44 Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const; 44 Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const; 45 45 46 46 const Int_t GetSize() const { return fCams->GetSize(); } … … 57 57 const MBadPixelsPix &GetAverageBadSector ( UInt_t i ) const { return GetCam()->GetAverageBadSector(i); } 58 58 59 MCalibrationCam *GetCam ( Int_t i=-1) { 60 61 const MCalibrationCam *GetCam ( Int_t i =-1) const {62 59 MCalibrationCam *GetCam ( Int_t i/*=-1*/) { 60 return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); } 61 const MCalibrationCam *GetCam ( Int_t i/*=-1*/) const { 62 return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); } 63 63 64 MCalibrationCam *GetCam ( const char *name ); 65 const MCalibrationCam *GetCam ( const char *name ) const; 64 MCalibrationCam *GetCam() { return static_cast<MCalibrationCam*>(fCams->Last()); } 65 const MCalibrationCam *GetCam() const { return static_cast<MCalibrationCam*>(fCams->Last()); } 66 67 // MCalibrationCam *GetCam ( const char *name ); 68 // const MCalibrationCam *GetCam ( const char *name ) const; 69 70 // The "DeleteOldCam" function must not delete the first entry in 71 // the array because it is a special cam from the MParList. (see above) 72 void DeleteOldCam(MCalibrationCam *cam) { /* if (fCams->IndexOf(cam)>0) delete fCams->Remove(cam);*/ } 66 73 67 74 MHCalibrationCam *GetHist ( Int_t i=-1);
Note:
See TracChangeset
for help on using the changeset viewer.