Ignore:
Timestamp:
09/17/19 09:51:24 (5 years ago)
Author:
tbretz
Message:
Fixed a problem (hopefully) when type 7 alerts are entered into the database. The visibility of the object was totally nonesense.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/scheduler.cc

    r19588 r19654  
    5252    Nova::SolarObjects solarobj;
    5353    Nova::ZdAzPosn position;
    54     Nova::RstTime vis_sun;
    55     Nova::RstTime vis_obj;
     54    Nova::RstTime rst_sun;
     55    Nova::RstTime rst_obj;
     56
     57    int vis_obj = -1;
    5658
    5759    double moon_dist   = -1;
     
    7274        position  = Nova::GetHrzFromEqu(equ, jd);
    7375        moon_dist = Nova::GetAngularSeparation(equ, solarobj.fMoonEqu);
    74         vis_sun   = Nova::GetSolarRst(jd, -12);
    75         vis_obj   = Nova::GetObjectRst(equ, jd, conditions[kZenithMax]);
     76        rst_sun   = Nova::GetSolarRst(jd, -12);
     77        vis_obj   = Nova::GetObjectRst(rst_obj, equ, jd, 90-conditions[kZenithMax]);
    7678
    7779        current   = FACT::PredictI(solarobj, equ);
     
    10421044        // If required: For better performance, both (sun and object)
    10431045        // RstTime could be calculated only here
    1044         const double sun_set  = fmod(check.vis_sun.set,     1);
    1045         const double sun_rise = fmod(check.vis_sun.rise,    1);
    1046 
    1047         const double rise     = fmod(check.vis_obj.rise,    1);
    1048         const double trans    = fmod(check.vis_obj.transit, 1);
    1049         const double set      = fmod(check.vis_obj.set,     1);
    1050 
    1051         if ((rise <sun_set || rise >sun_rise) &&
    1052             (trans<sun_set || trans>sun_rise) &&
    1053             (set  <sun_set || set  >sun_rise) )
     1046        const double sun_set  = fmod(check.rst_sun.set,     1);
     1047        const double sun_rise = fmod(check.rst_sun.rise,    1);
     1048
     1049        const double rise     = fmod(check.rst_obj.rise,    1);
     1050        const double trans    = fmod(check.rst_obj.transit, 1);
     1051        const double set      = fmod(check.rst_obj.set,     1);
     1052
     1053        // Object is at at least visible at some time during the
     1054        // night (above the required horizon) or is circumpolar
     1055        // above that horizon
     1056        //
     1057        // Considtions are:
     1058        // ((Rises      after sun-rise or before sun-set) and
     1059        //  (Culminates after sun-rise or before sun-set) and
     1060        //  (Sets       after sun-rise or before sun-set) and
     1061        //  (object not circumpolar/rise-trans-set valid))
     1062        // or is circumpolar below the defined horizon
     1063        //
     1064        if (check.vis_obj==-1 ||
     1065            (check.vis_obj==0 &&
     1066             (rise <sun_set || rise >sun_rise) &&
     1067             (trans<sun_set || trans>sun_rise) &&
     1068             (set  <sun_set || set  >sun_rise)))
    10541069            return;
    10551070
Note: See TracChangeset for help on using the changeset viewer.