- Timestamp:
- 06/05/13 16:14:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/fact/processing/currents.C
r15222 r16725 1 2 1 3 void currents(const char *fname, double beg=0, double end=100000) 2 4 { … … 7 9 8 10 Double_t time; 11 Double_t jd; 12 9 13 Float_t med, dev; 10 14 file.SetPtrAddress("Time", &time); … … 32 36 double diff = -1; 33 37 38 double calc_dev_avg = 0; 39 34 40 while (file.GetNextRow()) 35 41 { 36 42 time += offset; 43 jd = time + 2400000.5; 37 44 38 45 if (time>end) … … 63 70 } 64 71 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 65 85 cnt++; 66 86 } … … 71 91 return; 72 92 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; 74 94 return; 75 95 } … … 85 105 dev_rms /= cnt; 86 106 dev_rms = sqrt(dev_rms-dev_avg*dev_avg); 107 calc_dev_avg = calc_dev_avg / cnt; 87 108 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; 89 110 }
Note:
See TracChangeset
for help on using the changeset viewer.