IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20923


Ignore:
Timestamp:
Dec 7, 2008, 1:26:05 PM (17 years ago)
Author:
eugene
Message:

read OBJID and CATID file

Location:
branches/eam_branch_20081124/Ohana/src/libdvo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081124/Ohana/src/libdvo/src/dvo_catalog_mef.c

    r15743 r20923  
    2727  if (!gfits_scan (&catalog[0].header, "NMISS",    "%d", 1, &Nmissing)) return (FALSE);
    2828  if (!gfits_scan (&catalog[0].header, "NSECFILT", "%d", 1, &Nsecfilt)) Nsecfilt = 0;
     29
     30  /* the OBJID is a counter that uniquely defines an average entry and never changes.  if
     31     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);
    2935
    3036  /* save the current number so we can do partial updates */
     
    228234  gfits_modify (&catalog[0].header, "NSECFILT", "%d", 1, Nsecfilt);
    229235  gfits_modify (&catalog[0].header, "EXTEND",   "%t", 1, TRUE);
     236  gfits_modify (&catalog[0].header, "OBJID",    "%d", 1, catalog[0].objID);
    230237
    231238  f = catalog[0].f;
  • branches/eam_branch_20081124/Ohana/src/libdvo/src/dvo_catalog_raw.c

    r16810 r20923  
    2525  if (!gfits_scan (&catalog[0].header, "NMISS",    "%d", 1, &catalog[0].Nmissing)) return (FALSE);
    2626  if (!gfits_scan (&catalog[0].header, "NSECFILT", "%d", 1, &catalog[0].Nsecfilt)) catalog[0].Nsecfilt = 0;
     27
     28  /* the OBJID is a counter that uniquely defines an average entry and never changes.  if
     29     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);
    2733
    2834  /* determine catalog format */
     
    249255  gfits_modify (&catalog[0].header, "NMISS",    "%d", 1, catalog[0].Nmissing);
    250256  gfits_modify (&catalog[0].header, "NSECFILT", "%d", 1, catalog[0].Nsecfilt);
     257  gfits_modify (&catalog[0].header, "OBJID",    "%d", 1, catalog[0].objID);
    251258
    252259  /* specify the appropriate data format */
  • branches/eam_branch_20081124/Ohana/src/libdvo/src/dvo_catalog_split.c

    r17419 r20923  
    174174  if (!gfits_scan (&catalog[0].header, "NMISS",    "%d", 1, &Nmissing)) return (FALSE);
    175175  if (!gfits_scan (&catalog[0].header, "NSECFILT", "%d", 1, &Nsecfilt)) Nsecfilt = 0;
     176
     177  /* the OBJID is a counter that uniquely defines an average entry and never changes.  if
     178     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);
    176182
    177183  /* save the current number so we can do partial updates */
     
    512518  gfits_modify (&catalog[0].header, "NSECFILT", "%d", 1, Nsecfilt);
    513519  gfits_modify (&catalog[0].header, "EXTEND",   "%t", 1, TRUE);
     520  gfits_modify (&catalog[0].header, "OBJID",    "%d", 1, catalog[0].objID);
    514521
    515522  /* in split mode, we can save only part of the data */
     
    712719  gfits_modify (&catalog[0].header, "NSECFILT", "%d", 1, Nsecfilt);
    713720  gfits_modify (&catalog[0].header, "EXTEND",   "%t", 1, TRUE);
     721  gfits_modify (&catalog[0].header, "OBJID",    "%d", 1, catalog[0].objID);
    714722
    715723  /* in split mode, we can save only part of the data */
     
    890898  gfits_modify (&catalog[0].header, "NSECFILT", "%d", 1, Nsecfilt);
    891899  gfits_modify (&catalog[0].header, "EXTEND",   "%t", 1, TRUE);
     900  gfits_modify (&catalog[0].header, "OBJID",    "%d", 1, catalog[0].objID);
    892901
    893902  /* in split mode, we can save only part of the data */
Note: See TracChangeset for help on using the changeset viewer.