Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery of DSO #3084

Merged
merged 6 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions nebulae/default/discovery.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#
# ID, Year of discovery, Discoverer
alex-w marked this conversation as resolved.
Show resolved Hide resolved
#
# Source:
# - SEDS Messier Database: http://www.messier.seds.org
#
M 1 1731 John Bevis
M 2 1746 Jean-Dominique Maraldi
M 3 1764 Charles Messier
M 4 1746 Philippe Loys de Chéseaux
M 5 1702 Gottfried Kirch
M 6 1654 Giovanni Batista Hodierna
M 7 130 Ptolemy
M 8 1654 Giovanni Batista Hodierna
M 9 1764 Charles Messier
M 10 1764 Charles Messier
M 11 1681 Gottfried Kirch
M 12 1764 Charles Messier
M 13 1714 Edmond Halley
M 14 1764 Charles Messier
M 15 1746 Jean-Dominique Maraldi
M 16 1764 Charles Messier
M 17 1745-1746 Philippe Loys de Chéseaux
M 18 1764 Charles Messier
M 19 1764 Charles Messier
M 20 1764 Charles Messier
M 21 1764 Charles Messier
M 22 1665 Abraham Ihle
M 23 1764 Charles Messier
M 24 1764 Charles Messier
M 25 1745-1746 Philippe Loys de Chéseaux
M 26 1764 Charles Messier
M 27 1764 Charles Messier
M 28 1764 Charles Messier
M 29 1764 Charles Messier
M 30 1764 Charles Messier
M 31 905 Abd-al-Rahman Al Sufi
M 32 1749 Guillaume Legentil
M 33 1764 Charles Messier
M 34 1654 Giovanni Batista Hodierna
M 35 1745-1746 Philippe Loys de Chéseaux
M 36 1654 Giovanni Batista Hodierna
M 37 1654 Giovanni Batista Hodierna
M 38 1654 Giovanni Batista Hodierna
M 39 1764 Charles Messier
M 40 1764 Charles Messier
M 41 -325 Aristoteles
M 42 1611 Johann Baptist Cysatus
M 43 1731 Jean-Jacques Dortous de Mairan
M 44 -260 Aratos of Soli
M 45 -750 Homer
M 46 1771 Charles Messier
M 47 1654 Giovanni Batista Hodierna
M 48 1771 Charles Messier
M 49 1771 Charles Messier
M 50 1711 Giovanni Cassini
M 51 1773 Charles Messier
M 52 1774 Charles Messier
M 53 1775 Johann Elert Bode
M 54 1778 Charles Messier
M 55 1752 Nicholas Louis de Lacaille
M 56 1779 Charles Messier
M 57 1779 Charles Messier
M 58 1779 Charles Messier
M 59 1779 Johann Gottfried Koehler
M 60 1779 Johann Gottfried Koehler
M 61 1779 Barnabus Oriani
M 62 1771 Charles Messier
M 63 1779 Pierre Méchain
M 64 1779 Edward Pigott
M 65 1780 Charles Messier
M 66 1780 Charles Messier
M 67 1779 Johann Gottfried Koehler
M 68 1780 Charles Messier
M 69 1780 Charles Messier
M 70 1780 Charles Messier
M 71 1745-1746 Philippe Loys de Chéseaux
M 72 1780 Pierre Méchain
M 73 1780 Charles Messier
M 74 1780 Pierre Méchain
M 75 1780 Pierre Méchain
M 76 1780 Pierre Méchain
M 77 1780 Pierre Méchain
M 78 1780 Pierre Méchain
M 79 1780 Pierre Méchain
M 80 1781 Charles Messier
M 81 1774 Johann Elert Bode
M 82 1774 Johann Elert Bode
M 83 1752 Nicholas Louis de Lacaille
M 84 1781 Charles Messier
M 85 1781 Pierre Méchain
M 86 1781 Charles Messier
M 87 1781 Charles Messier
M 88 1781 Charles Messier
M 89 1781 Charles Messier
M 90 1781 Charles Messier
M 91 1781 Charles Messier
M 92 1777 Johann Elert Bode
M 93 1781 Charles Messier
M 94 1781 Pierre Méchain
M 95 1781 Pierre Méchain
M 96 1781 Pierre Méchain
M 97 1781 Pierre Méchain
M 98 1781 Pierre Méchain
M 99 1781 Pierre Méchain
M 100 1781 Pierre Méchain
M 101 1781 Pierre Méchain
M 102 1781 Pierre Méchain, Charles Messier
M 103 1781 Pierre Méchain
M 104 1781 Pierre Méchain
M 105 1781 Pierre Méchain
M 106 1781 Pierre Méchain
M 107 1782 Pierre Méchain
M 108 1781 Pierre Méchain
M 109 1781 Charles Messier
M 110 1773 Charles Messier
4 changes: 4 additions & 0 deletions src/core/modules/Nebula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ Nebula::Nebula()
, VdBH_nb("")
, withoutID(false)
, nameI18("")
, discoverer("")
, discoveryYear("")
, mTypeString()
, bMag(99.)
, vMag(99.)
Expand Down Expand Up @@ -429,6 +431,8 @@ QString Nebula::getInfoString(const StelCore *core, const InfoStringGroup& flags

oss << QString("%1: %2 %3").arg(q_("Parallax"), px, qc_("mas", "parallax")) << "<br />";
}
if (!discoverer.isEmpty())
oss << QString("%1: %2 (%3)").arg(q_("Discoverer"), discoverer, discoveryYear) << "<br />";
if (!getMorphologicalTypeDescription().isEmpty())
oss << QString("%1: %2.").arg(q_("Morphological description"), getMorphologicalTypeDescription()) << "<br />";
}
Expand Down
99 changes: 51 additions & 48 deletions src/core/modules/Nebula.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ friend class NebulaMgr;
float getSurfaceArea(void) const;

void setProperName(QString name) { englishName = name; }
void setDiscoveryData(QString name, QString year) { discoverer = name; discoveryYear = year; }
void addNameAlias(QString name) { englishAliases.append(name); englishAliases.removeDuplicates(); }
void removeAllNames() { englishName=""; englishAliases.clear(); }

Expand Down Expand Up @@ -268,54 +269,56 @@ friend class NebulaMgr;
QString getMorphologicalTypeDescription() const;

unsigned int DSO_nb;
unsigned int M_nb; // Messier Catalog number
unsigned int NGC_nb; // New General Catalog number
unsigned int IC_nb; // Index Catalog number
unsigned int C_nb; // Caldwell Catalog number
unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
unsigned int VdB_nb; // van den Bergh Catalog number (Catalogue of Reflection Nebulae (van den Bergh, 1966))
unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
unsigned int Cr_nb; // Collinder Catalog number
unsigned int Mel_nb; // Melotte Catalog number
unsigned int PGC_nb; // PGC number (Catalog of galaxies)
unsigned int UGC_nb; // UGC number (The Uppsala General Catalogue of Galaxies)
unsigned int Arp_nb; // Arp number (Atlas of Peculiar Galaxies (Arp, 1966))
unsigned int VV_nb; // VV number (The Catalogue of Interacting Galaxies (Vorontsov-Velyaminov+, 2001))
unsigned int DWB_nb; // DWB number (Catalogue and distances of optically visible H II regions (Dickel+, 1969))
unsigned int Tr_nb; // Tr number (Trumpler Catalogue)
unsigned int St_nb; // St number (Stock Catalogue)
unsigned int Ru_nb; // Ru number (Ruprecht Catalogue)
unsigned int VdBHa_nb; // vdB-Ha number (van den Bergh-Hagen Catalogue)
QString Ced_nb; // Ced number (Cederblad Catalog of bright diffuse Galactic nebulae)
QString PK_nb; // PK number (Catalogue of Galactic Planetary Nebulae)
QString PNG_nb; // PN G number (Strasbourg-ESO Catalogue of Galactic Planetary Nebulae (Acker+, 1992))
QString SNRG_nb; // SNR G number (A catalogue of Galactic supernova remnants (Green, 2014))
QString ACO_nb; // ACO number (Rich Clusters of Galaxies (Abell+, 1989))
QString HCG_nb; // HCG number (Hickson Compact Group (Hickson, 1989))
QString ESO_nb; // ESO number (ESO/Uppsala Survey of the ESO(B) Atlas (Lauberts, 1982))
QString VdBH_nb; // VdBH number (Southern Stars embedded in nebulosity (van den Bergh+, 1975))
unsigned int M_nb; // Messier Catalog number
unsigned int NGC_nb; // New General Catalog number
unsigned int IC_nb; // Index Catalog number
unsigned int C_nb; // Caldwell Catalog number
unsigned int B_nb; // Barnard Catalog number (Dark Nebulae)
unsigned int Sh2_nb; // Sharpless Catalog number (Catalogue of HII Regions (Sharpless, 1959))
unsigned int VdB_nb; // van den Bergh Catalog number (Catalogue of Reflection Nebulae (van den Bergh, 1966))
unsigned int RCW_nb; // RCW Catalog number (H-α emission regions in Southern Milky Way (Rodgers+, 1960))
unsigned int LDN_nb; // LDN Catalog number (Lynds' Catalogue of Dark Nebulae (Lynds, 1962))
unsigned int LBN_nb; // LBN Catalog number (Lynds' Catalogue of Bright Nebulae (Lynds, 1965))
unsigned int Cr_nb; // Collinder Catalog number
unsigned int Mel_nb; // Melotte Catalog number
unsigned int PGC_nb; // PGC number (Catalog of galaxies)
unsigned int UGC_nb; // UGC number (The Uppsala General Catalogue of Galaxies)
unsigned int Arp_nb; // Arp number (Atlas of Peculiar Galaxies (Arp, 1966))
unsigned int VV_nb; // VV number (The Catalogue of Interacting Galaxies (Vorontsov-Velyaminov+, 2001))
unsigned int DWB_nb; // DWB number (Catalogue and distances of optically visible H II regions (Dickel+, 1969))
unsigned int Tr_nb; // Tr number (Trumpler Catalogue)
unsigned int St_nb; // St number (Stock Catalogue)
unsigned int Ru_nb; // Ru number (Ruprecht Catalogue)
unsigned int VdBHa_nb; // vdB-Ha number (van den Bergh-Hagen Catalogue)
QString Ced_nb; // Ced number (Cederblad Catalog of bright diffuse Galactic nebulae)
QString PK_nb; // PK number (Catalogue of Galactic Planetary Nebulae)
QString PNG_nb; // PN G number (Strasbourg-ESO Catalogue of Galactic Planetary Nebulae (Acker+, 1992))
QString SNRG_nb; // SNR G number (A catalogue of Galactic supernova remnants (Green, 2014))
QString ACO_nb; // ACO number (Rich Clusters of Galaxies (Abell+, 1989))
QString HCG_nb; // HCG number (Hickson Compact Group (Hickson, 1989))
QString ESO_nb; // ESO number (ESO/Uppsala Survey of the ESO(B) Atlas (Lauberts, 1982))
QString VdBH_nb; // VdBH number (Southern Stars embedded in nebulosity (van den Bergh+, 1975))
bool withoutID;
QString englishName; // English name
QStringList englishAliases; // English aliases
QString nameI18; // Nebula name
QStringList nameI18Aliases; // Nebula aliases
QString mTypeString; // Morphological type of object (as string)
float bMag; // B magnitude
float vMag; // V magnitude. For Dark Nebulae, opacity is stored here.
float majorAxisSize; // Major axis size in degrees
float minorAxisSize; // Minor axis size in degrees
int orientationAngle; // Orientation angle in degrees
float oDistance; // distance (kpc)
float oDistanceErr; // Error of distance (kpc)
QString englishName; // English name
QStringList englishAliases; // English aliases
QString nameI18; // Nebula name
QStringList nameI18Aliases; // Nebula aliases
QString discoverer; // The name of discoverer
QString discoveryYear; // Year(s) of discovery
QString mTypeString; // Morphological type of object (as string)
float bMag; // B magnitude
float vMag; // V magnitude. For Dark Nebulae, opacity is stored here.
float majorAxisSize; // Major axis size in degrees
float minorAxisSize; // Minor axis size in degrees
int orientationAngle; // Orientation angle in degrees
float oDistance; // distance (kpc)
float oDistanceErr; // Error of distance (kpc)
float redshift;
float redshiftErr;
float parallax;
float parallaxErr;
Vec3d XYZ; // Cartesian equatorial position (J2000.0)
Vec3d XY; // Store temporary 2D position
Vec3d XYZ; // Cartesian equatorial position (J2000.0)
Vec3d XY; // Store temporary 2D position
NebulaType nType;

SphericalRegionP pointRegion;
Expand All @@ -328,13 +331,13 @@ friend class NebulaMgr;
static StelTextureSP texGalaxyLarge; // Type 0_large
static StelTextureSP texOpenCluster; // Type 1
static StelTextureSP texOpenClusterLarge; // Type 1_large
static StelTextureSP texOpenClusterXLarge; // Type 1_extralarge
static StelTextureSP texOpenClusterXLarge; // Type 1_extralarge
static StelTextureSP texGlobularCluster; // Type 2
static StelTextureSP texGlobularClusterLarge; // Type 2_large
static StelTextureSP texGlobularClusterLarge; // Type 2_large
static StelTextureSP texPlanetaryNebula; // Type 3
static StelTextureSP texDiffuseNebula; // Type 4
static StelTextureSP texDiffuseNebulaLarge; // Type 4_large
static StelTextureSP texDiffuseNebulaXLarge; // Type 4_extralarge
static StelTextureSP texDiffuseNebula; // Type 4
static StelTextureSP texDiffuseNebulaLarge; // Type 4_large
static StelTextureSP texDiffuseNebulaXLarge; // Type 4_extralarge
static StelTextureSP texDarkNebula; // Type 5
static StelTextureSP texDarkNebulaLarge; // Type 5_large
static StelTextureSP texOpenClusterWithNebulosity; // Type 6
Expand Down
53 changes: 53 additions & 0 deletions src/core/modules/NebulaMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,52 @@ bool NebulaMgr::loadDSONames(const QString &filename)
return true;
}

bool NebulaMgr::loadDSODiscoveryData(const QString &filename)
{
qDebug() << "Loading DSO discovery data ...";
QFile dsoDiscoveryFile(filename);
if (!dsoDiscoveryFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
qWarning().noquote() << "DSO discovery data file" << QDir::toNativeSeparators(filename) << "not found.";
return false;
}

int readOk = 0;
int totalRecords = 0;
QString record, dso, dYear, dName;
NebulaP e;
while (!dsoDiscoveryFile.atEnd())
{
record = QString::fromUtf8(dsoDiscoveryFile.readLine());
if (record.startsWith("//") || record.startsWith("#") || record.isEmpty())
continue;

totalRecords++;
#if (QT_VERSION>=QT_VERSION_CHECK(5, 14, 0))
QStringList list=record.split("\t", Qt::KeepEmptyParts);
#else
QStringList list=record.split("\t", QString::KeepEmptyParts);
#endif

dso = list.at(0).trimmed();
dYear = list.at(1).trimmed();
dName = list.at(2).trimmed();

e = search(dso);
if (e.isNull()) // maybe this is inner number of DSO
e = searchDSO(dso.toUInt());

if (!e.isNull())
{
e->setDiscoveryData(dName, dYear);
readOk++;
}
}
dsoDiscoveryFile.close();
qDebug().noquote() << "Loaded" << readOk << "/" << totalRecords << "DSO discovery records successfully";
return true;
}

bool NebulaMgr::loadDSOOutlines(const QString &filename)
{
qDebug() << "Loading DSO outline data ...";
Expand Down Expand Up @@ -1739,6 +1785,13 @@ void NebulaMgr::updateSkyCulture(const QString& skyCultureDir)
return;
}
loadDSONames(dsoNamesPath);
QString dsoDiscoveryPath = StelFileMgr::findFile("nebulae/" + setName + "/discovery.dat");
if (dsoDiscoveryPath.isEmpty())
{
qWarning().noquote() << "ERROR while loading deep-sky discovery data set " << setName;
return;
alex-w marked this conversation as resolved.
Show resolved Hide resolved
}
loadDSODiscoveryData(dsoDiscoveryPath);
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions src/core/modules/NebulaMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,9 @@ private slots:
bool loadDSONames(const QString& filename);
// Load outlines for DSO
bool loadDSOOutlines(const QString& filename);
// Load discovery data for DSO
// TODO: Move these data into main DSO catalog to fast reading (v4)
bool loadDSODiscoveryData(const QString& filename);

QVector<NebulaP> dsoArray; // The DSO list
QHash<unsigned int, NebulaP> dsoIndex;
Expand Down