| 1 |
|
|---|
| 2 | Int_t PlotTemperature1()
|
|---|
| 3 | {
|
|---|
| 4 | MDirIter Next("/fact/aux/2014", "20[0-9][0-9][0-1][0-9][0-3][0-9].TEMPERATURE_DATA.fits", -1);
|
|---|
| 5 | TGraph g;
|
|---|
| 6 | g.SetName("ContainerTemp");
|
|---|
| 7 | while (1)
|
|---|
| 8 | {
|
|---|
| 9 | TString name = Next();
|
|---|
| 10 | if (name.IsNull())
|
|---|
| 11 | break;
|
|---|
| 12 |
|
|---|
| 13 | fits file(name.Data());
|
|---|
| 14 | if (!file)
|
|---|
| 15 | {
|
|---|
| 16 | cerr << name << ": " << gSystem->GetError() << endl;
|
|---|
| 17 | return -2;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | Double_t time;
|
|---|
| 22 | Float_t temp;
|
|---|
| 23 |
|
|---|
| 24 | if (!file.SetPtrAddress("Time", &time))
|
|---|
| 25 | return -1;
|
|---|
| 26 | if (!file.SetPtrAddress("T", &temp))
|
|---|
| 27 | return -1;
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | while (file.GetNextRow())
|
|---|
| 31 | //if (Contains(vec, time))
|
|---|
| 32 | g.SetPoint(g.GetN(), time+40587, temp);
|
|---|
| 33 | // g.SetPoint(g.GetN(), time*24*3600, temp);
|
|---|
| 34 |
|
|---|
| 35 | }
|
|---|
| 36 | g.SetMinimum(5);
|
|---|
| 37 | g.SetMaximum(35);
|
|---|
| 38 | g.SetMarkerStyle(kFullDotMedium);
|
|---|
| 39 | g.SetMarkerColor(kRed);
|
|---|
| 40 | //g.GetXaxis()->SetTimeDisplay(true);
|
|---|
| 41 | //g.GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT");
|
|---|
| 42 | g.GetXaxis()->SetLabelSize(0.04);
|
|---|
| 43 | g.GetYaxis()->SetLabelSize(0.05);
|
|---|
| 44 | g.GetYaxis()->SetTitle("TEMP");
|
|---|
| 45 | g.GetYaxis()->SetTitleOffset(0.6);
|
|---|
| 46 | g.GetYaxis()->SetTitleSize(0.05);
|
|---|
| 47 | g.DrawClone("AP");
|
|---|
| 48 |
|
|---|
| 49 | return 0;
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | int qual()
|
|---|
| 53 | {
|
|---|
| 54 | // To get correct dates in the histogram you have to add
|
|---|
| 55 | // the MJDREF offset (should be 40587) and 9131.
|
|---|
| 56 |
|
|---|
| 57 | TCanvas *c = new TCanvas("quality", "containertemp", 1280, 960);
|
|---|
| 58 | gPad->SetGrid();
|
|---|
| 59 | gPad->SetTopMargin(0.01);
|
|---|
| 60 | gPad->SetRightMargin(0.01);
|
|---|
| 61 | gPad->SetLeftMargin(0.07);
|
|---|
| 62 | cout << PlotTemperature1() << endl;
|
|---|
| 63 | TLine line;
|
|---|
| 64 | line.SetLineStyle(2);
|
|---|
| 65 | line.SetLineWidth(2);
|
|---|
| 66 | line.DrawLine(MAstro::Ymd2Mjd(2014,4,22), 5, MAstro::Ymd2Mjd(2014,4,22), 35);
|
|---|
| 67 | line.DrawLine(MAstro::Ymd2Mjd(2014,5,24), 5, MAstro::Ymd2Mjd(2014,5,24), 35);
|
|---|
| 68 | line.SetLineStyle(1);
|
|---|
| 69 | line.SetLineColor(kGray+2);
|
|---|
| 70 | line.DrawLine(MAstro::Ymd2Mjd(2014,1,1), 5, MAstro::Ymd2Mjd(2014,1,1), 35);
|
|---|
| 71 | line.DrawLine(MAstro::Ymd2Mjd(2014,2,1), 5, MAstro::Ymd2Mjd(2014,2,1), 35);
|
|---|
| 72 | line.DrawLine(MAstro::Ymd2Mjd(2014,3,1), 5, MAstro::Ymd2Mjd(2014,3,1), 35);
|
|---|
| 73 | line.DrawLine(MAstro::Ymd2Mjd(2014,4,1), 5, MAstro::Ymd2Mjd(2014,4,1), 35);
|
|---|
| 74 | line.DrawLine(MAstro::Ymd2Mjd(2014,5,1), 5, MAstro::Ymd2Mjd(2014,5,1), 35);
|
|---|
| 75 |
|
|---|
| 76 | //c->SaveAs(Form("%s/%04d%02d%02d.png", outpath, y, m, d));
|
|---|
| 77 |
|
|---|
| 78 | return 0;
|
|---|
| 79 | }
|
|---|