Changeset 17959 for trunk/FACT++/src


Ignore:
Timestamp:
08/13/14 12:57:47 (10 years ago)
Author:
tbretz
Message:
Make use of new central current prediction.
File:
1 edited

Legend:

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

    r17653 r17959  
    1 #include "externals/nova.h"
     1#include "externals/Prediction.h"
    22
    33#include "Database.h"
     
    9797    const string fDatabase   = conf.Get<string>("source-database");
    9898
    99     // ------------------ Precalc moon coord ---------------------
    100 
    101     vector<tuple<EquPosn, double, double>> fMoonCoords;
    102     vector<EquPosn> fSunCoords;
    103 
    104     for (double h=0; h<1; h+=1./(24*12))
    105     {
    106         const EquPosn sun  = GetSolarEquCoords(jd+h);
    107         const EquPosn moon = GetLunarEquCoords(jd+h, 0.01);
    108         const double  disk = GetLunarDisk(jd+h);
    109         const double edist = GetLunarEarthDist(jd+h)/384400;
    110 
    111         fMoonCoords.emplace_back(moon, disk, edist);
    112         fSunCoords.emplace_back(sun);
    113     }
    114 
    11599    // ------------- Get Sources from databasse ---------------------
    116100
     
    137121            continue;
    138122
     123        const SolarObjects so(jd+h);
     124
    139125        // get local position of source
    140126        const HrzPosn hrz = GetHrzFromEqu(pos, jd+h);
    141127
    142         // Get sun and moon properties and
    143             const EquPosn  sun   = fSunCoords[i];
    144             const EquPosn  moon  = get<0>(fMoonCoords[i]);
    145             const double   disk  = get<1>(fMoonCoords[i]);
    146             const double   edist = get<2>(fMoonCoords[i]);
    147             const HrzPosn  hrzm  = GetHrzFromEqu(moon, jd+h);
    148             const ZdAzPosn hrzs  = GetHrzFromEqu(sun,  jd+h);
    149 
    150         // Distance between source and moon
    151         const double angle = GetAngularSeparation(moon, pos);
    152 
    153         // Current prediction
    154         const double sin_malt  = hrzm.alt<0 ? 0 : sin(hrzm.alt*M_PI/180);
    155         const double cos_mdist = cos(angle*M_PI/180);
    156         const double sin_szd   = sin(hrzs.zd*M_PI/180);
    157 
    158         const double k0 = pow(disk,      2.63);
    159         const double k1 = pow(sin_malt,  0.60);
    160         const double k2 = pow(edist,    -2.00);
    161         const double k3 = exp(0.67*cos_mdist*cos_mdist*cos_mdist*cos_mdist);
    162         const double k4 = exp(-97.8+105.8*sin_szd*sin_szd);
    163 
    164         const double cur = 6.2 + 95.7*k0*k1*k2*k3 + k4;
     128        // get current prediction
     129        const double cur = FACT::PredictI(so, pos);
    165130
    166131        // Relative  energy threshold prediction
    167         //const double cs = cos((90+hrz.alt)*M_PI/180);
    168         //const double ratio = (10.*sqrt(409600.*cs*cs+9009.) + 6400.*cs - 60.)/10.;
    169132        const double ratio = pow(cos((90-hrz.alt)*M_PI/180), -2.664);
    170133
     
    190153
    191154        if (no_limits || (cur<max_current && 90-hrz.alt<max_zd))
    192             cout << angle;
     155            cout << GetAngularSeparation(so.fMoonEqu, pos);
    193156        cout << "\n";
    194157    }
Note: See TracChangeset for help on using the changeset viewer.