72 const string role = root.attribute(
"role",
"").toStdString();
73 const string name = root.tagName().toStdString();
77 if (name==
"trn:Transport")
81 const QDomElement orig = root.firstChildElement(
"Origin");
82 const QDomElement
time = root.firstChildElement(
"TimeStamp");
83 if (orig.isNull() || time.isNull())
90 Out() <<
Time().
GetAsStr() <<
" ----- " << name <<
" [" << role <<
"] -----" << endl;
92 Out() <<
" " << orig.tagName().toStdString() <<
" = " << orig.text().toStdString() <<
'\n';
102 ofstream fout(
"gcn.stream", ios::app);
103 fout <<
"------------------------------------------------------------------------------\n" <<
fRxData.data() << endl;
105 if (name==
"voe:VOEvent")
108 const QDomElement who = root.firstChildElement(
"Who");
109 const QDomElement what = root.firstChildElement(
"What");
110 const QDomElement when = root.firstChildElement(
"WhereWhen");
116 if (who.isNull() || what.isNull() || when.isNull())
119 const QDomElement date = who.firstChildElement(
"Date");
120 const QDomElement author = who.firstChildElement(
"Author");
121 const QDomElement sname = author.firstChildElement(
"shortName");
122 const QDomElement desc = what.firstChildElement(
"Description");
124 const QDomElement obsdat = when.firstChildElement(
"ObsDataLocation");
125 const QDomElement obsloc = obsdat.firstChildElement(
"ObservationLocation");
126 const QDomElement coord = obsloc.firstChildElement(
"AstroCoords");
128 const QDomElement time = coord.firstChildElement(
"Time").firstChildElement(
"TimeInstant").firstChildElement(
"ISOTime");
129 const QDomElement pos2d = coord.firstChildElement(
"Position2D");
130 const QDomElement name1 = pos2d.firstChildElement(
"Name1");
131 const QDomElement name2 = pos2d.firstChildElement(
"Name2");
132 const QDomElement val2 = pos2d.firstChildElement(
"Value2");
133 const QDomElement c1 = val2.firstChildElement(
"C1");
134 const QDomElement c2 = val2.firstChildElement(
"C2");
135 const QDomElement errad = pos2d.firstChildElement(
"Error2Radius");
137 if (date.isNull() || author.isNull() || sname.isNull() || desc.isNull() ||
138 obsdat.isNull() || obsloc.isNull() || coord.isNull() || time.isNull() ||
139 pos2d.isNull() || name1.isNull() || name2.isNull() || val2.isNull() ||
140 c1.isNull() || c2.isNull() || errad.isNull())
195 const string unit = pos2d.attribute(
"unit").toStdString();
197 const double ra = c1.text().toDouble();
198 const double dec = c2.text().toDouble();
199 const double err = errad.text().toDouble();
201 const string n1 = name1.text().toStdString();
202 const string n2 = name2.text().toStdString();
204 Out() <<
Time(date.text().toStdString()).GetAsStr() <<
" ----- " << sname.text().toStdString() <<
" [" << role <<
"]\n";
205 Out() <<
"[" << desc.text().toStdString() <<
"]\n";
208 Out() <<
" " << setw(5) <<
"TIME" <<
"= " <<
Time(time.text().toStdString()).GetAsStr() <<
'\n';
209 Out() <<
" " << setw(5) << n1 <<
"= " << ra << unit <<
'\n';
210 Out() <<
" " << setw(5) << n2 <<
"= " << dec << unit <<
'\n';
211 Out() <<
" " << setw(5) <<
"ERR" <<
"= " << err << unit <<
'\n';
213 if (n1==
"RA" && n2==
"Dec" && unit==
"deg")
215 const double jd =
Time().
JD();
228 Out() <<
" " << setw(5) <<
"ZD" <<
"= " << pos.
zd <<
"deg\n";
229 Out() <<
" " << setw(5) <<
"Az" <<
"= " << pos.
az <<
"deg\n";
231 Out() <<
" " << setw(5) <<
"MOON" <<
"= " << int(disk*100) <<
"%\n";
232 Out() <<
" " << setw(5) <<
"DIST" <<
"= " << dist <<
"deg\n";
234 if (dist>10 && dist<170 && pos.
zd<80 && sun.
zd>108)
236 Out() <<
" visible ";
249 if (role==
"observation")
259 if (role==
"retraction")
272 Out() <<
Time().
GetAsStr() <<
" ----- " << name <<
" [" << role <<
"] -----" << endl;
EquPosn GetLunarEquCoords(double jd, double precision=0)
Adds some functionality to boost::posix_time::ptime for our needs.
double GetLunarDisk(double jd)
GCN::PaketType_t GetType(const QDomElement &what)
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
HrzPosn GetHrzFromEqu(const EquPosn &equ, const LnLatPosn &obs, double jd)
double GetAngularSeparation(const EquPosn &p1, const EquPosn &p2)
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const
EquPosn GetSolarEquCoords(double jd)