SolarSystemEditor.cpp   SolarSystemEditor.cpp 
skipping to change at line 421 skipping to change at line 421
" CK09K030 2011 01 9.266 3.90156 1.00000 251.413 0.032 1 46.680 8.5 4.0 C/2009 K3 (Beshore) MPC 66205" -> lower precision than the spec, fixed " CK09K030 2011 01 9.266 3.90156 1.00000 251.413 0.032 1 46.680 8.5 4.0 C/2009 K3 (Beshore) MPC 66205" -> lower precision than the spec, fixed
" CK10F040 2010 04 6.109 0.61383 1.00000 120.718 237.294 89.143 13.5 4.0 C/2010 F4 (Machholz) MPC 69906" -> lower precision than the spec, fixed " CK10F040 2010 04 6.109 0.61383 1.00000 120.718 237.294 89.143 13.5 4.0 C/2010 F4 (Machholz) MPC 69906" -> lower precision than the spec, fixed
" CK10M010 2012 02 7.840 2.29869 1.00000 265.318 82.150 78.373 9.0 4.0 C/2010 M1 (Gibbs) MPC 70817" -> lower precision than the spec, fixed " CK10M010 2012 02 7.840 2.29869 1.00000 265.318 82.150 78.373 9.0 4.0 C/2010 M1 (Gibbs) MPC 70817" -> lower precision than the spec, fixed
" CK10R010 2011 11 28.457 6.66247 1.00000 96.009 345.949 1 57.437 6.0 4.0 C/2010 R1 (LINEAR) MPEC 2010-R99" -> lower precision than the spec, fixed " CK10R010 2011 11 28.457 6.66247 1.00000 96.009 345.949 1 57.437 6.0 4.0 C/2010 R1 (LINEAR) MPEC 2010-R99" -> lower precision than the spec, fixed
"0128P b 2007 06 13.8064 3.062504 0.320891 210.3319 214.3583 4.3606 20100723 8.5 4.0 128P/Shoemaker-Holt MPC 51822" -> fragment, fixed "0128P b 2007 06 13.8064 3.062504 0.320891 210.3319 214.3583 4.3606 20100723 8.5 4.0 128P/Shoemaker-Holt MPC 51822" -> fragment, fixed
"0141P d 2010 05 29.7106 0.757809 0.749215 149.3298 246.0849 12.8032 20100723 12.0 12.0 141P/Machholz MPC 59599" -> fragment, fixed "0141P d 2010 05 29.7106 0.757809 0.749215 149.3298 246.0849 12.8032 20100723 12.0 12.0 141P/Machholz MPC 59599" -> fragment, fixed
*/ */
SsoElements SolarSystemEditor::readMpcOneLineCometElements(QString oneLineE lements) SsoElements SolarSystemEditor::readMpcOneLineCometElements(QString oneLineE lements)
{ {
SsoElements result; SsoElements result;
qDebug() << "readMpcOneLineCometElements started..."; // GZ //qDebug() << "readMpcOneLineCometElements started..."; // GZ
QRegExp mpcParser("^\\s*(\\d{4})?([A-Z])((?:\\w{6}|\\s{6})?[0a-zA-Z] )?\\s+(\\d{4})\\s+(\\d{2})\\s+(\\d{1,2}\\.\\d{3,4})\\s+(\\d{1,2}\\.\\d{5,6} )\\s+(\\d\\.\\d{5,6})\\s+(\\d{1,3}\\.\\d{3,4})\\s+(\\d{1,3}\\.\\d{3,4})\\s+ (\\d{1,3}\\.\\d{3,4})\\s+(?:(\\d{4})(\\d\\d)(\\d\\d))?\\s+(\\-?\\d{1,2}\\.\ \d)\\s+(\\d{1,2}\\.\\d)\\s+(\\S.{1,54}\\S)(?:\\s+(\\S.*))?$");// QRegExp mpcParser("^\\s*(\\d{4})?([A-Z])((?:\\w{6}|\\s{6})?[0a-zA-Z] )?\\s+(\\d{4})\\s+(\\d{2})\\s+(\\d{1,2}\\.\\d{3,4})\\s+(\\d{1,2}\\.\\d{5,6} )\\s+(\\d\\.\\d{5,6})\\s+(\\d{1,3}\\.\\d{3,4})\\s+(\\d{1,3}\\.\\d{3,4})\\s+ (\\d{1,3}\\.\\d{3,4})\\s+(?:(\\d{4})(\\d\\d)(\\d\\d))?\\s+(\\-?\\d{1,2}\\.\ \d)\\s+(\\d{1,2}\\.\\d)\\s+(\\S.{1,54}\\S)(?:\\s+(\\S.*))?$");//
int match = mpcParser.indexIn(oneLineElements); int match = mpcParser.indexIn(oneLineElements);
//qDebug() << "RegExp captured:" << match << mpcParser.capturedTexts (); //qDebug() << "RegExp captured:" << match << mpcParser.capturedTexts ();
if (match < 0) if (match < 0)
{ {
qWarning() << "No match for" << oneLineElements; qWarning() << "No match for" << oneLineElements;
return result; return result;
skipping to change at line 473 skipping to change at line 473
return SsoElements(); return SsoElements();
} }
result.insert("section_name", sectionName); result.insert("section_name", sectionName);
//After a name has been determined, insert the essential keys //After a name has been determined, insert the essential keys
result.insert("parent", "Sun"); result.insert("parent", "Sun");
result.insert("type", "comet"); result.insert("type", "comet");
//"comet_orbit" is used for all cases: //"comet_orbit" is used for all cases:
//"ell_orbit" interprets distances as kilometers, not AUs //"ell_orbit" interprets distances as kilometers, not AUs
result.insert("coord_func","comet_orbit"); result.insert("coord_func","comet_orbit");
result.insert("orbit_good", 1000); // default validity for osculatin // GZ: moved next line below!
g elements, days //result.insert("orbit_good", 1000); // default validity for osculat
ing elements, days
result.insert("lighting", false); result.insert("lighting", false);
result.insert("color", "1.0, 1.0, 1.0"); result.insert("color", "1.0, 1.0, 1.0");
result.insert("tex_map", "nomap.png"); result.insert("tex_map", "nomap.png");
bool ok = false; bool ok = false;
//TODO: Use this for VALIDATION! //TODO: Use this for VALIDATION!
int year = mpcParser.cap(4).toInt(); int year = mpcParser.cap(4).toInt();
int month = mpcParser.cap(5).toInt(); int month = mpcParser.cap(5).toInt();
skipping to change at line 512 skipping to change at line 513
double argumentOfPerihelion = mpcParser.cap(9).toDouble(&ok);//J2000 .0, degrees double argumentOfPerihelion = mpcParser.cap(9).toDouble(&ok);//J2000 .0, degrees
result.insert("orbit_ArgOfPericenter", argumentOfPerihelion); result.insert("orbit_ArgOfPericenter", argumentOfPerihelion);
double longitudeOfTheAscendingNode = mpcParser.cap(10).toDouble(&ok) ;//J2000.0, degrees double longitudeOfTheAscendingNode = mpcParser.cap(10).toDouble(&ok) ;//J2000.0, degrees
result.insert("orbit_AscendingNode", longitudeOfTheAscendingNode); result.insert("orbit_AscendingNode", longitudeOfTheAscendingNode);
double inclination = mpcParser.cap(11).toDouble(&ok); double inclination = mpcParser.cap(11).toDouble(&ok);
result.insert("orbit_Inclination", inclination); result.insert("orbit_Inclination", inclination);
// GZ: We should reduce orbit_good for elliptical orbits to one half
period before/after perihel!
if (eccentricity < 1.0)
{
// Heafner, p.71
const double mu=(0.01720209895*0.01720209895); // GAUSS_GRAV
_CONST^2
const double meanMotion=std::sqrt(mu/(perihelionDistance*per
ihelionDistance*perihelionDistance)); // radians/day
double period=M_PI*2.0 / meanMotion; // period, days
result.insert("orbit_good", qMin(1000, (int) floor(0.5*perio
d))); // validity for elliptical osculating elements, days. Goes from aphel
to next aphel or max 1000 days.
}
else
result.insert("orbit_good", 1000); // default validity for o
sculating elements, days
double absoluteMagnitude = mpcParser.cap(15).toDouble(&ok); double absoluteMagnitude = mpcParser.cap(15).toDouble(&ok);
result.insert("absolute_magnitude", absoluteMagnitude); result.insert("absolute_magnitude", absoluteMagnitude);
//This is not the same "slope parameter" as used in asteroids. Bette r name? //This is not the same "slope parameter" as used in asteroids. Bette r name?
double slopeParameter = mpcParser.cap(16).toDouble(&ok); double slopeParameter = mpcParser.cap(16).toDouble(&ok);
result.insert("slope_parameter", slopeParameter); result.insert("slope_parameter", slopeParameter);
double radius = 5; //Fictitious double radius = 5; //Fictitious
result.insert("radius", radius); result.insert("radius", radius);
result.insert("albedo", 0.1); // GZ 2014-01-10: Comets are very dark , should even be 0.03! result.insert("albedo", 0.1); // GZ 2014-01-10: Comets are very dark , should even be 0.03!
result.insert("dust_lengthfactor", 0.4); // dust tail length w.r.t. gas tail length result.insert("dust_lengthfactor", 0.4); // dust tail length w.r.t. gas tail length
result.insert("dust_brightnessfactor", 1.5); // dust tail brightness w.r.t. gas tail. result.insert("dust_brightnessfactor", 1.5); // dust tail brightness w.r.t. gas tail.
result.insert("dust_widthfactor", 1.5); // opening w.r.t. gas tail o pening width. result.insert("dust_widthfactor", 1.5); // opening w.r.t. gas tail o pening width.
qDebug() << "readMpcOneLineCometElements done\n"; //qDebug() << "readMpcOneLineCometElements done\n";
return result; return result;
} }
SsoElements SolarSystemEditor::readMpcOneLineMinorPlanetElements(QString on eLineElements) SsoElements SolarSystemEditor::readMpcOneLineMinorPlanetElements(QString on eLineElements)
{ {
SsoElements result; SsoElements result;
//This time I'll try splitting the line to columns, instead of //This time I'll try splitting the line to columns, instead of
//using a regular expression. //using a regular expression.
//Using QString::mid() allows parsing it in a random sequence. //Using QString::mid() allows parsing it in a random sequence.
 End of changes. 4 change blocks. 
4 lines changed or deleted 23 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/