Changeset 19283
- Timestamp:
- Aug 28, 2008, 6:05:19 PM (18 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 3 edited
-
ppStackArguments.c (modified) (2 diffs)
-
ppStackLoop.c (modified) (4 diffs)
-
ppStackMatch.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackArguments.c
r19231 r19283 152 152 psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-rej", 0, 153 153 "Combination rejection thresold (sigma)", NAN); 154 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-val", 0, "Mask value of input bad pixels", NULL);155 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value to give bad pixels", NULL);156 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-poor", 0, "Mask value to give poor pixels", NULL);154 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-val", 0, "Mask value of input bad pixels", NULL); 155 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value to give bad pixels", NULL); 156 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-poor", 0, "Mask value to give poor pixels", NULL); 157 157 psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold-mask", 0, "Threshold for mask deconvolution", NAN); 158 psMetadataAddF32(arguments, PS_LIST_TAIL, "-poor-frac", 0, "Fraction of weight for poor pixels", NAN); 158 159 psMetadataAddF32(arguments, PS_LIST_TAIL, "-image-rej", 0, 159 160 "Pixel rejection fraction threshold for rejecting entire image", NAN); … … 233 234 VALUE_ARG_RECIPE_FLOAT("-image-rej", "IMAGE.REJ", F32); 234 235 VALUE_ARG_RECIPE_INT("-rows", "ROWS", S32, 0); 236 VALUE_ARG_RECIPE_FLOAT("-poor-frac", "POOR.FRACTION", F32); 235 237 236 238 valueArgRecipeStr(arguments, recipe, "-mask-val", "MASK.VAL", recipe); -
trunk/ppStack/src/ppStackLoop.c
r19269 r19283 220 220 float imageRej = psMetadataLookupF32(NULL, recipe, "IMAGE.REJ"); // Maximum fraction of image to reject 221 221 // before rejecting entire image 222 float poorFrac = psMetadataLookupF32(&mdok, recipe, "POOR.FRACTION"); // Fraction for "poor" 222 223 223 224 const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics … … 410 411 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator 411 412 int numGood = 0; // Number of good frames 413 int numCols = 0, numRows = 0; // Size of image 412 414 for (int i = 0; i < num; i++) { 413 415 psTrace("ppStack", 2, "Convolving input %d of %d to target PSF....\n", i, num); … … 426 428 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); // Input readout 427 429 psFree(view); 430 431 if (numCols == 0 && numRows == 0) { 432 numCols = readout->image->numCols; 433 numRows = readout->image->numRows; 434 } else if (numCols != readout->image->numCols || numRows != readout->image->numRows) { 435 psError(PS_ERR_UNKNOWN, true, "Sizes of input images don't match: %dx%d vs %dx%d", 436 readout->image->numCols, readout->image->numRows, numCols, numRows); 437 psFree(globalSources); 438 psFree(indSources); 439 psFree(targetPSF); 440 psFree(rng); 441 return false; 442 } 428 443 429 444 // Background subtraction, scaling and normalisation is performed automatically by the image matching … … 621 636 #ifdef TESTING 622 637 { 623 psImage * pix = psPixelsToMask(NULL, inspect, psRegionSet(0, outRO->image->numCols - 1,624 0, outRO->image->numRows - 1), 0xff);638 psImage *mask = psPixelsToMask(NULL, inspect, psRegionSet(0, numCols - 1, 0, numRows - 1), 639 0xff); // Mask image 625 640 psString name = NULL; // Name of image 626 641 psStringAppend(&name, "inspect_%03d.fits", i); 627 642 psFits *fits = psFitsOpen(name, "w"); 628 643 psFree(name); 629 psFitsWriteImage(fits, NULL, pix, 0, NULL);630 psFree( pix);644 psFitsWriteImage(fits, NULL, mask, 0, NULL); 645 psFree(mask); 631 646 psFitsClose(fits); 632 647 } 633 648 #endif 634 649 635 psPixels *reject = pmStackReject(inspect, NULL, threshold, subRegions->data[i],636 sub Kernels->data[i]); // Pixels to reject650 psPixels *reject = pmStackReject(inspect, numCols, numRows, threshold, poorFrac, 651 subRegions->data[i], subKernels->data[i]); // Pixels to reject 637 652 638 653 #ifdef TESTING 639 654 { 640 psImage * pix = psPixelsToMask(NULL, reject, psRegionSet(0, outRO->image->numCols - 1,641 0, outRO->image->numRows - 1), 0xff);655 psImage *mask = psPixelsToMask(NULL, reject, psRegionSet(0, numCols - 1, 0, numRows - 1), 656 0xff); // Mask image 642 657 psString name = NULL; // Name of image 643 658 psStringAppend(&name, "reject_%03d.fits", i); 644 659 psFits *fits = psFitsOpen(name, "w"); 645 660 psFree(name); 646 psFitsWriteImage(fits, NULL, pix, 0, NULL);647 psFree( pix);661 psFitsWriteImage(fits, NULL, mask, 0, NULL); 662 psFree(mask); 648 663 psFitsClose(fits); 649 664 } -
trunk/ppStack/src/ppStackMatch.c
r19251 r19283 15 15 PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources 16 16 17 //#define TESTING // Enable debugging output17 #define TESTING // Enable debugging output 18 18 19 19
Note:
See TracChangeset
for help on using the changeset viewer.
