Changeset 17958


Ignore:
Timestamp:
08/13/14 12:55:18 (10 years ago)
Author:
tbretz
Message:
A small simplification (the vector isn't really needed)
File:
1 edited

Legend:

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

    r17957 r17958  
    113113    const RstTime sun_rise = GetSolarRst(time.JD()+0.5, -12);
    114114
    115     const double jd  = floor(time.Mjd())+2400001;
    116     const double mjd = floor(time.Mjd())+49718+0.5; // root time
     115    const double jd = floor(time.Mjd())+2400001;
    117116
    118117    cout << "Time: " << time     << endl;
     
    125124
    126125    const string fDatabase = conf.Get<string>("source-database");
    127 
    128     // ------------------ Precalc coord ---------------------
    129 
    130     vector<SolarObjects> fCoordinates;
    131 
    132     for (double h=0; h<1; h+=1./(24*12))
    133         if (jd+h>sunset && jd+h<sunrise)
    134             fCoordinates.emplace_back(jd+h);
    135126
    136127    // ------------- Get Sources from databasse ---------------------
     
    254245
    255246        // Loop over 24 hours
    256         for (auto it=fCoordinates.begin(); it!=fCoordinates.end(); it++)
     247        for (double h=0; h<1; h+=1./(24*12))
    257248        {
     249            const SolarObjects so(jd+h);
     250
    258251            // get local position of source
    259             const HrzPosn hrz = GetHrzFromEqu(pos, it->fJD);
     252            const HrzPosn hrz = GetHrzFromEqu(pos, so.fJD);
    260253
    261254            if (v==res.begin())
    262                 cout << Time(it->fJD) <<" " << 90-it->fMoonHrz.alt <<  endl;
    263 
    264             const double cur = FACT::PredictI(*it, pos);
     255                cout << Time(so.fJD) <<" " << 90-so.fMoonHrz.alt <<  endl;
     256
     257            const double cur = FACT::PredictI(so, pos);
    265258
    266259            // Relative  energy threshold prediction
     
    268261
    269262            // Add points to curve
    270             const double axis = Time(it->fJD).Mjd()*24*3600;
     263            const double axis = Time(so.fJD).Mjd()*24*3600;
    271264
    272265            // If there is a gap of more than one bin, start a new curve
     
    289282            if (no_limits || (cur<max_current && 90-hrz.alt<max_zd))
    290283            {
    291                 const double angle = GetAngularSeparation(it->fMoonEqu, pos);
     284                const double angle = GetAngularSeparation(so.fMoonEqu, pos);
    292285                g4.SetPoint(g4.GetN(), axis, angle);
    293286            }
    294287
    295288            if (cnt==0)
    296                 gm.SetPoint(gm.GetN(), axis, it->fMoonHrz.alt);
     289                gm.SetPoint(gm.GetN(), axis, so.fMoonHrz.alt);
    297290        }
    298291
Note: See TracChangeset for help on using the changeset viewer.