IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41475


Ignore:
Timestamp:
Jan 24, 2021, 3:39:06 PM (5 years ago)
Author:
eugene
Message:

catch unhandled error (no valid image data); allow -h to show help info without valid configuration

Location:
trunk/Ohana/src/addstar
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/include/addstar.h

    r40526 r41475  
    341341void resort_catalog_galphot (Catalog *catalog);
    342342
     343void GetConfig (char *config, char *field, char *format, int N, void *ptr);
     344
    343345/**
    344346    there is an inconsistency to be resolved: fixed structures (like Image)
  • trunk/Ohana/src/addstar/src/ConfigInit.c

    r39457 r41475  
    11# include "addstar.h"
    2 
    3 void GetConfig (char *config, char *field, char *format, int N, void *ptr);
    42
    53AddstarClientOptions ConfigInit (int *argc, char **argv) {
  • trunk/Ohana/src/addstar/src/LoadStars.c

    r40804 r41475  
    33Catalog *LoadStars (char *filename, Image **images, off_t *Nimages, AddstarClientOptions *options) {
    44
    5   off_t *extsize;
    65  int i, Nfile, mode;
    76
     
    3837    off_t NimagesStart = *Nimages;
    3938    Catalog *newcat = NULL;
     39    off_t *extsize = NULL;
    4040
    4141    // load PMM data if specified (these are not stored as FITS-tables)
     
    4747    // otherwise, we have FITS-table files: parse their headers to determine the contents
    4848    headers = LoadHeaders (f, &mode, &Nheaders);
     49    if (Nheaders == 0) {
     50      fprintf (stderr, "ERROR: no FITS headers in %s, is it a FITS file?\n", file[i].filename);
     51      goto next_file;
     52    }
     53
    4954    headerSets = MatchHeaders (&extsize, &NheaderSets, mode, headers, Nheaders);
    5055    if (headerSets == NULL) {
  • trunk/Ohana/src/addstar/src/MatchHeaders.c

    r38553 r41475  
    2121  char extname[80], exttype[80], exthead[80], xtension[80];
    2222  HeaderSet *headerSets;
     23
     24  if (!Nheaders) return NULL;
    2325
    2426  ALLOCATE (extsize[0], off_t, Nheaders);
  • trunk/Ohana/src/addstar/src/addstar.c

    r40526 r41475  
    11# include "addstar.h"
     2void help (void);
    23
    34# define RESETTIME { gettimeofday (&startTimer, (void *) NULL); }
     
    2122
    2223  INITTIME;
     24
     25  /* check for help request */
     26  if (get_argument (argc, argv, "-h"    )) help();
     27  if (get_argument (argc, argv, "-help" )) help();
     28  if (get_argument (argc, argv, "--help")) help();
    2329
    2430  SetSignals ();
  • trunk/Ohana/src/addstar/src/args.c

    r40526 r41475  
    11# include "addstar.h"
    2 static void help (void);
     2void help (void);
    33
    44AddstarClientOptions args (int argc, char **argv, AddstarClientOptions options) {
     
    430430}
    431431
    432 static void help () {
     432void help (void) {
    433433
    434434  fprintf (stderr, "USAGE\n");
  • trunk/Ohana/src/addstar/src/args_parallel_client.c

    r38441 r41475  
    106106}
    107107
    108 static void help () {
     108static void help (void) {
    109109
    110110  fprintf (stderr, "USAGE\n");
Note: See TracChangeset for help on using the changeset viewer.