diff options
author | Thomas White <taw@physics.org> | 2023-05-05 11:56:58 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-05-05 11:57:29 +0200 |
commit | d0318a7264be8311ed348d674de36fbc2190fa83 (patch) | |
tree | 07dc86b43ed83b55284ac8347d84888744c81312 /src/indexamajig.c | |
parent | 23d182d7c0d0c9ffd4a5f6189d6c05fe964a5d96 (diff) |
indexamajig: Catch common error '-i input.h5'
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r-- | src/indexamajig.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index bd89db32..358ba5a3 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -864,6 +864,7 @@ int main(int argc, char *argv[]) struct asdf_options *asdf_opts = NULL; double wl_from_dt; double clen_from_dt; + int err; /* Defaults for "top level" arguments */ args.filename = NULL; @@ -1167,6 +1168,20 @@ int main(int argc, char *argv[]) return 1; } + if ( is_hdf5_file(args.filename, &err) ) { + ERROR("Your input file appears to be an HDF5 file.\n"); + ERROR("The input file should be a list of data files, not the " + "data file itself.\n"); + ERROR("If you have only one input file, try the following:\n"); + ERROR(" echo %s > files.lst\n", args.filename); + ERROR(" indexamajig -i files.lst -o %s -g %s ...\n", + args.outfile, args.geom_filename); + return 1; + } else if ( err ) { + ERROR("Couldn't open '%s'\n", args.filename); + return 1; + } + /* Open input */ if ( args.filename != NULL ) { if ( strcmp(args.filename, "-") == 0 ) { |