Kstars
deepstarcomponent.cpp
32 DeepStarComponent::DeepStarComponent(SkyComposite *parent, QString fileName, float trigMag, bool staticstars)
33 : ListComponent(parent), m_reindexNum(J2000), triggerMag(trigMag), m_FaintMagnitude(-5.0), staticStars(staticstars),
64 qCCritical(KSTARS) << "Error reading header of catalog file " << dataFileName << ": " << starReader.getErrorNumber()
97 qCWarning(KSTARS) << "HTM Level in shallow star data file and HTM Level in m_skyMesh do not match. EXPECT TROUBLE!";
99 // JM 2012-12-05: Breaking into 2 loops instead of one previously with multiple IF checks for recordSize
100 // While the CPU branch prediction might not suffer any penalties since the branch prediction after a few times
101 // should always gets it right. It's better to do it this way to avoid any chances since the compiler might not optimize it.
111 qCCritical(KSTARS) << "ERROR: Could not allocate new StarBlock to hold shallow unnamed stars for trixel "
122 qCCritical(KSTARS) << "ERROR: Could not read StarData structure for star #" << j << " under trixel #"
162 qCCritical(KSTARS) << "Could not allocate new StarBlock to hold shallow unnamed stars for trixel "
219 qDebug() << Q_FUNC_INFO << "Could not open HD Index file. Search by HD numbers for deep stars will not work.";
287 // If we are to hide the fainter stars (eg: while slewing), we set the magnitude limit to hideStarsMag.
293 // qDebug() << Q_FUNC_INFO << "Mesh size = " << m_skyMesh->size() << "; drawID = " << m_skyMesh->drawID();
320 qCWarning(KSTARS) << "markNext failed in trixel" << currentRegion << "while marking block" << i;
335 // NOTE: We are guessing that the last 1.5/16 magnitudes in the catalog are just additions and the star catalog
336 // is actually supposed to reach out continuously enough only to mag m_FaintMagnitude * ( 1 - 1.5/16 )
337 // TODO: Is there a better way? We may have to change the magnitude tolerance if the catalog changes
352 // qCWarning(KSTARS) << "SBL::fillToMag( " << maglim << " ) failed for trixel " << currentRegion;
360 // REMARK: The following should never carry state, except for const parameters like updateID and maglim
361 std::function<void(std::shared_ptr<StarBlock>)> mapFunction = [&updateID, &maglim](std::shared_ptr<StarBlock> myBlock)
396 // DEBUG: Uncomment to identify problems with Star Block Factory / preservation of Magnitude Order in the LRU Cache
405 qDebug() << Q_FUNC_INFO << "Spent " << dms::seconds_in_trig << " seconds doing " << trig_calls_here
410 qDebug() << Q_FUNC_INFO << "CachedDms constructor calls so far: " << CachingDms::cachingdms_constructor_calls;
411 qDebug() << Q_FUNC_INFO << "Caching has prevented " << CachingDms::cachingdms_delta << " redundant trig function calls";
415 qDebug() << Q_FUNC_INFO << "Spent " << StarObject::updateCoordsCpuTime << " seconds updating " << StarObject::starsUpdated
417 << double(StarObject::updateCoordsCpuTime) / double(StarObject::starsUpdated) * 1.e6 << " us per star.";
435 qCWarning(KSTARS) << "Header read error for deep star catalog " << dataFileName << "!! Disabling it!";
456 qCWarning(KSTARS) << "Could not create HTMesh of level " << htm_level << " for catalog " << dataFileName
552 bool DeepStarComponent::starsInAperture(QList<StarObject *> &list, const SkyPoint ¢er, float radius, float maglim)
566 m_skyMesh->intersect(center.ra0().Degrees(), center.dec0().Degrees(), radius, (BufNum)OBJ_NEAREST_BUF);
void append(const T &value)
const T value(const Key &key) const const
Definition: MeshIterator.h:20
FILE * getFileHandle() const
Get the file handle corresponding to the currently open file.
Definition: binfilehelper.h:109
bool starsInAperture(QList< StarObject * > &list, const SkyPoint ¢er, float radius, float maglim=-29)
Add to the given list, the stars from this component, that lie within the specified circular aperture...
Definition: deepstarcomponent.cpp:552
bool markFirst(std::shared_ptr< StarBlock > &block)
Mark a StarBlock as most recently used and sync its drawID with the current drawID.
Definition: starblockfactory.cpp:82
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
bool readHeader()
Read the header and index table from the file and fill up the QVector s with the entries.
Definition: binfilehelper.cpp:250
void aperture(SkyPoint *center, double radius, MeshBufNum_t bufNum=DRAW_BUF)
finds the set of trixels that cover the circular aperture specified after first performing a reverse ...
Definition: skymesh.cpp:56
void append(const T &value)
Definition: kstarsdata.h:70
void intersect(double ra, double dec, double radius, BufNum bufNum=0)
NOTE: The intersect() routines below are all used to find the trixels needed to cover a geometric obj...
Definition: HTMesh.cpp:104
StarObject * findByHDIndex(int HDnum)
Definition: deepstarcomponent.cpp:482
Definition: skycomposite.h:29
Definition: starblock.h:42
QHash::iterator insert(const Key &key, const T &value)
unsigned int getRecordCount(int id) const
Returns the number of records under the given index ID.
Definition: binfilehelper.h:123
qint64 restart()
const T & at(int i) const const
virtual bool drawPointSource(const SkyPoint *loc, float mag, char sp='A')=0
Draw a point source (e.g., a star).
void update(KSNumbers *num) override
Update the sky position(s) of this component.
Definition: deepstarcomponent.cpp:226
qint64 elapsed() const const
dms angularDistanceTo(const SkyPoint *sp, double *const positionAngle=nullptr) const
Computes the angular distance between two SkyObjects.
Definition: skypoint.cpp:899
static SkyMesh * Instance()
returns the default instance of SkyMesh or null if it has not yet been created.
Definition: skymesh.cpp:39
char spchar() const
Returns just the first character of the spectral type string.
Definition: starobject.cpp:554
bool markNext(std::shared_ptr< StarBlock > &after, std::shared_ptr< StarBlock > &block)
Rank a given StarBlock after another given StarBlock in the LRU list and sync its drawID with the cur...
Definition: starblockfactory.cpp:122
void reset() const
sets the count back to zero so you can use this iterator to iterate again over the same result set.
Definition: MeshIterator.h:40
Canvas widget for displaying the sky bitmap; also handles user interaction events.
Definition: skymap.h:52
Definition: listcomponent.h:23
A 16-byte structure that holds star data for really faint stars.
Definition: nomadbinfile2mysql.h:26
void draw(SkyPainter *skyp) override
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition: deepstarcomponent.cpp:231
void JITupdate()
added for JIT updates from both StarComponent and ConstellationLines
Definition: starobject.cpp:526
int size() const const
A factory that creates StarBlocks and recycles them in an LRU Cache.
Definition: starblockfactory.h:21
Definition: starblocklist.h:22
Trixel index(const SkyPoint *p)
returns the index of the trixel containing p.
Definition: skymesh.cpp:86
void blockingMap(Sequence &sequence, MapFunctor function)
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Definition: deepstarcomponent.cpp:494
FILE * openFile(const QString &fileName)
WARNING: This function may not be compatible in other locales, because it calls QString::toAscii.
Definition: binfilehelper.cpp:72
void start()
long getDataOffset() const
Returns the offset at which the data begins.
Definition: binfilehelper.h:175
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.