Changeset 18418


Ignore:
Timestamp:
01/26/16 14:12:42 (9 years ago)
Author:
tbretz
Message:
Fixed a bug which was introduced with the simplification of the code, the threshold wasn't calculated anymore at all.
File:
1 edited

Legend:

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

    r18411 r18418  
    216216        return penalty*ratio*pow(current/6.2, 0.394);
    217217    }
     218
     219    bool calcThreshold(const SolarObjects &so)
     220    {
     221        const HrzPosn hrz     = GetHrzFromEqu(equ, so.fJD);
     222        const double  current = FACT::PredictI(so, equ);
     223
     224        if (current>max_current)
     225            return false;
     226
     227        if (hrz.alt<=0 || 90-hrz.alt>max_zd)
     228            return false;
     229
     230        if (maxzd.valid && 90-hrz.alt>maxzd.val)
     231            return false;
     232
     233        if (maxcurrent.valid && current>maxcurrent.val)
     234            return false;
     235
     236        const double ratio = pow(cos((90-hrz.alt)*M_PI/180), -2.664);
     237        threshold = penalty*ratio*pow(current/6.2, 0.394);
     238
     239        return true;
     240    }
    218241};
    219242
     
    565588        for (auto& src: sources)
    566589        {
    567             if (src.valid(so))
     590            if (src.calcThreshold(so))
    568591                vis.emplace_back(src);
    569592        }
     
    608631    // ---------------------------------------------------------------------
    609632
     633    cout << endl;
    610634    Print(obs, startup_offset);
    611635    cout << endl;
Note: See TracChangeset for help on using the changeset viewer.