Kstars
deepstarcomponent.cpp
2 SPDX-FileCopyrightText: 2008 Akarsh Simha Thomas Kabelmann <akarshsimha@gmail.com, thomas.kabelmann@gmx.de>
32DeepStarComponent::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
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
552bool 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);
644 qCWarning(KSTARS) << "Trixel " << trixel << ": ERROR: Block" << i << "is unlinked in LRU Cache";
FILE * getFileHandle() const
Get the file handle corresponding to the currently open file.
Definition binfilehelper.h:109
long getDataOffset() const
Returns the offset at which the data begins.
Definition binfilehelper.h:175
bool readHeader()
Read the header and index table from the file and fill up the QVector s with the entries.
Definition binfilehelper.cpp:250
unsigned int getRecordCount(int id) const
Returns the number of records under the given index ID.
Definition binfilehelper.h:123
FILE * openFile(const QString &fileName)
WARNING: This function may not be compatible in other locales, because it calls QString::toAscii.
Definition binfilehelper.cpp:72
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
void draw(SkyPainter *skyp) override
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition deepstarcomponent.cpp:231
void update(KSNumbers *num) override
Update the sky position(s) of this component.
Definition deepstarcomponent.cpp:226
StarObject * findByHDIndex(int HDnum)
Definition deepstarcomponent.cpp:482
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Definition deepstarcomponent.cpp:494
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
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
Definition listcomponent.h:24
MeshIterator is a very lightweight class used to iterate over the result set of an HTMesh intersectio...
Definition MeshIterator.h:21
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
SkyComposite is a kind of container class for SkyComponent objects.
Definition skycomposite.h:30
static SkyMesh * Instance()
returns the default instance of SkyMesh or null if it has not yet been created.
Definition skymesh.cpp:39
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
Trixel index(const SkyPoint *p)
returns the index of the trixel containing p.
Definition skymesh.cpp:74
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
virtual bool drawPointSource(const SkyPoint *loc, float mag, char sp='A')=0
Draw a point source (e.g., a star).
dms angularDistanceTo(const SkyPoint *sp, double *const positionAngle=nullptr) const
Computes the angular distance between two SkyObjects.
Definition skypoint.cpp:899
A factory that creates StarBlocks and recycles them in an LRU Cache.
Definition starblockfactory.h:22
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
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
Maintains a list of StarBlocks that contain the stars lying in a single trixel.
Definition starblocklist.h:23
Holds a block of stars and various peripheral variables to mark its place in data structures.
Definition starblock.h:43
void JITupdate()
added for JIT updates from both StarComponent and ConstellationLines
Definition starobject.cpp:526
char spchar() const
Returns just the first character of the spectral type string.
Definition starobject.cpp:554
qint64 elapsed() const const
qint64 restart()
void start()
iterator insert(const Key &key, const T &value)
T value(const Key &key) const const
void append(QList< T > &&value)
void blockingMap(Iterator begin, Iterator end, MapFunctor &&function)
A 16-byte structure that holds star data for really faint stars.
Definition nomadbinfile2mysql.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.