12 using namespace PlotGOESNS;
23 const std::string bTopStr(
"PlotGOES");
27 FATAL(
"Could not find branch " + bTopStr);
42 else if (str ==
"off")
45 FATAL(
"Unrecognised setting \"" + str +
"\" to <PlotFDFOV>");
60 const int textFont(132);
61 const double textSize(0.06);
62 const bool showTitle(
true);
69 gStyle->SetTitleFont(textFont,
"");
70 gStyle->SetTitleFont(textFont,
"XYZ");
71 gStyle->SetLabelFont(textFont,
"XYZ");
73 const int canvasW(800);
74 const int canvasH(600);
77 const double marginH(0.12);
78 const double marginW((1 - (1 - 2*marginH)*canvasH/canvasW)/2);
79 gStyle->SetPadLeftMargin(marginW);
80 gStyle->SetPadRightMargin(marginW);
81 gStyle->SetPadTopMargin(marginH);
82 gStyle->SetPadBottomMargin(marginH);
87 const int nColours(255);
89 double stops[nStops] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0};
90 double r[nStops] = {1.0, 1.0, 0.9, 0.8, 0.7, 0.6};
91 double g[nStops] = {1.0, 1.0, 0.9, 0.8, 0.7, 0.6};
92 double b[nStops] = {1.0, 1.0, 0.9, 0.8, 0.7, 0.6};
94 TColor::CreateGradientColorTable(nStops, stops, r, g, b, nColours);
101 const double augerEasting(440000.0);
102 const double augerNorthing(6060000.0);
107 unsigned int edgeIDs[nStations] = {
108 1047, 1041, 1051, 979, 985, 1549, 1506, 1483, 1501, 1131,
109 1133, 1145, 1148, 1666, 1668, 1676, 790, 1175, 768, 496,
110 572, 531, 462, 476, 321, 379, 388, 377, 1260, 1247,
111 945, 618, 1314, 615, 787
125 for (
int iSDID(0); iSDID < nStations; ++iSDID) {
126 utl::Point p( sdet.GetStation(edgeIDs[iSDID]).GetPosition() );
129 const double utmX((utmP.GetEasting() - augerEasting)/
utl::km);
130 const double utmY((utmP.GetNorthing() - augerNorthing)/
utl::km);
137 sdArray.SetPoint(sdArray.GetN(), utmX, utmY);
139 sdArray.SetPoint(sdArray.GetN(), pair[0], pair[1]);
142 std::vector<TPolyLine> telFOVs;
143 for (
auto itEye( fdet.EyesBegin() ); itEye != fdet.EyesEnd(); ++itEye) {
145 if (itEye->GetId() > 4)
155 bool usePrevPoint(
false);
158 for (
auto itTel( itEye->TelescopesBegin() ); itTel != itEye->TelescopesEnd(); ++itTel) {
160 const utl::Point& telBase( itTel->GetPosition() );
196 for (
int i(0); i < v; ++i) {
197 xPts[i] = (xPts[i] - augerEasting)/
utl::km;
198 yPts[i] = (yPts[i] - augerNorthing)/
utl::km;
201 telFOVs.emplace_back(v, xPts, yPts);
213 const double pixW( goesdb.GetPixelWidthEasting() );
214 const double pixH( goesdb.GetPixelWidthNorthing() );
215 const unsigned int nPix( goesdb.GetNumberOfPixels() );
224 pixMap = goesdb.GetAllCloudProbabilities();
230 for (
unsigned int iPix(0); iPix < nPix; ++iPix) {
234 prob = pixMap.at(iPix);
239 catch (std::out_of_range&) {
245 const double pixX( pix.GetEasting() );
246 const double pixY( pix.GetNorthing() );
267 for (
int i(0); i < v; ++i) {
268 xPts[i] = (xPts[i] - augerEasting)/
utl::km;
269 yPts[i] = (yPts[i] - augerNorthing)/
utl::km;
273 hist.SetBinContent(hist.AddBin(v, xPts, yPts), prob);
277 std::ostringstream status;
278 status <<
"Missing pixel data at " << detTime;
284 hist.AddBin(-10, -10, -10, -10);
285 hist.AddBin(85, 85, 85, 85);
289 TCanvas canv(
"canv",
"", canvasW, canvasH);
290 canv.SetCanvasSize(canvasW, canvasH);
293 std::ostringstream conv;
295 hist.SetTitle( conv.str().c_str() );
298 hist.SetStats(
false);
299 hist.SetTitleSize(1.1*textSize);
304 TAxis* histX( hist.GetXaxis() );
305 TAxis* histY( hist.GetYaxis() );
306 TAxis* histZ( hist.GetZaxis() );
308 histX->SetTitle(
"Relative easting (km)");
309 histX->SetTitleOffset(0.95);
310 histX->CenterTitle();
311 histX->SetTitleSize(textSize);
312 histX->SetLabelSize(textSize);
313 histX->SetRangeUser(-5, 75);
315 histY->SetTitle(
"Relative northing (km)");
316 histY->SetTitleOffset(0.95);
317 histY->CenterTitle();
318 histY->SetTitleSize(textSize);
319 histY->SetLabelSize(textSize);
320 histY->SetRangeUser(0, 80);
322 histZ->SetTitle(
"Cloud probability");
323 histZ->SetTitleOffset(0.95);
324 histZ->CenterTitle();
325 histZ->SetTitleSize(textSize);
326 histZ->SetLabelSize(textSize);
327 histZ->RotateTitle();
328 histZ->SetRangeUser(0, 1);
329 histZ->SetNdivisions(1005);
336 sdArray.SetLineColor(1);
337 sdArray.SetLineWidth(2);
338 sdArray.Draw(
"same l");
341 for (
auto itFOV( telFOVs.begin() ); itFOV != telFOVs.end(); ++itFOV) {
342 itFOV->SetLineColor(1);
343 itFOV->SetLineStyle(2);
349 std::ostringstream conv;
350 conv << detTime.GetGPSSecond() <<
"." << *itF;
351 canv.SaveAs( conv.str().c_str() );
utl::TimeInterval fTimeStep
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
Report success to RunController.
Detector description interface for GOES cloud data.
Class to hold and convert a point in geodetic coordinates.
#define FATAL(message)
Macro for logging fatal messages.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
double GetNorthing() const
Get the northing.
Detector description interface for FDetector-related data.
A TimeStamp holds GPS second and nanosecond for some event.
const atm::Atmosphere & GetAtmosphere() const
utl::TimeStamp fTimeStart
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
Exception to use in case requested data not found in the database with detailed printout.
Reference ellipsoids for UTM transformations.
const GOESDB & GetGOESDB() const
low-level interface to the cloud information from the GOES database
Top of the hierarchy of the detector description interface.
const sdet::SDetector & GetSDetector() const
double GetEasting() const
Get the easting.
static const ReferenceEllipsoid & GetWGS84()
Get the auger standard ellipsoid: wgs84.
const fdet::FDetector & GetFDetector() const
std::map< unsigned int, double > ProbabilityMap
std::vector< std::string > fPlotFormats
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
ResultFlag
Flag returned by module methods to the RunController.
utl::TimeStamp fTimeFinish
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
Detector description interface for SDetector-related data.
Report failure to RunController, causing RunController to terminate execution.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)