Changeset 26896
- Timestamp:
- Feb 10, 2010, 7:38:54 PM (16 years ago)
- Location:
- trunk/pswarp/src
- Files:
-
- 5 edited
-
pswarpDefine.c (modified) (1 diff)
-
pswarpLoop.c (modified) (7 diffs)
-
pswarpParseCamera.c (modified) (1 diff)
-
pswarpTransformReadout.c (modified) (1 diff)
-
pswarpTransformSources.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpDefine.c
r25741 r26896 77 77 psFree(readout); // Drop reference 78 78 79 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.XBIN"); 80 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.YBIN"); 81 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.XSIZE"); 82 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.YSIZE"); 83 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.XPARITY"); 84 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.YPARITY"); 85 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.X0"); 86 psMetadataItemSupplement(target->concepts, source->concepts, "CELL.Y0"); 79 bool status = false; 80 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XBIN"); 81 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YBIN"); 82 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XSIZE"); 83 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YSIZE"); 84 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XPARITY"); 85 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YPARITY"); 86 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.X0"); 87 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.Y0"); 87 88 } 88 89 -
trunk/pswarp/src/pswarpLoop.c
r25847 r26896 162 162 pmChip *chip; 163 163 pmFPAview *view = pmFPAviewAlloc(0); 164 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 164 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 165 return false; 166 } 165 167 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 166 168 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 167 169 if (!chip->process || !chip->file_exists) { continue; } 168 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 170 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 171 return false; 172 } 169 173 pmCell *cell; 170 174 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 171 175 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 172 176 if (!cell->process || !cell->file_exists) { continue; } 173 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 174 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 175 } 176 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 177 } 178 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 177 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) || 178 !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 179 return false; 180 } 181 } 182 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 183 return false; 184 } 185 } 186 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 187 return false; 188 } 179 189 psFree(view); 180 190 … … 211 221 212 222 // files associated with the science image 213 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 223 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 224 return false; 225 } 214 226 215 227 pmChip *chip; … … 217 229 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 218 230 if (!chip->process || !chip->file_exists) { continue; } 219 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 231 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 232 return false; 233 } 220 234 221 235 // read WCS data from the corresponding header … … 242 256 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 243 257 if (!cell->process || !cell->file_exists) { continue; } 244 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 258 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 259 return false; 260 } 245 261 246 262 psListAdd(cells, PS_LIST_TAIL, cell); … … 249 265 pmReadout *readout; 250 266 while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) { 251 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 267 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 268 return false; 269 } 252 270 if (!readout->data_exists) { 253 271 continue; 254 272 } 255 273 256 // Copy the sources from the astrometry carrier to the input, so they can be accessed by274 // Copy the detections from the astrometry carrier to the input, so they can be accessed by 257 275 // pswarpTransformReadout 258 276 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); 277 pmDetections *detections = psMetadataLookupPtr(&mdok, astromRO->analysis, "PSPHOT.DETECTIONS"); // Sources from astrometry 278 if (detections) { 279 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections); 264 280 } 265 281 266 282 pswarpTransformReadout(output, readout, config); 267 283 268 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 269 } 270 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 271 } 272 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 284 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 285 return false; 286 } 287 } 288 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 289 return false; 290 } 291 } 292 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 293 return false; 294 } 273 295 } 274 296 … … 370 392 } 371 393 372 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 394 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 395 return false; 396 } 373 397 374 398 // Done with the detector side of things … … 478 502 } 479 503 fprintf(statsFile, "%s", statsMDC); 480 psFree( (void*)statsMDC);504 psFree(statsMDC); 481 505 fclose(statsFile); 482 506 pmConfigRunFilenameAddWrite(config, "STATS", statsName); -
trunk/pswarp/src/pswarpParseCamera.c
r26517 r26896 143 143 } 144 144 psphotInput->src = psMemIncrRefCounter(output->fpa); 145 // specify the number of psphot input images 146 psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1); 145 147 146 148 pmFPAfile *psphotInSources = pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF"); -
trunk/pswarp/src/pswarpTransformReadout.c
r25043 r26896 107 107 psImageInit(output->mask, maskBad); 108 108 } 109 110 // Ensure threading is off for the covariance calculation, since we are threading on a different level. 111 psImageCovarianceSetThreads(false); 109 112 110 113 // create jobs and supply them to the threads -
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.
