- Timestamp:
- Mar 12, 2010, 2:05:16 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackSources.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackSources.c
r27218 r27277 275 275 options->norm = psVectorAlloc(num, PS_TYPE_F32); 276 276 for (int i = 0; i < num; i++) { 277 if ( !isfinite(trans->data.F32[i])) {277 if (inputMask->data.U8[i] || !isfinite(trans->data.F32[i])) { 278 278 continue; 279 279 } … … 315 315 // Double check: all transparencies should be zero 316 316 { 317 psArray *matches = pmSourceMatchSources(sourceLists, radius ); // List of matches317 psArray *matches = pmSourceMatchSources(sourceLists, radius, true); // List of matches 318 318 if (!matches) { 319 319 psError(PPSTACK_ERR_DATA, false, "Unable to match sources"); … … 321 321 return false; 322 322 } 323 psVector *trans = pmSourceMatchRelphot(matches, zp, iter, tol, starLimit, transIter, transRej, 324 transThresh, starRej, starSys); 323 psVector *trans = pmSourceMatchRelphot(matches, zp, tol, iter1, starRej1, starSys1, 324 iter2, starRej2, starSys2, starLimit, 325 transIter, transRej, transThresh); // Transparencies 325 326 for (int i = 0; i < num; i++) { 326 327 fprintf(stderr, "Transparency of image %d: %f\n", i, trans->data.F32[i]); 327 328 } 328 329 psFree(trans); 329 } 330 #endif 331 } 332 333 334 #if 0 330 psFree(matches); 331 } 332 #endif 333 } 334 335 336 #if 1 335 337 // Position offsets 336 338 { … … 342 344 } 343 345 for (int i = 0; i < num; i++) { 344 psVector *offset = offsets->data[i]; 345 fprintf(stderr, "Offset %d: %f,%f\n", i, offset->data.F32[0], offset->data.F32[1]); 346 if (options->inputMask->data.U8[i]) { 347 continue; 348 } 349 psArray *sources = sourceLists->data[i]; // Sources of interest 350 psVector *offset = offsets->data[i]; // Offsets for image 351 float dx = offset->data.F32[0], dy = offset->data.F32[1]; // Offsets to apply 352 if (!isfinite(dx) || !isfinite(dy)) { 353 continue; 354 } 355 psLogMsg("ppStack", PS_LOG_INFO, "Applying astrometric correction to image %d: %f,%f\n", 356 i, dx, dy); 357 for (int j = 0; j < sources->n; j++) { 358 pmSource *source = sources->data[j]; // Source of interest 359 if (!source) { 360 continue; 361 } 362 if (source->modelPSF) { 363 source->modelPSF->params->data.F32[PM_PAR_XPOS] -= dx; 364 source->modelPSF->params->data.F32[PM_PAR_YPOS] -= dy; 365 } 366 if (source->peak) { 367 source->peak->xf -= dx; 368 source->peak->yf -= dy; 369 } 370 } 346 371 } 347 372 psFree(offsets); 348 373 } 349 374 #endif 375 376 #ifdef TESTING 377 // Double check: all offsets should be zero 378 { 379 psArray *matches = pmSourceMatchSources(sourceLists, radius, true); // List of matches 380 if (!matches) { 381 psError(PPSTACK_ERR_DATA, false, "Unable to match sources"); 382 psFree(zp); 383 return false; 384 } 385 psArray *offsets = pmSourceMatchRelastro(matches, num, tol, iter1, starRej1, 386 iter2, starRej2, starLimit); // Shifts for each image 387 for (int i = 0; i < num; i++) { 388 psVector *offset = offsets->data[i]; // Offsets for image 389 fprintf(stderr, "Offset of image %d: %f,%f\n", i, offset->data.F32[0], offset->data.F32[1]); 390 } 391 psFree(offsets); 392 psFree(matches); 393 } 394 #endif 395 350 396 351 397 if (options->photometry) {
Note:
See TracChangeset
for help on using the changeset viewer.
