IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2015, 4:49:06 PM (11 years ago)
Author:
eugene
Message:

extensive work on relphot, relastro, uniphot, dvomerge aiming to the construction and calibration of PV3

Location:
trunk/Ohana
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/relphot/include/relphot.h

    r38466 r38986  
    1414// # define IDX_T off_t
    1515# define IDX_T int
     16
     17typedef enum {
     18  STAGE_CHIP  = 0x01,
     19  STAGE_WARP  = 0x02,
     20  STAGE_STACK = 0x04,
     21} RelphotStages;
    1622
    1723typedef enum {
     
    327333int USE_BASIC_CHECK;
    328334int USE_FULL_OVERLAP;
     335
     336RelphotStages STAGES;
    329337
    330338# ifdef GRID_V1
  • trunk/Ohana/src/relphot/src/Shutdown.c

    r37037 r38986  
    2121  va_end (argp);
    2222
    23   SetProtect (TRUE);
    24   if (db) gfits_db_close (db);
    2523  fprintf (stderr, "ERROR: relphot halted\n");
    2624  exit (1);
  • trunk/Ohana/src/relphot/src/args.c

    r38466 r38986  
    344344  }
    345345
     346  STAGES = STAGE_CHIP | STAGE_WARP | STAGE_STACK;
     347  if ((N = get_argument (argc, argv, "-skip-chip"))) {
     348    remove_argument (N, &argc, argv);
     349    STAGES &= ~STAGE_CHIP;
     350  }
     351  if ((N = get_argument (argc, argv, "-skip-warp"))) {
     352    remove_argument (N, &argc, argv);
     353    STAGES &= ~STAGE_WARP;
     354  }
     355  if ((N = get_argument (argc, argv, "-skip-stack"))) {
     356    remove_argument (N, &argc, argv);
     357    STAGES &= ~STAGE_STACK;
     358  }
     359  if (!STAGES) {
     360    fprintf (stderr, "ERROR: no valid stages selected\n");
     361    exit (3);
     362  }
     363
    346364  REGION_FILE = NULL;
    347365  if ((N = get_argument (argc, argv, "-region-hosts"))) {
     
    664682  }
    665683
     684  STAGES = STAGE_CHIP | STAGE_WARP | STAGE_STACK;
     685  if ((N = get_argument (argc, argv, "-skip-chip"))) {
     686    remove_argument (N, &argc, argv);
     687    STAGES &= ~STAGE_CHIP;
     688  }
     689  if ((N = get_argument (argc, argv, "-skip-warp"))) {
     690    remove_argument (N, &argc, argv);
     691    STAGES &= ~STAGE_WARP;
     692  }
     693  if ((N = get_argument (argc, argv, "-skip-stack"))) {
     694    remove_argument (N, &argc, argv);
     695    STAGES &= ~STAGE_STACK;
     696  }
     697  if (!STAGES) {
     698    fprintf (stderr, "ERROR: no valid stages selected\n");
     699    exit (3);
     700  }
     701
    666702  if ((MODE == MODE_SYNTH_PHOT)  && (argc == 1)) return TRUE;
    667703  if ((MODE == MODE_UPDATE_OBJECTS)  && (argc == 1)) return TRUE;
  • trunk/Ohana/src/relphot/src/load_catalogs.c

    r38471 r38986  
    253253  Catalog *catalog = catalogs->catalog;
    254254  *Ncatalog = catalogs->Ncatalog;
    255   BrightCatalogSplitFree (catalogs);
    256255
    257256  int Nmeasure = 0;
     
    263262
    264263  fprintf (stderr, "loaded %d catalogs, using a total of %d stars (%d measures)\n", catalogs->Ncatalog, Naverage, Nmeasure);
     264  client_logger_message ("loaded %d catalogs, using a total of %d stars (%d measures)\n", catalogs->Ncatalog, Naverage, Nmeasure);
     265
     266  BrightCatalogSplitFree (catalogs);
    265267
    266268  return (catalog);
  • trunk/Ohana/src/relphot/src/load_images.c

    r38441 r38986  
    3131  MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime);
    3232
     33  // XXX consider allowing relphot to skip the AstroMap load (do we need precise astrometry here?)
     34
    3335  char mapfile[DVO_MAX_PATH];
    3436  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
    35   AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, VERBOSE);
     37  AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
    3638
    3739  // assign images.coords.offsetMap -> table->map[i]
  • trunk/Ohana/src/relphot/src/reload_catalogs.c

    r38471 r38986  
    105105    free (moddate);
    106106
    107     dvo_catalog_save (&catalog, VERBOSE);
    108     dvo_catalog_unlock (&catalog);
     107    SetProtect (TRUE);
     108    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     109    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     110    SetProtect (FALSE);
    109111
    110112    free_tiny_values(&catalog);
     
    244246    if (SYNTH_ZERO_POINTS) { strextend (&command, "-synthphot-zpts %s", SYNTH_ZERO_POINTS); }
    245247
     248    if (!(STAGES & STAGE_CHIP))  { strextend (&command, "-skip-chip"); }
     249    if (!(STAGES & STAGE_WARP))  { strextend (&command, "-skip-warp"); }
     250    if (!(STAGES & STAGE_STACK)) { strextend (&command, "-skip-stack"); }
     251
    246252    // deprecate
    247253    // if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", SET_MREL_VERSION); } // XXXX deprecate this...
  • trunk/Ohana/src/relphot/src/relphot.c

    r38062 r38986  
    44
    55  // get configuration info, args
     6  SetSignals ();
    67  RelphotMode mode = initialize (argc, argv);
    78  if (!mode) exit (2);
  • trunk/Ohana/src/relphot/src/relphot_client.c

    r38062 r38986  
    1818
    1919  // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc)
     20  SetSignals ();
    2021  initialize_client (argc, argv);
    2122  client_logger_init (HOSTDIR);
  • trunk/Ohana/src/relphot/src/relphot_objects.c

    r38471 r38986  
    101101    // but it would be better to define a dvo crawler program to do this
    102102    // catalog.catformat = DVO_FORMAT_PS1_V1; 
    103     dvo_catalog_save (&catalog, VERBOSE);
    104     dvo_catalog_unlock (&catalog);
     103    SetProtect (TRUE);
     104    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     105    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     106    SetProtect (FALSE);
    105107    free_tiny_values(&catalog);
    106108    dvo_catalog_free (&catalog);
     
    155157    if (SYNTH_ZERO_POINTS) { strextend (&command, "-synthphot-zpts %s", SYNTH_ZERO_POINTS); }
    156158
     159    if (!(STAGES & STAGE_CHIP))  { strextend (&command, "-skip-chip"); }
     160    if (!(STAGES & STAGE_WARP))  { strextend (&command, "-skip-warp"); }
     161    if (!(STAGES & STAGE_STACK)) { strextend (&command, "-skip-stack"); }
     162
    157163    // if (SET_MREL_VERSION != 1) { strextend (&command, "-set-mrel-version %d", SET_MREL_VERSION); }
    158164
  • trunk/Ohana/src/relphot/src/relphot_parallel_images.c

    r37037 r38986  
    3434    exit (2);
    3535  }
     36  client_logger_message ("loaded images\n");
    3637
    3738  // once we have read this table, we should remove it for repeat runs
     
    5354  // the following function correctly chooses the sky regions on the 0,360 boundary
    5455  SkyList *skylist = SkyListByBounds (sky, -1, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
     56  client_logger_message ("prepare to load catalogs\n");
    5557
    5658  /* load catalog data from region files (hostID is 0 since we are not a client */
  • trunk/Ohana/src/relphot/src/relphot_synthphot.c

    r38471 r38986  
    7171    // but it would be better to define a dvo crawler program to do this
    7272    // catalog.catformat = DVO_FORMAT_PS1_V1; 
    73     dvo_catalog_save (&catalog, VERBOSE);
    74     dvo_catalog_unlock (&catalog);
     73    SetProtect (TRUE);
     74    if (!dvo_catalog_save (&catalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save %s\n", catalog.filename); exit (1); }
     75    if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); }
     76    SetProtect (FALSE);
    7577    dvo_catalog_free (&catalog);
    7678  }
  • trunk/Ohana/src/relphot/src/setMrelCatalog.c

    r38923 r38986  
    5252  for (j = 0; j < catalog[Nc].Naverage; j++) {
    5353
    54     setMrelAverageExposure (&catalog[Nc], Nc, j, Nsecfilt, isSetMrelFinal, flatcorr, results);
     54    if (STAGES & STAGE_CHIP) {
     55      setMrelAverageExposure (&catalog[Nc], Nc, j, Nsecfilt, isSetMrelFinal, flatcorr, results);
     56    }
    5557
    5658    // only apply Stack operation on setMrelFinal in first pass
    57     if (isSetMrelFinal && !IS_DIFF_DB) {
     59    if (isSetMrelFinal && (STAGES & STAGE_STACK) && !IS_DIFF_DB) {
    5860      setMrelAverageStack (&catalog[Nc], Nc, j, Nsecfilt, flatcorr);
    5961    }
    6062
    6163    // only measure force-warp mean values if issetMrelFinal (make it optional?)
    62     if (isSetMrelFinal) {
     64    if (isSetMrelFinal && (STAGES & STAGE_WARP)) {
    6365      setMrelAverageForcedWarp (&catalog[Nc], Nc, j, Nsecfilt, flatcorr, results);
    6466    }
Note: See TracChangeset for help on using the changeset viewer.