- Timestamp:
- Apr 22, 2016, 11:30:33 AM (10 years ago)
- Location:
- trunk/Ohana/src/dvolens
- Files:
-
- 3 edited
-
include/dvolens.h (modified) (1 diff)
-
src/args.c (modified) (2 diffs)
-
src/update_objects_catalog.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvolens/include/dvolens.h
r39489 r39550 52 52 53 53 int REPAIR_LENSING_IDS; 54 int REPAIR_LENSING_IDS_FROM_WARPS; 54 55 55 56 DvoLensMode MODE; -
trunk/Ohana/src/dvolens/src/args.c
r39537 r39550 43 43 if ((N = get_argument (argc, argv, "-repair-lensing-ids"))) { 44 44 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; 45 51 remove_argument (N, &argc, argv); 46 52 } … … 182 188 } 183 189 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 184 196 UPDATE = FALSE; 185 197 if ((N = get_argument (argc, argv, "-update"))) { -
trunk/Ohana/src/dvolens/src/update_objects_catalog.c
r39537 r39550 45 45 double time3 = 0.0; 46 46 double time4 = 0.0; 47 48 int NmissLensing = 0; 49 int NmissWarps = 0; 47 50 48 51 for (i = 0; i < catalog->Naverage; i++) { … … 67 70 off_t Loff = average->lensingOffset; 68 71 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 } 69 97 70 98 // I have Nmeasure entries for this object. I need to match measure to lensing (by imageID) … … 327 355 fprintf (stderr, "done with %d aves (%f %f %f %f)\n", (int) catalog->Naverage, time1, time2, time3, time4); 328 356 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); 330 360 331 361 catalog->Nlensobj = Nlensobj;
Note:
See TracChangeset
for help on using the changeset viewer.
