Changeset 26896 for trunk/pswarp/src/pswarpTransformSources.c
- Timestamp:
- Feb 10, 2010, 7:38:54 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpTransformSources.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpTransformSources.c
r25758 r26896 31 31 32 32 // Transform sources 33 psArray *inSources = psMetadataLookupPtr(&mdok, input->analysis, "PSPHOT.SOURCES"); // Sources in source 33 pmDetections *inDetections = psMetadataLookupPtr(&mdok, input->analysis, "PSPHOT.DETECTIONS"); // Sources in source 34 if (!inDetections) return true; 35 psArray *inSources = inDetections->allSources; 34 36 if (!inSources) return true; 35 37 36 38 pswarpMapGrid *sourceGrid = pswarpMapGridFromImage(output, input, nGridX, nGridY); // Grid for sources 37 39 38 psArray *outSources = psMemIncrRefCounter(psMetadataLookupPtr(&mdok, output->analysis, "PSPHOT.SOURCES")); // Target sources 40 pmDetections *outDetections = psMemIncrRefCounter(psMetadataLookupPtr(&mdok, output->analysis, "PSPHOT.DETECTIONS")); // Target sources 41 if (!outDetections) { 42 outDetections = pmDetectionsAlloc(); 43 psMetadataAddPtr(output->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Warped sources", outDetections); 44 } 45 psArray *outSources = outDetections->allSources; 39 46 if (!outSources) { 40 outSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER); 41 psMetadataAddPtr(output->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, 42 "Warped sources", outSources); 47 outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER); 48 outSources = outDetections->allSources; 43 49 } 44 50 … … 57 63 psError(PS_ERR_UNKNOWN, false, "Unable to get grid coordinates for source at %f,%f\n", 58 64 xIn, yIn); 59 psFree(out Sources);65 psFree(outDetections); 60 66 psFree(sourceGrid); 61 67 return false; … … 72 78 psError(PS_ERR_UNKNOWN, false, "Unable to transform coordinates for source at %f,%f\n", 73 79 xIn, yIn); 74 psFree(out Sources);80 psFree(outDetections); 75 81 psFree(sourceGrid); 76 82 return false; … … 142 148 } 143 149 psFree(sourceGrid); 144 psFree(out Sources); // Drop reference150 psFree(outDetections); // Drop reference 145 151 return true; 146 152 }
Note:
See TracChangeset
for help on using the changeset viewer.
