369 for (
size_t i=1;
i<obs.size()-1;
i++)
371 if (obs[
i].duration()>=40./24/60)
374 if (obs[
i-1].name==
"SLEEP" && obs[
i+1].name==
"SLEEP")
377 cout <<
"Intermediate source [" << obs[
i].name <<
"] detected < 40min" << endl;
379 double intersection = -1;
381 if (obs[
i-1].name==
"SLEEP")
382 intersection = obs[
i].begin;
384 if (obs[
i+1].name==
"SLEEP")
385 intersection = obs[
i].end;
387 if (obs[
i-1].name==obs[
i+1].name)
388 intersection = obs[
i].begin;
392 const uint32_t n = nearbyint((obs[
i].
end-obs[
i].
begin)*24*60);
393 for (uint32_t ii=0; ii<n; ii++)
395 const double jd = obs[
i].begin+ii/24./60.;
398 if (obs[
i-1].getThreshold(so)>=obs[
i+1].getThreshold(so))
406 if ((obs[
i-1].name!=
"SLEEP" && !obs[
i-1].IsRangeValid(obs[
i-1].
end, intersection)) ||
407 (obs[
i+1].name!=
"SLEEP" && !obs[
i+1].IsRangeValid(intersection, obs[
i+1].
begin)))
409 cout <<
"No reschedule possible within limits." << endl;
413 cout <<
"Intermediate source [" << obs[
i].name <<
"] removed" << endl;
415 const bool underflow = obs[
i-1].duration()*24*60<40 || obs[
i+1].duration()*24*60<40;
417 obs[
i-1].end = intersection;
418 obs[
i+1].begin = intersection;
419 obs.erase(obs.begin()+
i);
423 if (obs.size()>1 && obs[
i].name==obs[
i+1].name)
425 obs[
i].end = obs[
i+1].end;
426 obs.erase(obs.begin()+
i+1);
428 cout <<
"Combined two surrounding indentical sources [" << obs[
i].name <<
"] into one observation" << endl;
436 cout <<
"WARNING - Neighbor source < 40min as well." << endl;