IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20982


Ignore:
Timestamp:
Dec 14, 2008, 11:50:31 AM (17 years ago)
Author:
eugene
Message:

if OBJID or CATID are missing, just give a warning

Location:
trunk/Ohana/src/libdvo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/src/dvo_catalog_mef.c

    r20936 r20982  
    3030  /* the OBJID is a counter that uniquely defines an average entry and never changes.  if
    3131     it is not defined for a legacy database, we can generate them using the existing index values.
    32      XXX if it is missing, give an error and require the user to upgrade the DB? */
    33   if (!gfits_scan (&catalog[0].header, "OBJID",    "%d", 1, &catalog[0].objID)) return (FALSE);
    34   if (!gfits_scan (&catalog[0].header, "CATID",    "%d", 1, &catalog[0].catID)) return (FALSE);
    35 
     32     If it is missing, give a warning and recommend the user upgrade the DB */
     33  if (!gfits_scan (&catalog[0].header, "OBJID",    "%d", 1, &catalog[0].objID)) {
     34    if (VERBOSE) fprintf (stderr, "WARNING: OBJID is not set for %s: upgrade for full feature set\n", catalog[0].filename);
     35    catalog[0].objID = 0;
     36  }
     37  if (!gfits_scan (&catalog[0].header, "CATID",    "%d", 1, &catalog[0].catID)) {
     38    if (VERBOSE) fprintf (stderr, "WARNING: CATID is not set for %s: upgrade for full feature set\n", catalog[0].filename);
     39    catalog[0].catID = 0;
     40  }
     41 
    3642  /* save the current number so we can do partial updates */
    3743  catalog[0].Naves_disk = Naverage;
  • trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c

    r20936 r20982  
    2828  /* the OBJID is a counter that uniquely defines an average entry and never changes.  if
    2929     it is not defined for a legacy database, we can generate them using the existing index values.
    30      XXX if it is missing, give an error and require the user to upgrade the DB? */
    31   if (!gfits_scan (&catalog[0].header, "OBJID",    "%d", 1, &catalog[0].objID)) return (FALSE);
    32   if (!gfits_scan (&catalog[0].header, "CATID",    "%d", 1, &catalog[0].catID)) return (FALSE);
     30     If it is missing, give a warning and recommend the user upgrade the DB */
     31  if (!gfits_scan (&catalog[0].header, "OBJID",    "%d", 1, &catalog[0].objID)) {
     32    if (VERBOSE) fprintf (stderr, "WARNING: OBJID is not set for this database: upgrade for full feature set\n");
     33    catalog[0].objID = 0;
     34  }
     35  if (!gfits_scan (&catalog[0].header, "CATID",    "%d", 1, &catalog[0].catID)) {
     36    if (VERBOSE) fprintf (stderr, "WARNING: CATID is not set for this database: upgrade for full feature set\n");
     37    catalog[0].catID = 0;
     38  }
    3339
    3440  /* determine catalog format */
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r20936 r20982  
    177177  /* the OBJID is a counter that uniquely defines an average entry and never changes.  if
    178178     it is not defined for a legacy database, we can generate them using the existing index values.
    179      XXX if it is missing, give an error and require the user to upgrade the DB? */
    180   if (!gfits_scan (&catalog[0].header, "OBJID",    "%d", 1, &catalog[0].objID)) return (FALSE);
    181   if (!gfits_scan (&catalog[0].header, "CATID",    "%d", 1, &catalog[0].catID)) return (FALSE);
     179     If it is missing, give a warning and recommend the user upgrade the DB */
     180  if (!gfits_scan (&catalog[0].header, "OBJID",    "%d", 1, &catalog[0].objID)) {
     181    if (VERBOSE) fprintf (stderr, "WARNING: OBJID is not set for this database: upgrade for full feature set\n");
     182    catalog[0].objID = 0;
     183  }
     184  if (!gfits_scan (&catalog[0].header, "CATID",    "%d", 1, &catalog[0].catID)) {
     185    if (VERBOSE) fprintf (stderr, "WARNING: CATID is not set for this database: upgrade for full feature set\n");
     186    catalog[0].catID = 0;
     187  }
    182188
    183189  /* save the current number so we can do partial updates */
Note: See TracChangeset for help on using the changeset viewer.