IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33403


Ignore:
Timestamp:
Mar 4, 2012, 1:32:12 PM (14 years ago)
Author:
eugene
Message:

add -update-catformat option to relphot to force output db to have desired format

Location:
branches/eam_branches/ipp-20111122/Ohana/src/relphot
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/include/relphot.h

    r33394 r33403  
    134134int    KEEP_UBERCAL;
    135135char  *OUTROOT;
     136char  *UPDATE_CATFORMAT;
    136137int    PLOTDELAY;
    137138int    UpdateAverages;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/args.c

    r33328 r33403  
    162162  }
    163163
     164  UPDATE_CATFORMAT = NULL;
     165  if ((N = get_argument (argc, argv, "-update-catformat"))) {
     166    remove_argument (N, &argc, argv);
     167    UPDATE_CATFORMAT = strcreate (argv[N]);
     168    remove_argument (N, &argc, argv);
     169  }
     170
    164171  SAVE_IMAGE_UPDATES = TRUE;
    165172  if ((N = get_argument (argc, argv, "-skip-image-updates"))) {
     
    444451  } 
    445452
     453  UPDATE_CATFORMAT = NULL;
     454  if ((N = get_argument (argc, argv, "-update-catformat"))) {
     455    remove_argument (N, &argc, argv);
     456    UPDATE_CATFORMAT = strcreate (argv[N]);
     457    remove_argument (N, &argc, argv);
     458  }
     459
    446460  AreaSelect = FALSE;
    447461  if ((N = get_argument (argc, argv, "-area"))) {
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/reload_catalogs.c

    r33364 r33403  
    8787    TIMESTAMP(time5);
    8888
     89    // modify the output format as desired (ignore current format on disk)
     90    if (UPDATE_CATFORMAT) {
     91      catalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT);
     92    }
    8993    dvo_catalog_save (&catalog, VERBOSE);
    9094    dvo_catalog_unlock (&catalog);
     
    152156   
    153157    char tmpline[1024];
    154     if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                                           strcpy (command, tmpline); }
    155     if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                                           strcpy (command, tmpline); }
    156     if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command);                                           strcpy (command, tmpline); }
    157     if (KEEP_UBERCAL)  { snprintf (tmpline, 1024, "%s -keep-ubercal",   command);                    strcpy (command, tmpline); }
    158     if (AreaSelect)    { snprintf (tmpline, 1024, "%s -area %f %f %f %f", command, AreaXmin, AreaXmax, AreaYmin, AreaYmax); strcpy (command, tmpline); }
     158    if (VERBOSE)          { snprintf (tmpline, 1024, "%s -v",                   command);                                         strcpy (command, tmpline); }
     159    if (VERBOSE2)         { snprintf (tmpline, 1024, "%s -vv",                  command);                                         strcpy (command, tmpline); }
     160    if (RESET)            { snprintf (tmpline, 1024, "%s -reset",               command);                                         strcpy (command, tmpline); }
     161    if (KEEP_UBERCAL)     { snprintf (tmpline, 1024, "%s -keep-ubercal",        command);                                         strcpy (command, tmpline); }
     162    if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT);                       strcpy (command, tmpline); }
     163    if (AreaSelect)       { snprintf (tmpline, 1024, "%s -area %f %f %f %f",    command, AreaXmin, AreaXmax, AreaYmin, AreaYmax); strcpy (command, tmpline); }
    159164    if (TimeSelect) {
    160165      char *tstart = ohana_sec_to_date (TSTART);
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot.c

    r33394 r33403  
    217217    dbX.virtual = FALSE;
    218218
    219     // copy Images.dat to another structure
     219    // save Images.dat using the copied structure
     220    if (UPDATE_CATFORMAT) {
     221      // ensure the db format is updated
     222      dbX.format = dvo_catalog_catformat (UPDATE_CATFORMAT);
     223      char photcodeFile[1024];
     224      sprintf (photcodeFile, "%s/Photcodes.dat", CATDIR);
     225      SavePhotcodesFITS (photcodeFile);
     226    }
    220227    dvo_image_save (&dbX, VERBOSE);
    221228    dvo_image_unlock (&dbX);
     
    245252  MARKTIME("-- updated all catalogs: %f sec\n", dtime);
    246253
     254  if (UPDATE_CATFORMAT) {
     255    // ensure the db format is updated
     256    db.format = dvo_catalog_catformat (UPDATE_CATFORMAT);
     257  }
    247258  dvo_image_update (&db, VERBOSE);
    248259  dvo_image_unlock (&db);
Note: See TracChangeset for help on using the changeset viewer.