Changeset 26781
- Timestamp:
- Feb 5, 2010, 1:19:36 PM (16 years ago)
- Location:
- branches/eam_branches/20091201/pswarp/src
- Files:
-
- 2 edited
-
pswarpLoop.c (modified) (1 diff)
-
pswarpTransformSources.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/pswarp/src/pswarpLoop.c
r26535 r26781 254 254 } 255 255 256 // Copy the sources from the astrometry carrier to the input, so they can be accessed by256 // Copy the detections from the astrometry carrier to the input, so they can be accessed by 257 257 // pswarpTransformReadout 258 258 pmReadout *astromRO = pmFPAviewThisReadout(view, astrom->fpa); // Readout for astrometry 259 psArray *sources = psMetadataLookupPtr(&mdok, astromRO->analysis, 260 "PSPHOT.SOURCES"); // Sources from astrometry 261 if (sources) { 262 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, 263 "Sources from input astrometry", sources); 259 pmDetections *detections = psMetadataLookupPtr(&mdok, astromRO->analysis, "PSPHOT.DETECTIONS"); // Sources from astrometry 260 if (detections) { 261 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections); 264 262 } 265 263 -
branches/eam_branches/20091201/pswarp/src/pswarpTransformSources.c
r25758 r26781 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.
