Changeset 18444
- Timestamp:
- 02/17/16 14:03:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/makeschedule.cc
r18443 r18444 195 195 bool IsRangeValid(const double &jd_begin, const double &jd_end) const 196 196 { 197 const double step = 1./24/60;198 for ( double jd=jd_begin; jd<jd_end+step/2; jd++)199 if (!valid(SolarObjects(jd )))197 const uint32_t n = nearbyint((jd_end-jd_begin)*24*60); 198 for (uint32_t i=0; i<n; i++) 199 if (!valid(SolarObjects(jd_begin+i/24./60.))) 200 200 return false; 201 201 … … 390 390 if (intersection<0) 391 391 { 392 const double step = 1./24/60;393 for ( double jd=obs[i].begin; jd<obs[i].end-step/2; jd+=step)392 const uint32_t n = nearbyint((obs[i].end-obs[i].begin)*24*60); 393 for (uint32_t ii=0; ii<n; ii++) 394 394 { 395 const double jd = obs[i].begin+ii/24./60.; 396 395 397 const SolarObjects so(jd); 396 398 if (obs[i-1].getThreshold(so)>=obs[i+1].getThreshold(so)) … … 508 510 { 509 511 string tm = Time(src.begin).GetAsStr(); 510 511 512 if (src.preobs.size()>0) 512 513 { … … 640 641 const RstTime sun_rise = GetSolarRst(floor(time.JD())+0.5, angle_sun_rise); 641 642 642 const double sunset = ceil(sun_set.set*24*60) /24/60;643 const double sunrise = floor(sun_rise.rise*24*60)/24/60 ;643 const double sunset = ceil(sun_set.set*24*60) /24/60 + 1e-9; 644 const double sunrise = floor(sun_rise.rise*24*60)/24/60 + 1e-9; 644 645 645 646 cout << "\n"; 646 cout << "Date: " << Time(floor(sunset)) << "\n";647 cout << "Set: " << Time(sun _set.set) << "\n";648 cout << "Rise: " << Time(sun _rise.rise) << "\n";647 cout << "Date: " << Time(floor(sunset)).GetAsStr() << "\n"; 648 cout << "Set: " << Time(sunset).GetAsStr() << " [" << Time(sun_set.set) << "]\n"; 649 cout << "Rise: " << Time(sunrise).GetAsStr() << " [" << Time(sun_rise.rise) << "]\n"; 649 650 cout << endl; 650 651 … … 709 710 vector<Source> obs; 710 711 711 const double step = 1./24/60; 712 for (double jd=sunset; jd<sunrise-step/2; jd+=step) 713 { 712 const uint32_t n = nearbyint((sunrise-sunset)*24*60); 713 for (uint32_t i=0; i<n; i++) 714 { 715 const double jd = sunset + i/24./60.; 716 714 717 const SolarObjects so(jd); 715 718
Note:
See TracChangeset
for help on using the changeset viewer.