- Timestamp:
- Mar 5, 2009, 11:24:29 AM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStack/src/ppStackLoop.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
- Property svn:mergeinfo changed
/trunk merged: 22727-22752,23115-23126,23128,23137-23157,23159-23174,23182-23195,23198
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090215/ppStack/src/ppStackLoop.c
r22214 r23199 257 257 pmPSF *targetPSF = NULL; // Target PSF 258 258 float sumExposure = NAN; // Sum of exposure times 259 psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs 260 psVectorInit(inputMask, 0); 259 261 if (psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) { 260 262 pmFPAfileActivate(config->files, false, NULL); … … 283 285 psFree(fileIter); 284 286 psFree(psfs); 287 psFree(inputMask); 285 288 return false; 286 289 } … … 299 302 psFree(fileIter); 300 303 psFree(psfs); 304 psFree(inputMask); 301 305 return false; 302 306 } … … 324 328 psFree(sourceLists); 325 329 psFree(targetPSF); 326 return false; 330 psFree(inputMask); 331 return false; 327 332 } 328 333 … … 333 338 psFree(sourceLists); 334 339 psFree(targetPSF); 340 psFree(inputMask); 335 341 return false; 336 342 } … … 340 346 psFree(sourceLists); 341 347 psFree(targetPSF); 348 psFree(inputMask); 342 349 return false; 343 350 } … … 351 358 352 359 // Zero point calibration 353 sumExposure = ppStackSourcesTransparency(sourceLists, view, config);360 sumExposure = ppStackSourcesTransparency(sourceLists, inputMask, view, config); 354 361 if (!isfinite(sumExposure) || sumExposure <= 0) { 355 362 psError(PS_ERR_UNKNOWN, false, "Unable to calculate transparency differences"); 356 363 psFree(sourceLists); 357 364 psFree(targetPSF); 365 psFree(inputMask); 358 366 return false; 359 367 } 360 368 361 369 // Generate target PSF 362 targetPSF = ppStackPSF(config, numCols, numRows, psfs );370 targetPSF = ppStackPSF(config, numCols, numRows, psfs, inputMask); 363 371 psFree(psfs); 364 372 if (!targetPSF) { … … 366 374 psFree(sourceLists); 367 375 psFree(view); 376 psFree(inputMask); 368 377 return false; 369 378 } … … 409 418 int numGood = 0; // Number of good frames 410 419 int numCols = 0, numRows = 0; // Size of image 411 psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs412 psVectorInit(inputMask, 0);413 420 psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching 414 421 psVectorInit(matchChi2, NAN); … … 419 426 psArray *covariances = psArrayAlloc(num); // Covariance matrices 420 427 for (int i = 0; i < num; i++) { 428 if (inputMask->data.U8[i]) { 429 continue; 430 } 421 431 psTrace("ppStack", 2, "Convolving input %d of %d to target PSF....\n", i, num); 422 432 pmFPAfileActivate(config->files, false, NULL); … … 1168 1178 fileActivation(config, photFiles, true); 1169 1179 pmFPAview *photView = filesIterateDown(config); 1180 fileActivation(config, combineFiles, true); 1181 1170 1182 if (!ppStackPhotometry(config, outRO, photView)) { 1171 1183 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on output."); 1184 filesIterateUp(config); 1172 1185 psFree(outRO); 1173 1186 psFree(photView); … … 1175 1188 } 1176 1189 psFree(photView); 1177 1178 fileActivation(config, combineFiles, true);1179 1190 1180 1191 if (stats) { … … 1217 1228 hdu->header = psMetadataAlloc(); 1218 1229 } 1219 ppStackVersion Metadata(hdu->header);1230 ppStackVersionHeader(hdu->header); 1220 1231 1221 1232 psFree(outRO);
Note:
See TracChangeset
for help on using the changeset viewer.
