diff options
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 ) { |