/*--------------------------------------------------------------------------- File name : catcube.c Author : Nicolas Devillard Created on : October 05, 1995 Description : create one cube from a list of cubes ---------------------------------------------------------------------------*/ /* $Id: catcube.c,v 1.20 2002/01/29 12:37:56 ndevilla Exp $ $Author: ndevilla $ $Date: 2002/01/29 12:37:56 $ $Revision: 1.20 $ */ /*--------------------------------------------------------------------------- Includes ---------------------------------------------------------------------------*/ #include #include #include "eclipse.h" static void usage(char *pname) ; static char prog_desc[] = "concatenate data cubes" ; /*--------------------------------------------------------------------------- main ---------------------------------------------------------------------------*/ int main(int argc, char *argv[]) { char outname[FILENAMESZ+1] ; int c ; int i ; cube_t * in ; history * hs ; if (argc<2) usage(argv[0]) ; strncpy(outname, "cat.fits", FILENAMESZ); while (1) { int option_index = 0 ; static struct option long_options[] = { {"license", 0, 0, OPT_LICENSE}, {"help", 0, 0, OPT_HELP}, {"version", 0, 0, OPT_VERSION}, {"out", 1, 0, OPT_OUTPUT}, {0, 0, 0, 0} } ; c = getopt_long(argc, argv, "Lo:", long_options, &option_index) ; if (c==-1) break ; switch(c) { /* Standard option: display license (not documented in usage) */ case OPT_LICENSE: case 'L': eclipse_display_license() ; return 0 ; /* Standard option : help */ case OPT_HELP: case 'h': usage(argv[0]) ; break ; /* Standard option: version */ case OPT_VERSION: print_eclipse_version() ; return 0 ; /* Local option: name of the output file */ case OPT_OUTPUT: case 'o': strncpy(outname, optarg, FILENAMESZ) ; break ; default: usage(argv[0]) ; break ; } } /* Initialize eclipse environment */ eclipse_init(); e_comment(0, "loading input data..."); /* Check that the output file is not in the input list */ for (i=optind ; i or -o \n" "\tdefault output name is 'cat.fits'\n" "\n\n", pname) ; exit(0) ; }