From c26b0952e48ddf97409bbb117c15ba0fe9476dda Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 25 Aug 2023 15:28:09 +0200 Subject: align_detector: Check for mixed-up Mille files --- src/align_detector.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/align_detector.c b/src/align_detector.c index d24bc8b7..49d3afac 100644 --- a/src/align_detector.c +++ b/src/align_detector.c @@ -31,6 +31,8 @@ #include #endif +#include +#include #include #include #include @@ -185,6 +187,29 @@ static int make_zero_sum(FILE *fh, struct dg_group_info *groups, int n_groups, } +static void print_time_warning() +{ + ERROR("\n\n"); + ERROR("WARNING: The modification times of the Mille data files differ " + "by more than one minute.\n"); + ERROR("This suggests that they might have come from different runs of " + "indexamajig.\n"); + ERROR("If this is not the case, then there is no problem and you can " + "ignore this warning.\n"); + ERROR("However, if Mille files have been mixed up between indexamajig " + "runs, then the detector alignment results will be wrong.\n"); + ERROR("\n\n"); +} + + +static int different(time_t a, time_t b) +{ + if ( a-b > 60 ) return 1; + if ( b-a > 60 ) return 1; + return 0; +} + + int main(int argc, char *argv[]) { int c; @@ -199,6 +224,8 @@ int main(int argc, char *argv[]) int n_groups; int r; char line[256]; + time_t first_mtime = 0; + int warn_times = 0; /* Long options */ const struct option longopts[] = { @@ -273,9 +300,28 @@ int main(int argc, char *argv[]) } for ( i=optind; i