IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39487


Ignore:
Timestamp:
Mar 27, 2016, 3:21:04 PM (10 years ago)
Author:
eugene
Message:

adding option to repair the lensing.imageID based on the warp measure.imageID values

Location:
trunk/Ohana/src/dvolens
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvolens/Makefile

    r38153 r39487  
    2323
    2424DVOLENS = \
     25$(SRC)/load_images.$(ARCH).o     \
     26$(SRC)/select_images.$(ARCH).o   \
     27$(SRC)/WarpImageMaps.$(ARCH).o   \
    2528$(SRC)/ConfigInit.$(ARCH).o      \
    2629$(SRC)/SetSignals.$(ARCH).o      \
     
    3942
    4043DVOLENS_CLIENT = \
     44$(SRC)/load_images.$(ARCH).o     \
     45$(SRC)/select_images.$(ARCH).o   \
     46$(SRC)/WarpImageMaps.$(ARCH).o   \
    4147$(SRC)/ConfigInit.$(ARCH).o      \
    4248$(SRC)/SetSignals.$(ARCH).o      \
  • trunk/Ohana/src/dvolens/include/dvolens.h

    r38986 r39487  
    2727char   CATMODE[16];    /* raw, mef, split, mysql */
    2828char   CATFORMAT[16];  /* internal, elixir, loneos, panstarrs */
     29char   ImageCat[DVO_MAX_PATH];
    2930
    3031int    HOST_ID;
     
    3940int    UPDATE;
    4041int    NTHREADS;
     42
     43int    REPAIR_LENSING_IDS;
    4144
    4245DvoLensMode MODE;
     
    8285int myIndexSetEntry (myIndexType *myIndex, int value, int entry);
    8386int myIndexGetEntry (myIndexType *myIndex, int value);
     87
     88int FindWarpGroups (void);
     89int RecoverLensingIndex (Average *average, myIndexType *measureIndex, Lensing *lensing);
     90void FreeWarpGroups (void);
     91
     92int isGPC1warp (int photcode);
     93
     94Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t *Nimage);
     95
     96int load_images (SkyList *skylist);
     97void free_images (void);
     98Image *getimages (off_t *N);
     99off_t getImageByID (off_t ID);
     100
  • trunk/Ohana/src/dvolens/src/ConfigInit.c

    r39484 r39487  
    2121  CATDIR = abspath (tmpcatdir, DVO_MAX_PATH);
    2222  free (tmpcatdir);
     23
     24  snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR);
    2325
    2426  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
  • trunk/Ohana/src/dvolens/src/args.c

    r37358 r39487  
    3737  if ((N = get_argument (argc, argv, "-vv"))) {
    3838    VERBOSE2 = VERBOSE = TRUE;
     39    remove_argument (N, &argc, argv);
     40  }
     41
     42  REPAIR_LENSING_IDS = FALSE;
     43  if ((N = get_argument (argc, argv, "-repair-lensing-ids"))) {
     44    REPAIR_LENSING_IDS = TRUE;
    3945    remove_argument (N, &argc, argv);
    4046  }
     
    162168  }
    163169
     170  REPAIR_LENSING_IDS = FALSE;
     171  if ((N = get_argument (argc, argv, "-repair-lensing-ids"))) {
     172    REPAIR_LENSING_IDS = TRUE;
     173    remove_argument (N, &argc, argv);
     174  }
     175
    164176  UPDATE = FALSE;
    165177  if ((N = get_argument (argc, argv, "-update"))) {
  • trunk/Ohana/src/dvolens/src/dvolens.c

    r39484 r39487  
    1313      FREE (UserCatalog);
    1414      FREE (CATDIR);
     15      free_images();
     16      FreeWarpGroups();
    1517      ohana_memcheck (VERBOSE);
    1618      ohana_memdump (VERBOSE);
  • trunk/Ohana/src/dvolens/src/dvolens_client.c

    r39484 r39487  
    1919      FREE (HOSTDIR);
    2020      FREE (CATDIR);
     21      free_images();
     22      FreeWarpGroups();
    2123      ohana_memcheck (VERBOSE);
    2224      ohana_memdump (VERBOSE);
  • trunk/Ohana/src/dvolens/src/update_objects.c

    r39484 r39487  
    3737
    3838  if (VERBOSE) fprintf (stderr, "re-loading catalog data\n");
     39
     40  // XXX I need to load enough of the images to load the warp groups
     41
     42  if (REPAIR_LENSING_IDS) {
     43    load_images (skylist);
     44    FindWarpGroups();
     45  }
    3946
    4047  /* load data from each region file */
     
    150157    table->hosts[i].pathname = tmppath;
    151158
    152     char command[1024];
    153     snprintf (command, 1024, "dvolens_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f",
    154               table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    155               UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    156 
    157     // options & configs which affect dvolens_client -update-catalogs
     159    char *command = NULL;
     160    strextend (&command, "dvolens_client -update-objects");
     161    strextend (&command, "-hostID %d", table->hosts[i].hostID);
     162    strextend (&command, "-D CATDIR %s", CATDIR);
     163    strextend (&command, "-hostdir %s", table->hosts[i].pathname);
     164    strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
     165
     166    // options & configs which affect dvolens_client -update-catalogs:
    158167    // VERBOSE, VERBOSE2, UPDATE
    159    
    160     char tmpline[1024];
    161     if (VERBOSE)          { snprintf (tmpline, 1024, "%s -v",                   command);                                         strcpy (command, tmpline); }
    162     if (VERBOSE2)         { snprintf (tmpline, 1024, "%s -vv",                  command);                                         strcpy (command, tmpline); }
    163     if (UPDATE)           { snprintf (tmpline, 1024, "%s -update",              command);                                         strcpy (command, tmpline); }
     168
     169    if (VERBOSE)            strextend (&command, "-v");
     170    if (VERBOSE2)           strextend (&command, "-vv");
     171    if (UPDATE)             strextend (&command, "-update");
     172    if (REPAIR_LENSING_IDS) strextend (&command, "-repair-lensing-ids");
    164173
    165174    fprintf (stderr, "command: %s\n", command);
    166175
    167176    if (PARALLEL_MANUAL) {
     177      free (command);
    168178      continue;
    169179    }
     
    185195      table->hosts[i].pid = pid; // save for future reference
    186196    }
     197    free (command);
    187198  }
    188199
     
    198209    }
    199210  }
     211
     212  FreeHostTable (table);
    200213  return (TRUE);
    201214}     
  • trunk/Ohana/src/dvolens/src/update_objects_catalog.c

    r39484 r39487  
    8383
    8484      Mj = myIndexGetEntry (measureIndex, lensing->imageID);
     85
     86      // if we are unable to find a match in the measure table, we may have the wrong
     87      // imageID.  there was a bug in which we only matched to the correct warp obstime,
     88      // but got the wrong skycell.  if this is the case, we can try to recover by finding
     89      // the set of warps which match our obstime, then choosing the one from that set
     90      // which matches one of our warps.
     91      if ((Mj < 0) && REPAIR_LENSING_IDS) {
     92        Mj = RecoverLensingIndex (average, measureIndex, lensing);
     93      }
    8594      myAssert (Mj > -1, "missing index");
    8695
Note: See TracChangeset for help on using the changeset viewer.