IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39550


Ignore:
Timestamp:
Apr 22, 2016, 11:30:33 AM (10 years ago)
Author:
eugene
Message:

repair lensing assuming sequence matches warps

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvolens/include/dvolens.h

    r39489 r39550  
    5252
    5353int    REPAIR_LENSING_IDS;
     54int    REPAIR_LENSING_IDS_FROM_WARPS;
    5455
    5556DvoLensMode MODE;
  • trunk/Ohana/src/dvolens/src/args.c

    r39537 r39550  
    4343  if ((N = get_argument (argc, argv, "-repair-lensing-ids"))) {
    4444    REPAIR_LENSING_IDS = TRUE;
     45    remove_argument (N, &argc, argv);
     46  }
     47
     48  REPAIR_LENSING_IDS_FROM_WARPS = FALSE;
     49  if ((N = get_argument (argc, argv, "-repair-lensing-ids-from-warps"))) {
     50    REPAIR_LENSING_IDS_FROM_WARPS = TRUE;
    4551    remove_argument (N, &argc, argv);
    4652  }
     
    182188  }
    183189
     190  REPAIR_LENSING_IDS_FROM_WARPS = FALSE;
     191  if ((N = get_argument (argc, argv, "-repair-lensing-ids-from-warps"))) {
     192    REPAIR_LENSING_IDS_FROM_WARPS = TRUE;
     193    remove_argument (N, &argc, argv);
     194  }
     195
    184196  UPDATE = FALSE;
    185197  if ((N = get_argument (argc, argv, "-update"))) {
  • trunk/Ohana/src/dvolens/src/update_objects_catalog.c

    r39537 r39550  
    4545  double time3 = 0.0;
    4646  double time4 = 0.0;
     47
     48  int NmissLensing = 0;
     49  int NmissWarps   = 0;
    4750
    4851  for (i = 0; i < catalog->Naverage; i++) {
     
    6770    off_t Loff = average->lensingOffset;
    6871    off_t Moff = average->measureOffset;
     72
     73    // repair lensing imageID values by asserting the warp measurements and lensing measurements are in the same order
     74    if (REPAIR_LENSING_IDS_FROM_WARPS) {
     75      int Nmatch = 0;
     76      for (Mj = 0, Lj = 0; (Mj < average->Nmeasure) && (Lj < average->Nlensing); Mj++) {
     77        Measure *measure = &catalog->measure[Moff + Mj];
     78        if (!isGPC1warp(measure->photcode)) continue;
     79       
     80        Lensing *lensing = &catalog->lensing[Loff + Lj];
     81        if (lensing->detID == measure->detID) {
     82          lensing->oldImID = lensing->imageID;
     83          lensing->imageID = measure->imageID;
     84          Nmatch ++;
     85        }
     86        Lj ++;
     87      }
     88      if (Nmatch != Lj) { NmissLensing ++; }
     89     
     90      while (Mj < average->Nmeasure) {
     91        Measure *measure = &catalog->measure[Moff + Mj];
     92        Mj ++;
     93        if (!isGPC1warp(measure->photcode)) continue;
     94        NmissWarps ++;
     95      }
     96    }     
    6997
    7098    // I have Nmeasure entries for this object.  I need to match measure to lensing (by imageID)
     
    327355  fprintf (stderr, "done with %d aves (%f %f %f %f)\n", (int) catalog->Naverage, time1, time2, time3, time4);
    328356
    329   fprintf (stderr, "corrected %d lensing IDs, failed on %d lensing IDs\n", Nfixed, Nfailed);
     357  if (REPAIR_LENSING_IDS) fprintf (stderr, "corrected %d lensing IDs, failed on %d lensing IDs\n", Nfixed, Nfailed);
     358
     359  if (REPAIR_LENSING_IDS_FROM_WARPS) fprintf (stderr, "missed %d lensing IDs, %d warps\n", NmissLensing, NmissWarps);
    330360
    331361  catalog->Nlensobj = Nlensobj;
Note: See TracChangeset for help on using the changeset viewer.