likelihood_start_end_times_close

HSTB.kluster.fqpr_intelligence.likelihood_start_end_times_close(filetimes, compare_times, allowable_diff=2)

Take in a list of [starttime, endtime] and find the closest match to compare_times. Times are provided in terms of utc seconds. If none are close in allowable_diff seconds, returns empty list

Otherwise returns the index of filetimes that are a valid match:

filetimes = [[1607532013, 1607532313], [1607531513, 1607531813], [1607531013, 1607531513]] compare_times = [1607531514, 1607531812] likelihood_start_end_times_close(filetimes, compare_times) Out[15]: [1] filetimes[1] Out[16]: [1607531513, 1607531813]

Parameters
  • filetimes (list) – list of lists, start/end times of files

  • compare_times (list) – list of start/end time for the file to compare

  • allowable_diff (int) – maximum allowable difference between start or end times

Returns

list of the indices that are a valid match in filetimes or an empty list if no matches

Return type

list