1. Fixed bugs in checking if there was an artifact at start and also
   end of flare.
   First, changed if...any() is True: to if...any() == True:
   Second, altered indexing of artifacts_removed[artifact_check[index]]
   to artifacts_removed[artifact_check][index].

2. Added a try...except...else statement when looking for end time.  If one
   is not found, then instead of crashing, code moves on to next possible
   start time.

3. Fixed bug in checking reference start time criteria.  dt4 was not index
   correctly so wrong time differences were being checked.  Was dt4[i],
   now dt[pos_deriv[i]].
Added try...except...else statement around finding l index (index from
where to start looking for end time index) so if one cannot be found
instead of crashing, code now moves on to next candidate start time.
No meaningful change.