Skip to content

Commit

Permalink
Add classes of meteor showers
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Sep 23, 2024
1 parent 3e174d6 commit a442a92
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 36 deletions.
40 changes: 40 additions & 0 deletions plugins/MeteorShowers/resources/MeteorShowers.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ANT":
{
"designation": "Antihelion",
"class": 2,
"activity":
[
{
Expand All @@ -27,6 +28,7 @@
{
"designation": "Daytime Arietids",
"IAUNo": "171",
"class": 4,
"activity":
[
{
Expand All @@ -52,6 +54,7 @@
{
"designation": "Daytime Sextantids",
"IAUNo": "221",
"class": 4,
"activity":
[
{
Expand All @@ -73,6 +76,7 @@
{
"designation": "November Orionids",
"IAUNo": "250",
"class": 2,
"activity":
[
{
Expand All @@ -94,6 +98,7 @@
{
"designation": "α-Centaurids",
"IAUNo": "102",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -132,6 +137,7 @@
{
"designation": "α-Monocerotids",
"IAUNo": "246",
"class": 3,
"activity":
[
{
Expand Down Expand Up @@ -187,6 +193,7 @@
{
"designation": "Andromedids",
"IAUNo": "18",
"class": 4,
"activity":
[
{
Expand Down Expand Up @@ -268,6 +275,7 @@
{
"designation": "Aurigids",
"IAUNo": "206",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -310,6 +318,7 @@
{
"designation": "α-Capricornids",
"IAUNo": "1",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -347,6 +356,7 @@
{
"designation": "Comae Berenicids",
"IAUNo": "20",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -410,6 +420,7 @@
{
"designation": "Draconids",
"IAUNo": "9",
"class": 3,
"activity":
[
{
Expand Down Expand Up @@ -474,6 +485,7 @@
{
"designation": "ε-Geminids",
"IAUNo": "23",
"class": 2,
"activity":
[
{
Expand All @@ -499,6 +511,7 @@
{
"designation": "η-Lyrids",
"IAUNo": "145",
"class": 2,
"activity":
[
{
Expand All @@ -520,6 +533,7 @@
{
"designation": "η-Aquariids",
"IAUNo": "31",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -569,6 +583,7 @@
{
"designation": "Geminids",
"IAUNo": "4",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -645,6 +660,7 @@
{
"designation": "σ-Hydrids",
"IAUNo": "16",
"class": 2,
"activity":
[
{
Expand All @@ -666,6 +682,7 @@
{
"designation": "June Bootids",
"IAUNo": "170",
"class": 3,
"activity":
[
{
Expand All @@ -689,6 +706,7 @@
{
"designation": "κ-Cygnids",
"IAUNo": "12",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -724,6 +742,7 @@
{
"designation": "Leonids",
"IAUNo": "13",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -834,6 +853,7 @@
{
"designation": "Leonis Minorids",
"IAUNo": "22",
"class": 2,
"activity":
[
{
Expand All @@ -858,6 +878,7 @@
{
"designation": "April Lyrids",
"IAUNo": "6",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -911,6 +932,7 @@
{
"designation": "December Monocerotids",
"IAUNo": "19",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -957,6 +979,7 @@
{
"designation": "Northern Taurids",
"IAUNo": "17",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -990,6 +1013,7 @@
{
"designation": "Orionids",
"IAUNo": "8",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -1029,6 +1053,7 @@
{
"designation": "Piscis Austrinids",
"IAUNo": "183",
"class": 4,
"activity":
[
{
Expand All @@ -1053,6 +1078,7 @@
{
"designation": "Perseids",
"IAUNo": "7",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -1089,6 +1115,7 @@
{
"designation": "Phoenicids",
"IAUNo": "254",
"class": 3,
"activity":
[
{
Expand All @@ -1115,6 +1142,7 @@
{
"designation": "π-Puppids",
"IAUNo": "137",
"class": 3,
"activity":
[
{
Expand All @@ -1138,6 +1166,7 @@
{
"designation": "Puppid-Velids",
"IAUNo": "301",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -1166,6 +1195,7 @@
{
"designation": "Quadrantids",
"IAUNo": "10",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -1215,6 +1245,7 @@
{
"designation": "Southern δ-Aquariids",
"IAUNo": "5",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -1255,6 +1286,7 @@
{
"designation": "September ε-Perseids",
"IAUNo": "208",
"class": 2,
"activity":
[
{
Expand All @@ -1276,6 +1308,7 @@
{
"designation": "Southern Taurids",
"IAUNo": "2",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -1319,6 +1352,7 @@
{
"designation": "τ-Herculids",
"IAUNo": "61",
"class": 3,
"activity":
[
{
Expand Down Expand Up @@ -1352,6 +1386,7 @@
{
"designation": "Ursids",
"IAUNo": "15",
"class": 1,
"activity":
[
{
Expand Down Expand Up @@ -1411,6 +1446,7 @@
{
"designation": "η-Eridanids",
"IAUNo": "191",
"class": 4,
"activity":
[
{
Expand All @@ -1433,6 +1469,7 @@
{
"designation": "γ-Ursae Minorids",
"IAUNo": "404",
"class": 4,
"activity":
[
{
Expand All @@ -1454,6 +1491,7 @@
{
"designation": "July Pegasids",
"IAUNo": "175",
"class": 2,
"activity":
[
{
Expand Down Expand Up @@ -1481,6 +1519,7 @@
{
"designation": "July γ-Draconids",
"IAUNo": "184",
"class": 4,
"activity":
[
{
Expand All @@ -1506,6 +1545,7 @@
{
"designation": "October Camelopardalids",
"IAUNo": "281",
"class": 4,
"activity":
[
{
Expand Down
37 changes: 35 additions & 2 deletions plugins/MeteorShowers/src/MeteorShower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ MeteorShower::MeteorShower(MeteorShowersMgr* mgr, const QVariantMap& map)
m_showerID = map.value("showerID").toString();
m_designation = map.value("designation").toString();
m_IAUNumber = map.value("IAUNo").toString();
m_class = map.value("class").toInt();
m_speed = map.value("speed").toInt();
m_radiantAlpha = map.value("radiantAlpha").toFloat()*M_PI_180;
m_radiantDelta = map.value("radiantDelta").toFloat()*M_PI_180;
Expand Down Expand Up @@ -537,6 +538,11 @@ QString MeteorShower::getInfoString(const StelCore* core, const InfoStringGroup&
{ INACTIVE, q_("inactive")}};
QString mstdata = mstMap.value(m_status, "");

const QMap<int, QString>classMap={
{ 1, "I" }, { 2, "II" }, { 3, "III" }, { 4, "IV" }
};
QString mClass = classMap.value(m_class, "");

if (flags&Name)
{
oss << "<h2>" << getNameI18n();
Expand All @@ -546,8 +552,12 @@ QString MeteorShower::getInfoString(const StelCore* core, const InfoStringGroup&
}

if (flags&ObjectType)
oss << QString("%1: <b>%2</b> (%3)").arg(q_("Type"), getObjectTypeI18n(), mstdata) << "<br />";

{
if (m_class==0)
oss << QString("%1: <b>%2</b> (%3)").arg(q_("Type"), getObjectTypeI18n(), mstdata) << "<br />";
else
oss << QString("%1: <b>%2</b> (%3; %4 %5)").arg(q_("Type"), getObjectTypeI18n(), mstdata, qc_("class","class of meteor shower"), mClass) << "<br />";
}

// Ra/Dec etc.
oss << getCommonInfoString(core, flags);
Expand Down Expand Up @@ -762,13 +772,36 @@ QString MeteorShower::getInfoString(const StelCore* core, const InfoStringGroup&
}
}
}

if (m_class>0)
oss << QString("%1: %2").arg(q_("Description of class"), getClassDescription(m_class)) << "<br />";
}

oss << getSolarLunarInfoString(core, flags);
postProcessInfoString(str, flags);
return str;
}

QString MeteorShower::getClassDescription(int mclass) const
{
QString mcdesc;
switch (mclass) {
case 1:
mcdesc = qc_("the strongest annual showers with ZHR’s normally ten or better.", "description of meteor shower class");
break;
case 2:
mcdesc = qc_("reliable minor showers with ZHR’s normally two to ten.", "description of meteor shower class");
break;
case 3:
mcdesc = qc_("showers that do not provide annual activity. These showers are rarely active yet have the potential to produce a major display on occasion.", "description of meteor shower class");
break;
case 4:
mcdesc = qc_("weak minor showers with ZHR’s rarely exceeding two. These showers are also good targets for video and photographic work.", "description of meteor shower class");
break;
}
return StelUtils::wrapText(mcdesc);
}

QVariantMap MeteorShower::getInfoMap(const StelCore *core) const
{
QVariantMap map = StelObject::getInfoMap(core);
Expand Down
Loading

0 comments on commit a442a92

Please sign in to comment.