Changeset 16725 for trunk/Mars/fact


Ignore:
Timestamp:
06/05/13 16:14:53 (11 years ago)
Author:
mknoetig
Message:
edit currents.C to work with fCurrentsDiffToPrediction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/fact/processing/currents.C

    r15222 r16725  
     1
     2
    13void currents(const char *fname, double beg=0, double end=100000)
    24{
     
    79
    810    Double_t time;
     11    Double_t jd;
     12
    913    Float_t med, dev;
    1014    file.SetPtrAddress("Time",  &time);
     
    3236    double diff = -1;
    3337
     38    double calc_dev_avg  = 0;
     39
    3440    while (file.GetNextRow())
    3541    {
    3642        time += offset;
     43        jd    = time + 2400000.5;
    3744
    3845        if (time>end)
     
    6370        }
    6471
     72        //calculate the moon
     73        Nova::EquPosn moon = Nova::GetLunarEquCoords(jd, 0.01);
     74        // get local position of moon
     75        Nova::HrzPosn hrzm = Nova::GetHrzFromEqu(moon, jd);
     76
     77        //calculate the light condition
     78        double calt = sin(hrzm.alt*TMath::DegToRad());
     79        double disk = Nova::GetLunarDisk(jd);
     80        double lc = calt*pow(disk, 2.5);
     81
     82        double Ical = lc>0 ? 4.5+103.0*lc : 4.5;
     83        calc_dev_avg += med - Ical;
     84
    6585        cnt++;
    6686    }
     
    7191            return;
    7292
    73         cout << "result " << med_last << " 0 " << dev_last << " 0 0 0" << endl;
     93        cout << "result " << med_last << " 0 " << dev_last << " 0 0 0 0" << endl;
    7494        return;
    7595    }
     
    85105    dev_rms /= cnt;
    86106    dev_rms = sqrt(dev_rms-dev_avg*dev_avg);
     107    calc_dev_avg = calc_dev_avg / cnt;
    87108
    88     cout << "result " << med_avg << " " << med_rms << " " << dev_avg << " " << dev_rms << " " << med_beg << " " << med_end << endl;
     109    cout << "result " << med_avg << " " << med_rms << " " << dev_avg << " " << dev_rms << " " << med_beg << " " << med_end << " " << calc_dev_avg << endl;
    89110}
Note: See TracChangeset for help on using the changeset viewer.