Changeset 24557 for branches/eam_branches/20090522/psModules/src/objects
- Timestamp:
- Jun 25, 2009, 2:00:56 PM (17 years ago)
- Location:
- branches/eam_branches/20090522
- Files:
-
- 10 edited
- 1 copied
-
. (modified) (1 prop)
-
psModules (modified) (1 prop)
-
psModules/src/objects/Makefile.am (modified) (1 diff)
-
psModules/src/objects/pmFootprintArraysMerge.c (modified) (3 diffs)
-
psModules/src/objects/pmMoments.c (modified) (1 diff)
-
psModules/src/objects/pmSource.c (modified) (6 diffs)
-
psModules/src/objects/pmSourceIO.c (modified) (4 diffs)
-
psModules/src/objects/pmSourceIO.h (modified) (2 diffs)
-
psModules/src/objects/pmSourceIO_CMF_PS1_V2.c (copied) (copied from trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c )
-
psModules/src/objects/pmSourceIO_MatchedRefs.c (modified) (4 diffs)
-
psModules/src/objects/pmSourceMatch.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090522
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/psModules
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/psModules/src/objects/Makefile.am
r23990 r24557 38 38 pmSourceIO_PS1_CAL_0.c \ 39 39 pmSourceIO_CMF_PS1_V1.c \ 40 pmSourceIO_CMF_PS1_V2.c \ 40 41 pmSourceIO_MatchedRefs.c \ 41 42 pmSourcePlots.c \ -
branches/eam_branches/20090522/psModules/src/objects/pmFootprintArraysMerge.c
r20937 r24557 28 28 */ 29 29 psArray *pmFootprintArraysMerge(const psArray *footprints1, // one set of footprints 30 const psArray *footprints2, // the other set 31 const int includePeaks) { // which peaks to set? 0x1 => footprints1, 0x2 => 2 32 assert (footprints1->n == 0 || pmFootprintTest(footprints1->data[0])); 33 assert (footprints2->n == 0 || pmFootprintTest(footprints2->data[0])); 30 const psArray *footprints2, // the other set 31 const int includePeaks // which peaks to set? 0x1 => footprints1, 0x2 => 2 32 ) 33 { 34 if (!footprints1 && !footprints2) { 35 // No footprints in merged array 36 return psArrayAllocEmpty(0); 37 } 34 38 35 if (footprints1->n == 0 || footprints2->n == 0) { // nothing to do but put copies on merged36 const psArray *old = (footprints1->n == 0) ? footprints2 : footprints1;39 assert(!footprints1 || footprints1->n == 0 || pmFootprintTest(footprints1->data[0])); 40 assert(!footprints2 || footprints2->n == 0 || pmFootprintTest(footprints2->data[0])); 37 41 38 psArray *merged = psArrayAllocEmpty(old->n); 39 for (int i = 0; i < old->n; i++) { 40 psArrayAdd(merged, 1, old->data[i]); 41 } 42 43 return merged; 42 if (!footprints1 || footprints1->n == 0 || !footprints2 || footprints2->n == 0) { 43 // nothing to do but put copies on merged 44 const psArray *old = (!footprints1 || footprints1->n == 0) ? footprints2 : footprints1; 45 46 psArray *merged = psArrayAllocEmpty(old->n); 47 for (int i = 0; i < old->n; i++) { 48 psArrayAdd(merged, 1, old->data[i]); 49 } 50 51 return merged; 44 52 } 45 53 /* … … 48 56 */ 49 57 { 50 pmFootprint *fp1 = footprints1->data[0];51 pmFootprint *fp2 = footprints2->data[0];52 if (fp1->region.x0 != fp2->region.x0 ||53 fp1->region.x1 != fp2->region.x1 ||54 fp1->region.y0 != fp2->region.y0 ||55 fp1->region.y1 != fp2->region.y1) {56 psError(PS_ERR_BAD_PARAMETER_SIZE, true,57 "The two pmFootprint arrays correspnond to different-sized regions");58 return NULL;59 }58 pmFootprint *fp1 = footprints1->data[0]; 59 pmFootprint *fp2 = footprints2->data[0]; 60 if (fp1->region.x0 != fp2->region.x0 || 61 fp1->region.x1 != fp2->region.x1 || 62 fp1->region.y0 != fp2->region.y0 || 63 fp1->region.y1 != fp2->region.y1) { 64 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 65 "The two pmFootprint arrays correspnond to different-sized regions"); 66 return NULL; 67 } 60 68 } 61 69 /* … … 72 80 * Now assign the peaks appropriately. We could do this more efficiently 73 81 * using idImage (which we just freed), but this is easy and probably fast enough 74 */ 82 */ 75 83 if (includePeaks & 0x1) { 76 psArray *peaks = pmFootprintArrayToPeaks(footprints1);77 pmFootprintsAssignPeaks(merged, peaks);78 psFree(peaks);84 psArray *peaks = pmFootprintArrayToPeaks(footprints1); 85 pmFootprintsAssignPeaks(merged, peaks); 86 psFree(peaks); 79 87 } 80 88 81 89 if (includePeaks & 0x2) { 82 psArray *peaks = pmFootprintArrayToPeaks(footprints2);83 pmFootprintsAssignPeaks(merged, peaks);84 psFree(peaks);90 psArray *peaks = pmFootprintArrayToPeaks(footprints2); 91 pmFootprintsAssignPeaks(merged, peaks); 92 psFree(peaks); 85 93 } 86 94 87 95 return merged; 88 96 } -
branches/eam_branches/20090522/psModules/src/objects/pmMoments.c
r23487 r24557 51 51 tmp->Sky = 0.0; 52 52 tmp->nPixels = 0; 53 tmp->SN = 0; 53 54 54 55 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); -
branches/eam_branches/20090522/psModules/src/objects/pmSource.c
r24529 r24557 480 480 481 481 if (!psVectorStats (stats, tmpSx, NULL, NULL, 0)) { 482 psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats");482 psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats"); 483 483 return (emptyClump); 484 }484 } 485 485 psfClump.X = stats->clippedMean; 486 486 psfClump.dX = stats->clippedStdev; 487 487 488 488 if (!psVectorStats (stats, tmpSy, NULL, NULL, 0)) { 489 psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats");489 psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats"); 490 490 return (emptyClump); 491 }491 } 492 492 psfClump.Y = stats->clippedMean; 493 493 psfClump.dY = stats->clippedStdev; … … 548 548 pmSource *source = (pmSource *) sources->data[i]; 549 549 550 // psf clumps are found for image subregions:551 // skip sources not in this region 550 // psf clumps are found for image subregions: 551 // skip sources not in this region 552 552 if (source->peak->x < region->x0) continue; 553 553 if (source->peak->x >= region->x1) continue; 554 554 if (source->peak->y < region->y0) continue; 555 if (source->peak->y >= region->y1) continue;556 557 // should be set by pmSourceAlloc555 if (source->peak->y >= region->y1) continue; 556 557 // should be set by pmSourceAlloc 558 558 psAssert (source->type == PM_SOURCE_TYPE_UNKNOWN, "source type was not init-ed?"); 559 559 … … 561 561 if (!source->moments) { 562 562 source->type = PM_SOURCE_TYPE_STAR; 563 psAssert (source->mode & noMoments, "why is this source missing moments?");563 psAssert (source->mode & noMoments, "why is this source missing moments?"); 564 564 Nstar++; 565 565 continue; … … 596 596 } 597 597 598 // likely defect (too small to be stellar) (push out to 3 sigma) 599 // low S/N objects which are small are probably stellar 600 // only set candidate defects if 601 // XXX these limits are quite arbitrary 602 if ((sigX < 0.05) || (sigY < 0.05)) { 603 source->type = PM_SOURCE_TYPE_DEFECT; 604 source->mode |= PM_SOURCE_MODE_DEFECT; 605 Ncr ++; 606 continue; 607 } 608 609 // likely unsaturated extended source (too large to be stellar) 610 if ((sigX > (clump.X + 3*clump.dX)) || (sigY > (clump.Y + 3*clump.dY))) { 611 source->type = PM_SOURCE_TYPE_EXTENDED; 612 Next ++; 613 continue; 614 } 615 616 // the rest are probable stellar objects 617 starsn_moments->data.F32[starsn_moments->n] = source->moments->SN; 618 starsn_moments->n ++; 619 starsn_peaks->data.F32[starsn_peaks->n] = source->peak->SN; 620 starsn_peaks->n ++; 621 Nstar ++; 622 623 // PSF star (within 1.5 sigma of clump center, S/N > limit) 624 psF32 radius = hypot ((sigX-clump.X)/clump.dX, (sigY-clump.Y)/clump.dY); 625 if ((source->moments->SN > PSF_SN_LIM) && (radius < PSF_CLUMP_NSIGMA)) { 626 source->type = PM_SOURCE_TYPE_STAR; 627 source->mode |= PM_SOURCE_MODE_PSFSTAR; 628 Npsf ++; 629 continue; 598 // The following determinations require the use of moments 599 if (!(source->mode & noMoments)) { 600 // likely defect (too small to be stellar) (push out to 3 sigma) 601 // low S/N objects which are small are probably stellar 602 // XXX these limits are quite arbitrary 603 if (sigX < 0.05 || sigY < 0.05) { 604 source->type = PM_SOURCE_TYPE_DEFECT; 605 source->mode |= PM_SOURCE_MODE_DEFECT; 606 Ncr ++; 607 continue; 608 } 609 610 // likely unsaturated extended source (too large to be stellar) 611 if (sigX > clump.X + 3*clump.dX || sigY > clump.Y + 3*clump.dY) { 612 source->type = PM_SOURCE_TYPE_EXTENDED; 613 Next ++; 614 continue; 615 } 616 617 // the rest are probable stellar objects 618 starsn_moments->data.F32[starsn_moments->n] = source->moments->SN; 619 starsn_moments->n ++; 620 starsn_peaks->data.F32[starsn_peaks->n] = source->peak->SN; 621 starsn_peaks->n ++; 622 Nstar ++; 623 624 // PSF star (within 1.5 sigma of clump center, S/N > limit) 625 psF32 radius = hypot ((sigX-clump.X)/clump.dX, (sigY-clump.Y)/clump.dY); 626 if ((source->moments->SN > PSF_SN_LIM) && (radius < PSF_CLUMP_NSIGMA)) { 627 source->type = PM_SOURCE_TYPE_STAR; 628 source->mode |= PM_SOURCE_MODE_PSFSTAR; 629 Npsf ++; 630 continue; 631 } 630 632 } 631 633 … … 642 644 643 645 if (!psVectorStats (stats, starsn_moments, NULL, NULL, 0)) { 644 psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats");645 psFree (stats);646 psFree (starsn_peaks);647 return false;646 psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats"); 647 psFree (stats); 648 psFree (starsn_peaks); 649 return false; 648 650 } 649 651 psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats->min, stats->max); … … 656 658 stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX); 657 659 if (!psVectorStats (stats, starsn_peaks, NULL, NULL, 0)) { 658 psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats");659 psFree (stats);660 psFree (starsn_peaks);661 return false;660 psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats"); 661 psFree (stats); 662 psFree (starsn_peaks); 663 return false; 662 664 } 663 665 psLogMsg ("psModules.objects", 3, "SN range (peaks) : %f - %f (%ld)\n", -
branches/eam_branches/20090522/psModules/src/objects/pmSourceIO.c
r23990 r24557 496 496 status = pmSourcesWrite_CMF_PS1_V1 (file->fits, readout, sources, file->header, outhead, dataname); 497 497 } 498 if (!strcmp (exttype, "PS1_V2")) { 499 status = pmSourcesWrite_CMF_PS1_V2 (file->fits, readout, sources, file->header, outhead, dataname); 500 } 498 501 if (xsrcname) { 499 502 if (!strcmp (exttype, "PS1_DEV_1")) { … … 506 509 status = pmSourcesWrite_CMF_PS1_V1_XSRC (file->fits, sources, xsrcname, recipe); 507 510 } 511 if (!strcmp (exttype, "PS1_V2")) { 512 status = pmSourcesWrite_CMF_PS1_V2_XSRC (file->fits, sources, xsrcname, recipe); 513 } 508 514 } 509 515 if (xfitname) { … … 517 523 status = pmSourcesWrite_CMF_PS1_V1_XFIT (file->fits, sources, xfitname); 518 524 } 525 if (!strcmp (exttype, "PS1_V2")) { 526 status = pmSourcesWrite_CMF_PS1_V2_XFIT (file->fits, sources, xfitname); 527 } 519 528 } 520 529 if (!status) { … … 944 953 sources = pmSourcesRead_CMF_PS1_V1 (file->fits, hdu->header); 945 954 } 955 if (!strcmp (exttype, "PS1_V2")) { 956 sources = pmSourcesRead_CMF_PS1_V2 (file->fits, hdu->header); 957 } 946 958 } 947 959 -
branches/eam_branches/20090522/psModules/src/objects/pmSourceIO.h
r23990 r24557 39 39 bool pmSourcesWrite_CMF_PS1_V1_XFIT (psFits *fits, psArray *sources, char *extname); 40 40 41 bool pmSourcesWrite_CMF_PS1_V2 (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 42 bool pmSourcesWrite_CMF_PS1_V2_XSRC (psFits *fits, psArray *sources, char *extname, psMetadata *recipe); 43 bool pmSourcesWrite_CMF_PS1_V2_XFIT (psFits *fits, psArray *sources, char *extname); 44 41 45 bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, pmConfig *config); 42 46 … … 48 52 psArray *pmSourcesRead_PS1_CAL_0 (psFits *fits, psMetadata *header); 49 53 psArray *pmSourcesRead_CMF_PS1_V1 (psFits *fits, psMetadata *header); 54 psArray *pmSourcesRead_CMF_PS1_V2 (psFits *fits, psMetadata *header); 50 55 51 56 bool pmSourcesWritePSFs (psArray *sources, char *filename); -
branches/eam_branches/20090522/psModules/src/objects/pmSourceIO_MatchedRefs.c
r24025 r24557 49 49 pmCell *cell = NULL; 50 50 pmReadout *readout = NULL; 51 pmFPAview *view = pmFPAviewAlloc (0);52 51 53 52 // first, check if there are any matches to be written … … 57 56 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSASTRO"); 58 57 if (!status) { 59 psError(PS_ERR_UNKNOWN, true, "missing recipe PSASTRO in config data");60 return false;58 psError(PS_ERR_UNKNOWN, true, "missing recipe PSASTRO in config data"); 59 return false; 61 60 } 62 61 … … 65 64 66 65 psArray *table = psArrayAllocEmpty (0x1000); 66 pmFPAview *view = pmFPAviewAlloc (0); 67 67 68 68 // this loop selects the matched stars for all chips … … 70 70 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 71 71 if (!chip->process || !chip->file_exists) continue; 72 73 char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME");74 72 75 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 73 char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); 74 75 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 76 76 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 77 77 if (!cell->process || !cell->file_exists) continue; 78 78 79 // process each of the readouts80 // XXX there can only be one readout per chip, right?81 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {82 if (! readout->data_exists) continue;79 // process each of the readouts 80 // XXX there can only be one readout per chip, right? 81 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) { 82 if (! readout->data_exists) continue; 83 83 84 // select the raw objects for this readout85 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");86 if (rawstars == NULL) continue;84 // select the raw objects for this readout 85 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS"); 86 if (rawstars == NULL) continue; 87 87 88 // select the raw objects for this readout89 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");90 if (refstars == NULL) continue;91 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);88 // select the raw objects for this readout 89 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS"); 90 if (refstars == NULL) continue; 91 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n); 92 92 93 psArray *matches = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH");94 if (matches == NULL) continue;93 psArray *matches = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH"); 94 if (matches == NULL) continue; 95 95 96 for (int i = 0; i < matches->n; i++) {97 pmAstromMatch *match = matches->data[i];96 for (int i = 0; i < matches->n; i++) { 97 pmAstromMatch *match = matches->data[i]; 98 98 99 pmAstromObj *raw = rawstars->data[match->raw];100 pmAstromObj *ref = refstars->data[match->ref];99 pmAstromObj *raw = rawstars->data[match->raw]; 100 pmAstromObj *ref = refstars->data[match->ref]; 101 101 102 psMetadata *row = psMetadataAlloc ();103 psMetadataAdd (row, PS_LIST_TAIL, "RA", PS_DATA_F64, "right ascension (deg, J2000)", PM_DEG_RAD*ref->sky->r);104 psMetadataAdd (row, PS_LIST_TAIL, "DEC", PS_DATA_F64, "declination (deg, J2000)", PM_DEG_RAD*ref->sky->d);105 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP", PS_DATA_F32, "x coord on chip",raw->chip->x);106 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP", PS_DATA_F32, "y coord on chip", raw->chip->y); 107 psMetadataAdd (row, PS_LIST_TAIL, "X_FPA", PS_DATA_F32, "x coord on focal plane", raw->FP->x);108 psMetadataAdd (row, PS_LIST_TAIL, "Y_FPA", PS_DATA_F32, "y coord on focal plane", raw->FP->y);109 psMetadataAdd (row, PS_LIST_TAIL, "MAG_INST", PS_DATA_F32, "instrumental magnitude", raw->Mag);110 psMetadataAdd (row, PS_LIST_TAIL, "MAG_REF", PS_DATA_F32, "reference star magnitude", ref->Mag);111 psMetadataAdd (row, PS_LIST_TAIL, "COLOR_REF",PS_DATA_F32, "reference star color", ref->Color);112 psMetadataAdd (row, PS_LIST_TAIL, "CHIP_ID", PS_DATA_STRING, "chip identifier", chipName);113 // XXX need to add the reference color, but this needs getstar / dvo.photcodes for the reference to be refined.102 psMetadata *row = psMetadataAlloc (); 103 psMetadataAdd (row, PS_LIST_TAIL, "RA", PS_DATA_F64, "right ascension (deg, J2000)", PM_DEG_RAD*ref->sky->r); 104 psMetadataAdd (row, PS_LIST_TAIL, "DEC", PS_DATA_F64, "declination (deg, J2000)", PM_DEG_RAD*ref->sky->d); 105 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP", PS_DATA_F32, "x coord on chip", raw->chip->x); 106 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP", PS_DATA_F32, "y coord on chip", raw->chip->y); 107 psMetadataAdd (row, PS_LIST_TAIL, "X_FPA", PS_DATA_F32, "x coord on focal plane", raw->FP->x); 108 psMetadataAdd (row, PS_LIST_TAIL, "Y_FPA", PS_DATA_F32, "y coord on focal plane", raw->FP->y); 109 psMetadataAdd (row, PS_LIST_TAIL, "MAG_INST", PS_DATA_F32, "instrumental magnitude", raw->Mag); 110 psMetadataAdd (row, PS_LIST_TAIL, "MAG_REF", PS_DATA_F32, "reference star magnitude", ref->Mag); 111 psMetadataAdd (row, PS_LIST_TAIL, "COLOR_REF",PS_DATA_F32, "reference star color", ref->Color); 112 psMetadataAdd (row, PS_LIST_TAIL, "CHIP_ID", PS_DATA_STRING, "chip identifier", chipName); 113 // XXX need to add the reference color, but this needs getstar / dvo.photcodes for the reference to be refined. 114 114 115 psArrayAdd (table, 100, row);116 psFree (row);117 }118 }119 }115 psArrayAdd (table, 100, row); 116 psFree (row); 117 } 118 } 119 } 120 120 } 121 121 psFree (view); 122 122 123 123 if (table->n == 0) { 124 psFree(table);125 return true;124 psFree(table); 125 return true; 126 126 } 127 127 -
branches/eam_branches/20090522/psModules/src/objects/pmSourceMatch.c
r23989 r24557 45 45 psVector **x, psVector **y, // Coordinate vectors to return 46 46 psVector **mag, psVector **magErr, // Magnitude and error vectors to return 47 psVector **indices, // Indices for sources 47 48 const psArray *sources // Input sources 48 49 ) … … 58 59 *mag = psVectorRecycle(*mag, numSources, PS_TYPE_F32); 59 60 *magErr = psVectorRecycle(*magErr, numSources, PS_TYPE_F32); 61 *indices = psVectorRecycle(*indices, numSources, PS_TYPE_S32); 60 62 float xMin = INFINITY, xMax = -INFINITY, yMin = INFINITY, yMax = -INFINITY; // Bounds of sources 61 63 long num = 0; // Number of valid sources 62 64 for (long i = 0; i < numSources; i++) { 63 65 pmSource *source = sources->data[i]; // Source of interest 64 if (!source) continue; 65 if (source->mode & SOURCE_MASK) continue; 66 if (!isfinite(source->psfMag)) continue; 67 if (!isfinite(source->errMag)) continue; 68 if (source->psfMag > SOURCE_FAINTEST) continue; 66 if (!source || (source->mode & SOURCE_MASK) || !isfinite(source->psfMag) || 67 !isfinite(source->errMag) || source->psfMag > SOURCE_FAINTEST) { 68 continue; 69 } 69 70 70 71 float xSrc, ySrc; // Coordinates of source … … 78 79 (*y)->data.F32[num] = ySrc; 79 80 (*mag)->data.F32[num] = source->psfMag; 80 (*magErr)->data.F32[num] = source->errMag ; 81 (*magErr)->data.F32[num] = source->errMag; 82 (*indices)->data.S32[num] = i; 81 83 num++; 82 84 } … … 85 87 (*mag)->n = num; 86 88 (*magErr)->n = num; 89 (*indices)->n = num; 87 90 88 91 if (*bounds) { … … 175 178 psVector *xImage = NULL, *yImage = NULL; // Coordinates of sources 176 179 psVector *magImage = NULL, *magErrImage = NULL; // Magnitude and mag 177 178 int numSources = sourcesParse(&boundsImage, &xImage, &yImage, &magImage, &magErrImage, 180 psVector *indices = NULL; // Indices for sources 181 182 int numSources = sourcesParse(&boundsImage, &xImage, &yImage, &magImage, &magErrImage, &indices, 179 183 sources); // Number of sources 180 184 … … 187 191 for (int j = 0; j < numSources; j++) { 188 192 pmSourceMatch *match = pmSourceMatchAlloc(); // Match data 189 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j); 193 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], 194 i, indices->data.S32[j]); 190 195 matches->data[j] = match; 191 196 } … … 206 211 for (int j = 0, k = numMaster; j < numSources; j++, k++) { 207 212 pmSourceMatch *match = pmSourceMatchAlloc(); // Match data 208 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j); 213 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], 214 i, indices->data.S32[j]); 209 215 matches->data[k] = match; 210 216 } … … 231 237 // Record the match 232 238 pmSourceMatch *match = matches->data[index]; // Match data 233 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j); 239 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], 240 i, indices->data.S32[j]); 234 241 numMatch++; 235 242 } else { 236 243 // Add to the master list 237 244 pmSourceMatch *match = pmSourceMatchAlloc(); // Match data 238 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j); 245 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], 246 i, indices->data.S32[j]); 239 247 xMaster->data.F32[numMaster] = xImage->data.F32[j]; 240 248 yMaster->data.F32[numMaster] = yImage->data.F32[j];
Note:
See TracChangeset
for help on using the changeset viewer.
