Changeset 14885 for trunk/FACT++


Ignore:
Timestamp:
02/09/13 16:35:05 (12 years ago)
Author:
tbretz
Message:
Allow empty source name and updated the forumla for current prediction
File:
1 edited

Legend:

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

    r14784 r14885  
    8686    if (!conf.DoParse(argc, argv))
    8787        return 127;
    88 
     88/*
    8989    if (!conf.Has("source-name"))
    9090    {
     
    9292        return 1;
    9393    }
    94 
     94*/
    9595    // ------------------ Eval config ---------------------
    9696
     
    106106        time.SetFromStr(conf.Get<string>("date-time"));
    107107
    108     const string source_name = conf.Get<string>("source-name");
    109108    const double max_current = conf.Get<double>("max-current");
    110109    const double max_zd      = conf.Get<double>("max-zd");
     
    128127    cout << jd1 << "\n";
    129128
    130     const string fDatabase = conf.Get<string>("source-database");
     129    if (!conf.Has("source-name"))
     130        return 1;
     131
     132    const string source_name = conf.Get<string>("source-name");
     133    const string fDatabase   = conf.Get<string>("source-database");
    131134
    132135    // ------------------ Precalc moon coord ---------------------
     
    181184
    182185        // Current prediction
    183         const double lc = angle*hrzm.alt*pow(disk, 6)/360/360;
    184         const double cur = lc>0 ? 7.7+4942*lc : 7.7;
     186        const double cang = sin(angle   *M_PI/180);
     187        const double calt = sin(hrzm.alt*M_PI/180);
     188
     189        const double lc = cang==0 ? -1 : calt*pow(disk, 3)/sqrt(cang);
     190        const double cur = lc>0 ? 8.1+94.6*lc : 8.1;
    185191
    186192        // Relative  energy threshold prediction
     
    205211
    206212        if (no_limits || (cur<max_current && 90-hrz.alt<max_zd))
    207             cout << ratio*cur/7.7;
     213            cout << ratio*cur/8.1;
    208214        cout << ", ";
    209215
Note: See TracChangeset for help on using the changeset viewer.