Changeset 8934 for trunk/MagicSoft/Mars
- Timestamp:
- 06/10/08 16:50:49 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/fillstar.C
r8931 r8934 183 183 return 2; 184 184 } 185 186 Double_t max = TMath::MaxElement(g->GetN(), g->GetY()); 187 TString maxhum = Form("%5.1f", max); 185 TString maxhum = Form("%5.1f", TMath::MaxElement(g->GetN(), g->GetY())); 186 TString avghum = Form("%5.1f", g->GetMean(2)); 188 187 189 188 g = (TGraph*)arr.FindObjectInCanvas("Temperature", "TGraph", "MHWeather"); … … 193 192 return 2; 194 193 } 195 196 Double_t temp = g->GetMean(2); 197 TString avgtemp = Form("%5.1f", temp); 194 TString avgtemp = Form("%5.1f", g->GetMean(2)); 198 195 199 196 g = (TGraph*)arr.FindObjectInCanvas("WindSpeed", "TGraph", "MHWeather"); … … 203 200 return 2; 204 201 } 205 206 Double_t wind = g->GetMean(2); 207 TString avgwind = Form("%5.1f", wind); 202 TString avgwind = Form("%5.1f", g->GetMean(2)); 203 204 g = (TGraph*)arr.FindObjectInCanvas("Cloudiness", "TGraph", "MHWeather"); 205 if (!g) 206 cout << "WARNING - Reading of Cloudiness failed." << endl; 207 TString avgclouds = g ? Form("%5.1f", g->GetMean(2)) : 0; 208 TString rmsclouds = g ? Form("%5.1f", g->GetRMS(2)) : 0; 209 210 g = (TGraph*)arr.FindObjectInCanvas("TempSky", "TGraph", "MHWeather"); 211 if (!g) 212 cout << "WARNING - Reading of TempSky failed." << endl; 213 TString avgsky = g ? Form("%5.1f", g->GetMean(2)+200) : 0; 208 214 209 215 210 216 g = (TGraph*)arr.FindObjectInCanvas("NumStars", "TGraph", "MHPointing"); 211 217 if (!g) 212 {213 218 cout << "WARNING - Reading of NumStars failed." << endl; 214 // return 2;215 }216 219 217 220 Double_t numstarmed = g ? TMath::Median(g->GetN(), g->GetY()) : -1; … … 227 230 } 228 231 229 Double_t numcormed = g ? TMath::Median(g->GetN(), g->GetY()) : -1; 230 TString numcorsmed = Form("%5.1f", numcormed); 231 Double_t numcorrms = g ? g->GetRMS(2) : -1; 232 TString numcorsrms = Form("%5.1f", numcorrms); 232 TString numcorsmed = Form("%5.1f", g ? TMath::Median(g->GetN(), g->GetY()) : -1); 233 TString numcorsrms = Form("%5.1f", g ? g->GetRMS(2) : -1); 233 234 234 235 g = (TGraph*)arr.FindObjectInCanvas("Brightness", "TGraph", "MHPointing"); … … 239 240 } 240 241 241 Double_t brightnessmed = g ? TMath::Median(g->GetN(), g->GetY()) : -1; 242 TString skybrightnessmed = Form("%5.1f", brightnessmed); 243 Double_t brightnessrms = g ? g->GetRMS(2) : -1; 244 TString skybrightnessrms = Form("%5.1f", brightnessrms); 242 TString skybrightnessmed = Form("%5.1f", g ? TMath::Median(g->GetN(), g->GetY()) : -1); 243 TString skybrightnessrms = Form("%5.1f", g ? g->GetRMS(2) : -1); 245 244 246 245 … … 267 266 cout << " Rate of sparks [Hz] " << sparkrate << endl; 268 267 cout << " Maximum Humidity [%] " << maxhum << endl; 268 cout << " Average Humidity [%] " << avghum << endl; 269 cout << " Average WindSpeed [km/h] " << avgwind << endl; 269 270 cout << " Average Temp [°C] " << avgtemp << endl; 270 cout << " Average WindSpeed [km/h] " << avgwind << endl; 271 cout << " Number of Stars " << numstarsmed << " +/- " << numstarsrms << endl; 272 cout << " Number of cor. Stars " << numcormed << " +/- " << numcorrms << endl; 273 cout << " Skybrightness " << skybrightnessmed << " +/- " << skybrightnessrms << endl; 271 cout << " Average Sky Temp [K] " << avgsky << endl; 272 cout << " Cloundiness [%] " << avgclouds << " +/- " << rmsclouds << endl; 273 cout << " Number of Stars " << numstarsmed << " +/- " << numstarsrms << endl; 274 cout << " Number of cor. Stars " << numcorsmed << " +/- " << numcorsrms << endl; 275 cout << " Skybrightness " << skybrightnessmed << " +/- " << skybrightnessrms << endl; 274 276 275 277 TString vars = Form(" fMeanNumberIslands=%s," … … 282 284 " fSparkRate=%s," 283 285 " fMaxHumidity=%s," 286 " fAvgHumidity=%s, " 284 287 " fAvgTemperature=%s," 285 288 " fAvgWindSpeed=%s," 289 " fAvgTempSky=%s," 290 " fAvgCloudiness=%s, " 291 " fRmsCloudiness=%s, " 286 292 " fNumStarsMed=%s," 287 293 " fNumStarsRMS=%s," … … 295 301 muonrate.Data(), PSF.Data(), 296 302 datarate, sparkrate.Data(), maxhum.Data(), 297 avgtemp.Data(), avgwind.Data(), 303 avghum.Data(), avgtemp.Data(), avgwind.Data(), 304 avgsky.Data(), avgclouds.Data(), rmsclouds.Data(), 298 305 numstarsmed.Data(), numstarsrms.Data(), 299 306 numcorsmed.Data(), numcorsrms.Data(), -
trunk/MagicSoft/Mars/mhist/MHWeather.cc
r8907 r8934 18 18 ! Author(s): Thomas Bretz, 05/2005 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 520 ! Copyright: MAGIC Software Development, 2000-2008 21 21 ! 22 22 ! … … 27 27 // MHWeather 28 28 // 29 // Display weather data and the corresponding event rate 29 // Display weather and pyrometer data and the corresponding event rate 30 // 31 // Class Version 2: 32 // ---------------- 33 // - fSolarRadiation 34 // + fCloudiness 35 // + fTempSky 36 // + fTempAir 30 37 // 31 38 //////////////////////////////////////////////////////////////////////////// … … 44 51 #include "MTime.h" 45 52 #include "MReportCC.h" 53 #include "MReportPyrometer.h" 46 54 #include "MEventRate.h" 47 55 … … 79 87 // 80 88 MHWeather::MHWeather(const char *name, const char *title) 89 : fReportCC(0), fReportPyro(0), fRate(0) 81 90 { 82 91 fName = name ? name : "MHWeather"; … … 86 95 87 96 fHumidity.SetNameTitle("Humidity", "Humidity"); 88 fTemperature.SetNameTitle("Temperature", "Temperature"); 89 fSolarRadiation.SetNameTitle("SolarRadiation", "Solar Radiation"); 97 fTemperature.SetNameTitle("Temperature", "Temperature (red=weather station, black=pyrometer, blue=sky)"); 90 98 fWindSpeed.SetNameTitle("WindSpeed", "Wind Speed"); 99 91 100 fEventRate.SetNameTitle("EventRate", "Event Rate at CC-REPORT time"); 101 102 fCloudiness.SetNameTitle("Cloudiness", "Cloudiness / Humidity"); 103 fTempAir.SetNameTitle("TempAir", "Air temperature from Pyrometer"); 104 fTempSky.SetNameTitle("TempSky", "Sky temperature from Pyrometer"); 92 105 93 106 InitGraph(fHumidity); 94 107 InitGraph(fTemperature); 95 InitGraph(fSolarRadiation);96 108 InitGraph(fWindSpeed); 109 97 110 InitGraph(fEventRate); 111 112 InitGraph(fCloudiness); 113 InitGraph(fTempAir); 114 InitGraph(fTempSky); 98 115 99 116 fHumidity.SetMarkerColor(kBlue); 100 117 fTemperature.SetMarkerColor(kRed); 118 fTempSky.SetMarkerColor(kBlue); 101 119 } 102 120 … … 108 126 Bool_t MHWeather::SetupFill(const MParList *plist) 109 127 { 110 fReport = (MReportCC*)plist->FindObject("MReportCC"); 111 if (!fReport) 128 // Remark: This is called twice in the star-eventloop! 129 fReportCC = (MReportCC*)plist->FindObject("MReportCC"); 130 if (!fReportCC) 112 131 { 113 132 *fLog << warn << "MReportCC not found... abort." << endl; … … 120 139 return kFALSE; 121 140 } 141 142 fReportPyro = (MReportPyrometer*)plist->FindObject("MReportPyrometer"); 143 if (!fReportPyro) 144 *fLog << warn << "MReportPyrometer not found..." << endl; 122 145 123 146 // Reset Graphs 124 147 ResetGraph(fHumidity); 125 148 ResetGraph(fTemperature); 126 ResetGraph(fSolarRadiation);127 149 ResetGraph(fWindSpeed); 128 150 ResetGraph(fEventRate); 151 ResetGraph(fCloudiness); 152 ResetGraph(fTempAir); 153 ResetGraph(fTempSky); 129 154 130 155 return kTRUE; … … 147 172 const Double_t tm = t->GetAxisTime(); 148 173 149 AddPoint(fTemperature, tm, fReport->GetTemperature()); 150 AddPoint(fHumidity, tm, fReport->GetHumidity()); 151 AddPoint(fSolarRadiation, tm, fReport->GetSolarRadiation()); 152 AddPoint(fWindSpeed, tm, fReport->GetWindSpeed()); 153 AddPoint(fEventRate, tm, fRate->GetRate()); 174 AddPoint(fEventRate, tm, fRate->GetRate()); 175 176 if (TString(t->GetName())=="MTimeCC") 177 { 178 AddPoint(fTemperature, tm, fReportCC->GetTemperature()); 179 AddPoint(fHumidity, tm, fReportCC->GetHumidity()); 180 AddPoint(fWindSpeed, tm, fReportCC->GetWindSpeed()); 181 } 182 183 if (TString(t->GetName())=="MTimePyrometer" && fReportPyro) 184 { 185 AddPoint(fCloudiness, tm, fReportPyro->GetCloudiness()); 186 AddPoint(fTempAir, tm, fReportPyro->GetTempAir()); 187 AddPoint(fTempSky, tm, fReportPyro->GetTempSky()-200); 188 } 154 189 155 190 return kTRUE; … … 204 239 // Draw an axis on the right side of the histogram 205 240 // 206 void MHWeather::DrawRightAxis(const char *title ) const241 void MHWeather::DrawRightAxis(const char *title, Int_t col) const 207 242 { 208 243 TGaxis *axis = new TGaxis(gPad->GetUxmax(), gPad->GetUymin(), 209 244 gPad->GetUxmax(), gPad->GetUymax(), 210 245 0, 1, 510, "+L"); 246 axis->SetBit(TAxis::kRotateTitle); 211 247 axis->SetName("RightAxis"); 212 248 axis->SetTitle(title); 213 axis->SetTitleOffset( 0.9);214 axis->SetTextColor( kRed);249 axis->SetTitleOffset(1.2); 250 axis->SetTextColor(col); 215 251 axis->SetBit(kCanDelete); 216 252 axis->Draw(); … … 236 272 gPad->SetGridx(); 237 273 gPad->SetGridy(); 238 fHumidity.Draw("AP"); 239 fTemperature.Draw("P"); 240 DrawRightAxis("T [\\circ C]"); 274 fTemperature.Draw("AP"); 275 fTempAir.Draw("P"); 276 fTempSky.Draw("P"); 277 DrawRightAxis("T_{sky}-200 [K]", kBlue); 241 278 242 279 pad->cd(2); … … 244 281 gPad->SetGridx(); 245 282 gPad->SetGridy(); 246 fSolarRadiation.Draw("AP"); 283 fHumidity.Draw("AP"); 284 fCloudiness.Draw("P"); 285 DrawRightAxis("Cloudiness [%]"); 247 286 248 287 pad->cd(3); … … 250 289 gPad->SetGridx(); 251 290 gPad->SetGridy(); 252 f EventRate.Draw("AP");291 fWindSpeed.Draw("AP"); 253 292 254 293 pad->cd(4); … … 256 295 gPad->SetGridx(); 257 296 gPad->SetGridy(); 258 f WindSpeed.Draw("AP");297 fEventRate.Draw("AP"); 259 298 } 260 299 … … 267 306 fHumidity.SetMaximum(100); 268 307 } 308 if (fCloudiness.GetN()>0) 309 { 310 fCloudiness.SetMinimum(0); 311 fCloudiness.SetMaximum(100); 312 } 313 269 314 if (fTemperature.GetN()>0) 270 315 { 271 fTemperature.SetMinimum(-25); 272 fTemperature.SetMaximum(45); 316 fTemperature.SetMinimum(-2.5); 317 fTemperature.SetMaximum(27.5); 318 } 319 if (fTempSky.GetN()>0) 320 { 321 fTempSky.SetMinimum(-2.5); 322 fTempSky.SetMaximum(27.5); 273 323 } 274 324 if (fWindSpeed.GetN()>0) 275 325 fWindSpeed.SetMinimum(0); 276 if (fSolarRadiation.GetN()>0)277 fSolarRadiation.SetMinimum(0);278 326 if (fEventRate.GetN()>0) 279 327 fEventRate.SetMinimum(0); 280 328 281 DrawGraph(fHumidity, "H [%]"); 282 DrawGraph(fSolarRadiation, "R [W/m^{2}]"); 283 DrawGraph(fTemperature, "T [\\circ C]"); 284 DrawGraph(fWindSpeed, "km/h"); 285 DrawGraph(fEventRate, "f [Hz]"); 286 287 gPad->cd(1); 288 329 DrawGraph(fHumidity, "Humidity [%]"); 330 DrawGraph(fTemperature, "T [\\circ C]"); 331 DrawGraph(fWindSpeed, "km/h"); 332 DrawGraph(fEventRate, "f [Hz]"); 333 DrawGraph(fCloudiness, "Cloudiness [%]"); 334 DrawGraph(fTempAir, "T [\\circ C]"); 335 DrawGraph(fTempSky, "T_{sky}-200 [K]"); 336 337 TVirtualPad *p = gPad; 338 339 p->cd(1); 289 340 if (gPad) 290 341 { 342 fTemperature.GetHistogram()->GetYaxis()->SetTitleColor(kRed); 343 //fTempSky.GetHistogram()->GetYaxis()->SetTitleColor(kBlue); 344 UpdateRightAxis(fTemperature); // Primary axis 345 } 346 347 p->cd(2); 348 if (gPad) 349 { 291 350 fHumidity.GetHistogram()->GetYaxis()->SetTitleColor(kBlue); 292 UpdateRightAxis(fTemperature); 293 } 294 } 351 fHumidity.GetHistogram()->GetYaxis()->SetTitleOffset(1.2); 352 UpdateRightAxis(fHumidity); // Primary axis 353 } 354 } -
trunk/MagicSoft/Mars/mhist/MHWeather.h
r7035 r8934 10 10 11 11 class MReportCC; 12 class MReportPyrometer; 12 13 class MEventRate; 13 14 … … 15 16 { 16 17 private: 17 TGraph fHumidity; // 18 TGraph fTemperature; // 19 TGraph fWindSpeed; // 20 TGraph fSolarRadiation; // 21 TGraph fEventRate; // 18 TGraph fHumidity; // Humidity from weather station 19 TGraph fTemperature; // Temperature from weather station 20 TGraph fWindSpeed; // Wind Speed from weather station 22 21 23 MReportCC *fReport; //! 24 MEventRate *fRate; //! 22 TGraph fEventRate; // Event rate from event times 23 24 TGraph fCloudiness; // Cloudiness from Pyrometer 25 TGraph fTempAir; // Temperature of the air from Pyrometer 26 TGraph fTempSky; // Temperature of the sky from Pyrometer 27 28 MReportCC *fReportCC; //! CC report with data from weather station 29 MReportPyrometer *fReportPyro; //! Pyrometer report 30 MEventRate *fRate; //! Event rate 25 31 26 32 void ResetGraph(TGraph &g) const; … … 29 35 void DrawGraph(TGraph &g, const char *y=0) const; 30 36 void UpdateRightAxis(TGraph &g) const; 31 void DrawRightAxis(const char *title ) const;37 void DrawRightAxis(const char *title, Int_t col=kBlack) const; 32 38 33 39 public: … … 37 43 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 38 44 45 // If this is needed be aware that it would be called twice in star 46 // Bool_t Finalize() 47 39 48 void Draw(Option_t *opt=""); 40 49 void Paint(Option_t *opt=""); 41 50 42 ClassDef(MHWeather, 1) // Histogram to display weather data51 ClassDef(MHWeather, 2) // Histogram to display weather and pyrometer data 43 52 }; 44 53 -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r8933 r8934 338 338 write.AddTree("Starguider", kFALSE); 339 339 write.AddTree("Pyrometer", kFALSE); 340 writet.AddTree("EffectiveOnTime"); 340 writet.AddContainer("MEffectiveOnTime", "EffectiveOnTime"); 341 writet.AddContainer("MTimeEffectiveOnTime", "EffectiveOnTime"); 341 342 } 342 343 … … 474 475 //filltst.SetNameTab("Test"); 475 476 476 MFillH fillw("MHWeather", "MTimeCC", "FillWeather"); 477 MFillH fillw1("MHWeather", "MTimeCC", "FillWeather"); 478 MFillH fillw2("MHWeather", "MTimePyrometer", "FillPyrometer"); 479 fillw2.SetBit(MFillH::kDoNotDisplay); 477 480 478 481 // instantiate camera histogram containers … … 504 507 { 505 508 // initiate task list 506 tlist.AddToList(&fillw, "CC"); 509 tlist.AddToList(&fillw1, "CC"); 510 tlist.AddToList(&fillw2, "Pyrometer"); 507 511 tlist.AddToList(&fillp1, "Drive"); 508 512 tlist.AddToList(&fillp2, "Starguider"); -
trunk/MagicSoft/Mars/mreport/MReportPyrometer.cc
r8933 r8934 43 43 // is expected. 44 44 // 45 MReportPyrometer::MReportPyrometer() : MReport("PYRO-REPORT" , kFALSE),45 MReportPyrometer::MReportPyrometer() : MReport("PYRO-REPORT"), 46 46 fTempSky(-1), fTempAir(-1), fCloudiness(-1), fLidOpen(kFALSE) 47 47 … … 72 72 73 73 str.Remove(0, len); 74 str = str.Strip(TString::kBoth); 74 75 75 return str .Strip(TString::kBoth).IsNull()? kTRUE : kCONTINUE;76 return str=="OVER" ? kTRUE : kCONTINUE; 76 77 }
Note:
See TracChangeset
for help on using the changeset viewer.