Feature reduce time gaps
This pull request is related to #270.
The purpose of this pull request is to make sure that a maximum interval between archived fits files is preserved, by including additional files if there gap between meteor detections is larger than the maximum interval. This may be helpful for looking for changes in the night sky.
At the end of processing, and just prior to generating the archive, the spacing between the fits files is analysed.
If the gap between any pair of fits files, or the start of capture and the first fits file, or the last fits file and the end of capture is greater than the max_time_between_fits setting given in the .config file
; If the gap between fits files is greater than the number of seconds shown below
; fits files will be brought in from the captured_night_dir
max_time_between_fits: 3600
Then the gap is divided into the fewest possible evenly spaced intervals, and then fits files are brought in from night_captured_dir.
The default setting of 3600 seconds, 1 hour produces
2024/02/18 01:38:21-INFO-ArchiveDetections-line:45 - max_time_between_fits is set to 3600 seconds
2024/02/18 01:38:21-INFO-ArchiveDetections-line:152 - Maximum interval before including extra files was 3434 seconds
2024/02/18 01:38:21-INFO-ArchiveDetections-line:153 - Maximum interval after including 0 extra files is 3434 seconds
2024/02/18 01:38:21-INFO-ArchiveDetections-line:154 - Original / final fits file count 7 / 7
Which in this case, did not require any files to be added.
If very low settings are given in the .config file, they are overridden by a hard coded minimum of 900 seconds, or 15 minutes.
for example in the .config file
; If the gap between fits files is greater than the number of seconds shown below
; fits files will be brought in from the captured_night_dir
max_time_between_fits: 700
produces the log output
2024/02/18 01:28:57-WARNING-ArchiveDetections-line:43 - Setting max_time_between_fits to 700 seconds is less than coded minimum of 900 seconds
2024/02/18 01:28:57-INFO-ArchiveDetections-line:45 - max_time_between_fits is set to 900 seconds
2024/02/18 01:28:57-INFO-ArchiveDetections-line:152 - Maximum interval before including extra files was 3434 seconds
2024/02/18 01:28:57-INFO-ArchiveDetections-line:153 - Maximum interval after including 11 extra files is 902 seconds
2024/02/18 01:28:57-INFO-ArchiveDetections-line:154 - Original / final fits file count 7 / 18
A less extreme configuration of 1800 seconds, 30 minutes gives the following output
2024/02/18 01:33:00-INFO-ArchiveDetections-line:45 - max_time_between_fits is set to 1800 seconds
2024/02/18 01:33:00-INFO-ArchiveDetections-line:152 - Maximum interval before including extra files was 3434 seconds
2024/02/18 01:33:00-INFO-ArchiveDetections-line:153 - Maximum interval after including 5 extra files is 1793 seconds
2024/02/18 01:33:00-INFO-ArchiveDetections-line:154 - Original / final fits file count 7 / 12
Small change to logging
For 3600 second interval
024/02/18 02:48:28-INFO-ArchiveDetections-line:45 - max_time_between_fits is set to 3600 seconds
2024/02/18 02:48:28-INFO-ArchiveDetections-line:152 - Intervals before / after including extra files 3434 / 3434 seconds
2024/02/18 02:48:28-INFO-ArchiveDetections-line:153 - Original / added / final fits file count 7 / 0 / 7
For 1800 second interval
2024/02/18 02:52:54-INFO-ArchiveDetections-line:45 - max_time_between_fits is set to 1800 seconds
2024/02/18 02:52:54-INFO-ArchiveDetections-line:152 - Intervals before / after including extra files 3434 / 1793 seconds
2024/02/18 02:52:54-INFO-ArchiveDetections-line:153 - Original / added / final fits file count 7 / 5 / 12