コード例 #1
0
ファイル: skypoint.cpp プロジェクト: Bugsbane/kstars
void SkyPoint::apparentCoord(long double jd0, long double jdf){
    precessFromAnyEpoch(jd0,jdf);
    KSNumbers num(jdf);
    nutate( &num );
    if( Options::useRelativistic() && checkBendLight() )
        bendlight();
    aberrate( &num );
}
コード例 #2
0
void StarObject::JITupdate()
{
    static KStarsData *data = KStarsData::Instance();

    if ( updateNumID != data->updateNumID() ) {
        // TODO: This can be optimized and reorganized further in a better manner.
        // Maybe we should do this only for stars, since this is really a slow step only for stars
        Q_ASSERT( std::isfinite( lastPrecessJD ) );
        if( ( lastPrecessJD - data->updateNum()->getJD() ) >= 0.0005 // TODO: Make this 0.0005 a constant / define it
            || ( lastPrecessJD - data->updateNum()->getJD() ) <= -0.0005
            || Options::alwaysRecomputeCoordinates()
            || ( Options::useRelativistic() && checkBendLight() ) ) {

            // Short circuit right here, if recomputing coordinates is not required. NOTE: POTENTIALLY DANGEROUS
            updateCoords( data->updateNum() );
        }

        updateNumID = data->updateNumID();
    }
    EquatorialToHorizontal( data->lst(), data->geo()->lat() );
    updateID = data->updateID();
}
コード例 #3
0
ファイル: skypoint.cpp プロジェクト: Bugsbane/kstars
// Note: This method is one of the major rate determining factors in how fast the map pans / zooms in or out
void SkyPoint::updateCoords( const KSNumbers *num, bool /*includePlanets*/, const dms *lat, const dms *LST, bool forceRecompute ) {
    //Correct the catalog coordinates for the time-dependent effects
    //of precession, nutation and aberration
    bool recompute, lens;

    // NOTE: The same short-circuiting checks are also implemented in
    // StarObject::JITUpdate(), even before calling
    // updateCoords(). While this is code-duplication, these bits of
    // code need to be really optimized, at least for stars. For
    // optimization purposes, the code is left duplicated in two
    // places. Please be wary of changing one without changing the
    // other.

    Q_ASSERT( std::isfinite( lastPrecessJD ) );

    if( Options::useRelativistic() && checkBendLight() ) {
        recompute = true;
        lens = true;
    }
    else {
        recompute = ( Options::alwaysRecomputeCoordinates() ||
                      forceRecompute ||
                      fabs( lastPrecessJD - num->getJD() ) >= 0.00069444); // Update once per solar minute
        lens = false;
    }
    if( recompute ) {
        precess(num);
        nutate(num);
        if( lens )
            bendlight(); // FIXME: Shouldn't we apply this on the horizontal coordinates?
        aberrate(num);
        lastPrecessJD = num->getJD();
        Q_ASSERT( std::isfinite( RA.Degrees() ) && std::isfinite( Dec.Degrees() ) );
    }

    if ( lat || LST )
        qWarning() << i18n( "lat and LST parameters should only be used in KSPlanetBase objects." ) ;
}