Changeset 17100 for trunk/Mars/fact
- Timestamp:
- 09/06/13 16:58:59 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/fact/processing/currents.C
r16725 r17100 28 28 double dev_avg = 0; 29 29 double dev_rms = 0; 30 int cnt = 0;31 30 int cnt_beg = 0; 32 31 int cnt_end = 0; … … 37 36 38 37 double calc_dev_avg = 0; 38 double calc_dev_rel = 0; 39 40 TGraph g; 39 41 40 42 while (file.GetNextRow()) … … 76 78 77 79 //calculate the light condition 78 double calt = sin(hrzm.alt*TMath::DegToRad());79 80 double disk = Nova::GetLunarDisk(jd); 80 double lc = calt*pow(disk, 2.5);81 81 82 double Ical = lc>0 ? 4.5+103.0*lc : 4.5; 82 // Current prediction 83 //double cang = sin(angle); 84 const double calt = sin(hrzm.alt*TMath::DegToRad()); 85 86 // semi-major axis 87 const double lc = /*cang==0 ? 0 :*/ calt*pow(disk, 2.2)*pow(Nova::GetLunarEarthDist(jd)/384400, -2);///sqrt(cang); 88 //const double lc = cang==0 ? -1 : calt*pow(disk, 2.2)*pos(dist, -2); 89 const double Ical = lc>0 ? 4+103*lc : 4; 90 91 g.SetPoint(g.GetN(), time, med); 92 83 93 calc_dev_avg += med - Ical; 94 calc_dev_rel += med/Ical; 84 95 85 cnt++;86 96 } 87 97 88 if ( cnt==0)98 if (g.GetN()==0) 89 99 { 90 100 if (diff<5./24/3600) 91 101 return; 92 102 103 // return the last report before the run 104 // (if not older than 5 minutes) 93 105 cout << "result " << med_last << " 0 " << dev_last << " 0 0 0 0" << endl; 94 106 return; 107 } 108 109 Double_t a0, a1; 110 Int_t ifail; 111 g.LeastSquareLinearFit(0, a0, a1, ifail); 112 113 double fluct_abs = 0; 114 double fluct_rel = 0; 115 if (ifail==0) 116 { 117 for (int i=0; i<g.GetN(); i++) 118 g.GetY()[i] -= a0+a1*g.GetX()[i]; 119 fluct_abs = g.GetRMS(2); 120 121 for (int i=0; i<g.GetN(); i++) 122 g.GetY()[i] /= a0+a1*g.GetX()[i]; 123 fluct_rel = g.GetRMS(2); 95 124 } 96 125 … … 98 127 med_end = cnt_end>0 ? med_end/cnt_end : -1; 99 128 100 med_avg /= cnt;101 med_rms /= cnt;129 med_avg /= g.GetN(); 130 med_rms /= g.GetN(); 102 131 med_rms = sqrt(med_rms-med_avg*med_avg); 103 132 104 dev_avg /= cnt;105 dev_rms /= cnt;133 dev_avg /= g.GetN(); 134 dev_rms /= g.GetN(); 106 135 dev_rms = sqrt(dev_rms-dev_avg*dev_avg); 107 calc_dev_avg = calc_dev_avg / cnt;136 calc_dev_avg /= g.GetN(); 108 137 109 cout << "result " << med_avg << " " << med_rms << " " << dev_avg << " " << dev_rms << " " << med_beg << " " << med_end << " " << calc_dev_avg << endl; 138 calc_dev_rel -= g.GetN(); 139 calc_dev_rel /= g.GetN(); 140 141 142 cout << "result " << med_avg << " " << med_rms << " " << dev_avg << " " << dev_rms << " " << med_beg << " " << med_end << " " << calc_dev_avg << " " << calc_dev_rel << " " << fluct_abs << " " << fluct_rel << endl; 110 143 }
Note:
See TracChangeset
for help on using the changeset viewer.