26 #include <QtCore/QFile>
27 #include <QtCore/QStringList>
28 #include <QtCore/QTextStream>
49 return "SgModelEop_JMG_96_hf";
64 ": the file [" + fileName +
"] with a priori data does not exist");
79 if (f.open(QFile::ReadOnly))
90 QStringList l = str.simplified().split(
' ', QString::SkipEmptyParts);
94 ": the file [" + fileName +
"]: cannot guess numbers of arrays from the string: [" +
103 ": the file [" + fileName +
"]: failed to get the array size for UT1, the string: [" +
113 ": the file [" + fileName +
"]: failed to get the array size for PM, the string: [" +
122 ": the file [" + fileName +
"]: allocated " + QString(
"").setNum(
numUt_) +
123 " records for UT1 and " + QString(
"").setNum(
numPm_) +
" records for PM");
129 QStringList l = str.simplified().split(
' ', QString::SkipEmptyParts);
133 ": the file [" + fileName +
"]: cannot guess format of the string: [" +
137 for (
int i=0; i<6; i++)
139 n[i] = l.at(i).toInt(&
isOk);
143 ": the file [" + fileName +
"]: failed to acquire info (n_" + QString(
"").setNum(i) +
144 "), the string: [" + str +
"]");
148 a_c = l.at(6).toDouble(&
isOk);
152 ": the file [" + fileName +
"]: failed to acquire info (a_c), the string: [" + str +
"]");
155 a_s = l.at(7).toDouble(&
isOk);
159 ": the file [" + fileName +
"]: failed to acquire info (a_s), the string: [" + str +
"]");
162 for (
int i=0; i<6; i++)
190 fundArgs[0] = fundArgs[1] = fundArgs[2] = fundArgs[3] = fundArgs[4] = fundArgs[5] = 0.0;
191 dUt1 = dPx = dPy = 0.0;
198 for (
int i=0; i<
numUt_; i++)
202 for (
int j=0; j<6; j++)
203 arg +=
utModel_[i].n_[j]*fundArgs[j];
212 for (
int i=0; i<
numPm_; i++)
216 for (
int j=0; j<6; j++)
217 arg +=
pmModel_[i].n_[j]*fundArgs[j];
249 static const double argsConsts[5][5] =
251 { 0.064, 31.310, 715922.633, 485866.733, 1325.0},
252 {-0.012, -0.577, 1292581.224, 1287099.804, 99.0},
253 { 0.011, -13.257, 295263.137, 335778.877, 1342.0},
254 { 0.019, -6.891, 1105601.328, 1072261.307, 1236.0},
255 { 0.008, 7.455, -482890.539, 450160.280, -5.0}
258 double tc((t -
tEphem)/36525.0);
265 for (
int i=0; i<5; i++)
268 for (
int j=0; j<4; j++)
269 args[i] += argsConsts[i][j]*ts[3-j];
270 args[i] += fmod(argsConsts[i][4]*tc, 1.0)*1296000.0;
271 args[i] = fmod(args[i], 1296000.0)*
SEC2RAD;
289 double diurnv = (1.002737909350795 + 5.9006e-11*ts[1] - 5.9e-15*ts[2]);
292 double gstd = (24110.54841 + 8640184.81266*ts[1] + 0.093104*ts[2] - 6.2e-6*ts[3])/86400.0;
293 gstd = fmod(gstd, 1.0);
294 args[5] = (gstd + diurnv*fract)*2.0*M_PI + M_PI;
302 double sec360(1296000.0);
303 double pi(3.1415926535897932);
304 double twopi(2.0*pi);
305 double arcsec2rad(twopi/sec360);
306 double elc [5] = { 0.064, 31.310, 715922.633, 485866.733, 1325.0};
307 double elpc[5] = {-0.012, -0.577, 1292581.224, 1287099.804, 99.0};
308 double fc [5] = { 0.011, -13.257, 295263.137, 335778.877, 1342.0};
309 double dc [5] = { 0.019, -6.891, 1105601.328, 1072261.307, 1236.0};
310 double omc [5] = { 0.008, 7.455, -482890.539, 450160.280, -5.0};
311 double cent((t -
tEphem)/36525.0);
313 double el, elp, f, d, om, gst;
318 el = elc[0]*cent3 + elc[1]*cent2 + elc[2]*cent + elc[3] + fmod(elc[4]*cent, 1.0)*sec360;
319 el = fmod(el, sec360);
321 elp = elpc[0]*cent3 + elpc[1]*cent2 + elpc[2]*cent + elpc[3] + fmod(elpc[4]*cent, 1.0)*sec360;
322 elp = fmod(elp, sec360);
324 f = fc[0]*cent3 + fc[1]*cent2 + fc[2]*cent + fc[3] + fmod(fc[4]*cent, 1.0)*sec360;
327 d = dc[0]*cent3 + dc[1]*cent2 + dc[2]*cent + dc[3] + fmod(dc[4]*cent, 1.0)*sec360;
330 om = omc[0]*cent3 + omc[1]*cent2 + omc[2]*cent + omc[3] + fmod(omc[4]*cent, 1.0)*sec360;
331 om = fmod(om, sec360);
339 cent = t_0hr/36525.0;
346 double diurnv = (1.002737909350795 + 5.9006e-11*cent - 5.9e-15*cent2);
349 double gstd = (24110.54841 + 8640184.81266*cent + 0.093104*cent2 - 6.2e-6*cent3 )/86400.0;
351 gstd = fmod(gstd, 1.0);
353 gst = (gstd + diurnv*fract)*twopi;
361 for (
int i=0; i<5; i++)
362 args[i] *= arcsec2rad;
const SgMJD tEphem(51544.5)
#define SEC2RAD
radians to arc seconds:
void fundArgs_Old_another_verison(const SgMJD &t, double args[6])
void fundArgs_Old(const SgMJD &, double[6])
virtual void write(LogLevel, quint32, const QString &, bool=false)
bool readFile(const QString &)
void calcCorrections(const SgMJD &, double &dUt1, double &dPx, double &dPy)
static const QString className()