Changeset 20568
- Timestamp:
- Nov 6, 2008, 2:07:23 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
ppStack/src/ppStackLoop.c (modified) (2 diffs)
-
ppStack/src/ppStackMatch.c (modified) (2 diffs)
-
ppSub/src/ppSubArguments.c (modified) (2 diffs)
-
ppSub/src/ppSubReadout.c (modified) (3 diffs)
-
psModules/src/imcombine/pmStackReject.c (modified) (2 diffs)
-
psModules/src/imcombine/pmStackReject.h (modified) (1 diff)
-
psModules/src/imcombine/pmSubtraction.c (modified) (4 diffs)
-
psModules/src/imcombine/pmSubtraction.h (modified) (2 diffs)
-
psModules/src/imcombine/pmSubtractionMatch.c (modified) (3 diffs)
-
psModules/src/imcombine/pmSubtractionMatch.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r20494 r20568 772 772 } 773 773 774 int stride = psMetadataLookupS32(NULL, ppsub, "STRIDE"); // Size of convolution patches 775 774 776 // Reject bad pixels 775 777 for (int i = 0; i < num; i++) { … … 791 793 #endif 792 794 793 psPixels *reject = pmStackReject(inspect->data[i], numCols, numRows, threshold, poorFrac, 795 psPixels *reject = pmStackReject(inspect->data[i], numCols, numRows, threshold, poorFrac, stride, 794 796 subRegions->data[i], subKernels->data[i]); // Rejected pixels 795 797 -
trunk/ppStack/src/ppStackMatch.c
r20508 r20568 151 151 int footprint = psMetadataLookupS32(NULL, ppsub, "STAMP.FOOTPRINT"); // Stamp half-size 152 152 float threshold = psMetadataLookupF32(NULL, ppsub, "STAMP.THRESHOLD"); // Threshold for stmps 153 int stride = psMetadataLookupS32(NULL, ppsub, "STRIDE"); // Size of convolution patches 153 154 int iter = psMetadataLookupS32(NULL, ppsub, "ITER"); // Rejection iterations 154 155 float rej = psMetadataLookupF32(NULL, ppsub, "REJ"); // Rejection threshold … … 228 229 229 230 // Do the image matching 230 if (!pmSubtractionMatch(output, NULL, readout, fake, footprint, regionSize, spacing, threshold,231 sources, stampsName, type, size, order, widths, orders, inner, ringsOrder,232 binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej,233 sysError, maskVal, maskBad, maskPoor, poorFrac, badFrac,231 if (!pmSubtractionMatch(output, NULL, readout, fake, footprint, stride, regionSize, spacing, 232 threshold, sources, stampsName, type, size, order, widths, orders, inner, 233 ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, 234 iter, rej, sysError, maskVal, maskBad, maskPoor, poorFrac, badFrac, 234 235 PM_SUBTRACTION_MODE_1)) { 235 236 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); -
trunk/ppSub/src/ppSubArguments.c
r20517 r20568 211 211 psMetadataAddF32(arguments, PS_LIST_TAIL, "-spacing", 0, "Typical stamp spacing (pixels)", NAN); 212 212 psMetadataAddS32(arguments, PS_LIST_TAIL, "-footprint", 0, "Stamp footprint half-size (pixels)", -1); 213 psMetadataAddS32(arguments, PS_LIST_TAIL, "-stride", 0, "Size of convolution patches (pixels)", -1); 213 214 psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold", 0, "Minimum threshold for stamps (ADU)", NAN); 214 215 psMetadataAddS32(arguments, PS_LIST_TAIL, "-iter", 0, "Number of rejection iterations", -1); … … 300 301 VALUE_ARG_RECIPE_INT("-spam-binning", "SPAM.BINNING", S32, 0); 301 302 VALUE_ARG_RECIPE_INT("-footprint", "STAMP.FOOTPRINT", S32, -1); 303 VALUE_ARG_RECIPE_INT("-stride", "STRIDE", S32, -1); 302 304 VALUE_ARG_RECIPE_FLOAT("-threshold", "STAMP.THRESHOLD", F32); 303 305 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, -1); -
trunk/ppSub/src/ppSubReadout.c
r20554 r20568 91 91 int footprint = psMetadataLookupS32(NULL, recipe, "STAMP.FOOTPRINT"); // Stamp half-size 92 92 float threshold = psMetadataLookupF32(NULL, recipe, "STAMP.THRESHOLD"); // Threshold for stmps 93 int stride = psMetadataLookupS32(NULL, recipe, "STRIDE"); // Size of convolution patches 93 94 int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations 94 95 float rej = psMetadataLookupF32(NULL, recipe, "REJ"); // Rejection threshold … … 191 192 192 193 // Match the PSFs 193 if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, regionSize, spacing, threshold, sources,194 s tampsName, type, size, order, widths, orders, inner, ringsOrder, binning,195 penalty, optimum, optWidths, optOrder, optThresh, iter, rej, sys, maskVal,196 mask Bad, maskPoor, poorFrac, badFrac, subMode)) {194 if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, spacing, threshold, 195 sources, stampsName, type, size, order, widths, orders, inner, ringsOrder, 196 binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, sys, 197 maskVal, maskBad, maskPoor, poorFrac, badFrac, subMode)) { 197 198 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 198 199 psFree(inConv); … … 580 581 psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources 581 582 FILE *sourceFile = fopen("sources.dat", "w"); // File for sources 582 fprintf(sourceFile, "# x y mag mag_err psf_chisq cr_nsigma ext_nsigma psf_qf flags m_x m_y m_xx m_xy m_yy\n"); 583 fprintf(sourceFile, 584 "# x y mag mag_err psf_chisq cr_nsigma ext_nsigma psf_qf flags m_x m_y m_xx m_xy m_yy\n"); 583 585 for (int i = 0; i < sources->n; i++) { 584 586 pmSource *source = sources->data[i]; -
trunk/psModules/src/imcombine/pmStackReject.c
r20505 r20568 126 126 127 127 psPixels *pmStackReject(const psPixels *in, int numCols, int numRows, float threshold, float poorFrac, 128 const psArray *subRegions, const psArray *subKernels)128 int stride, const psArray *subRegions, const psArray *subKernels) 129 129 { 130 130 PS_ASSERT_PIXELS_NON_NULL(in, NULL); … … 168 168 psRegion *region = subRegions->data[i]; // Region of interest 169 169 pmSubtractionKernels *kernels = subKernels->data[i]; // Kernel of interest 170 if (!pmSubtractionConvolve(convRO, NULL, inRO, NULL, NULL, 0, 0, 1.0, NAN,170 if (!pmSubtractionConvolve(convRO, NULL, inRO, NULL, NULL, stride, 0, 0, 1.0, NAN, 171 171 region, kernels, false, true)) { 172 172 psError(PS_ERR_UNKNOWN, false, "Unable to convolve mask image in region %d.", i); -
trunk/psModules/src/imcombine/pmStackReject.h
r19345 r20568 13 13 float threshold, ///< Threshold on convolved image, 0..1 14 14 float poorFrac, ///< Fraction for "poor" 15 int stride, ///< Size of convolution patches 15 16 const psArray *regions, ///< Array of image regions for image 16 17 const psArray *kernels ///< Array of kernel parameters for each region -
trunk/psModules/src/imcombine/pmSubtraction.c
r20561 r20568 1088 1088 1089 1089 bool pmSubtractionConvolve(pmReadout *out1, pmReadout *out2, const pmReadout *ro1, const pmReadout *ro2, 1090 psImage *subMask, psMaskType maskBad, psMaskType maskPoor, float poorFrac,1091 float sysError, const psRegion *region, const pmSubtractionKernels *kernels,1092 bool doBG, bool useFFT)1090 psImage *subMask, int stride, psMaskType maskBad, psMaskType maskPoor, 1091 float poorFrac, float sysError, const psRegion *region, 1092 const pmSubtractionKernels *kernels, bool doBG, bool useFFT) 1093 1093 { 1094 1094 int numCols = 0, numRows = 0; // Image dimensions … … 1124 1124 PS_ASSERT_IMAGE_SIZE(subMask, numCols, numRows, false); 1125 1125 } 1126 PS_ASSERT_INT_NONNEGATIVE(stride, false); 1127 PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(poorFrac, 0.0, false); 1128 PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(poorFrac, 1.0, false); 1129 PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(sysError, 0.0, false); 1130 PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(sysError, 1.0, false); 1126 1131 if (region && psRegionIsNaN(*region)) { 1127 1132 psString string = psRegionToString(*region); … … 1212 1217 1213 1218 int size = kernels->size; // Half-size of kernel 1214 int fullSize = 2 * size + 1; // Full size of kernel1215 1219 1216 1220 // Get region for convolution: [xMin:xMax,yMin:yMax] … … 1236 1240 psImageConvolveSetThreads(false); 1237 1241 1238 for (int j = yMin; j < yMax; j += fullSize) { 1239 int ySubMax = PS_MIN(j + fullSize, yMax); // Range for subregion of interest 1240 for (int i = xMin; i < xMax; i += fullSize) { 1241 int xSubMax = PS_MIN(i + fullSize, xMax); // Range for subregion of interest 1242 if (stride == 0) { 1243 // Use the full size of the kernel 1244 stride = 2 * size + 1; 1245 } 1246 1247 for (int j = yMin; j < yMax; j += stride) { 1248 int ySubMax = PS_MIN(j + stride, yMax); // Range for subregion of interest 1249 for (int i = xMin; i < xMax; i += stride) { 1250 int xSubMax = PS_MIN(i + stride, xMax); // Range for subregion of interest 1242 1251 1243 1252 psRegion *subRegion = psRegionAlloc(i, xSubMax, j, ySubMax); // Bounds of subtraction -
trunk/psModules/src/imcombine/pmSubtraction.h
r20505 r20568 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.3 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2008-11-0 1 03:36:01$8 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-11-07 00:03:18 $ 10 10 * Copyright 2004-207 Institute for Astronomy, University of Hawaii 11 11 */ … … 103 103 const pmReadout *ro2, // Input image 2 104 104 psImage *subMask, ///< Subtraction mask (or NULL) 105 int stride, ///< Size of convolution patches 105 106 psMaskType maskBad, ///< Mask value to give bad pixels 106 107 psMaskType maskPoor, ///< Mask value to give poor pixels -
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r20505 r20568 92 92 93 93 bool pmSubtractionMatch(pmReadout *conv1, pmReadout *conv2, const pmReadout *ro1, const pmReadout *ro2, 94 int footprint, float regionSize, float stampSpacing, float threshold,94 int footprint, int stride, float regionSize, float stampSpacing, float threshold, 95 95 const psArray *sources, const char *stampsName, 96 96 pmSubtractionKernelsType type, int size, int spatialOrder, … … 139 139 140 140 PS_ASSERT_INT_NONNEGATIVE(footprint, false); 141 PS_ASSERT_INT_NONNEGATIVE(stride, false); 141 142 // regionSize can be just about anything (except maybe negative, but it can be NAN) 142 143 PS_ASSERT_FLOAT_LARGER_THAN(stampSpacing, 0.0, false); … … 396 397 397 398 psTrace("psModules.imcombine", 2, "Convolving...\n"); 398 if (!pmSubtractionConvolve(conv1, conv2, ro1, ro2, subMask, maskBad, maskPoor, poorFrac,399 if (!pmSubtractionConvolve(conv1, conv2, ro1, ro2, subMask, stride, maskBad, maskPoor, poorFrac, 399 400 sysError, region, kernels, true, useFFT)) { 400 401 psError(PS_ERR_UNKNOWN, false, "Unable to convolve image."); -
trunk/psModules/src/imcombine/pmSubtractionMatch.h
r20505 r20568 16 16 // Stamp parameters 17 17 int footprint, ///< Stamp half-size 18 int stride, ///< Size for convolution patches 18 19 float regionSize, ///< Typical size of iso-kernel regions 19 20 float stampSpacing, ///< Typical spacing between stamps
Note:
See TracChangeset
for help on using the changeset viewer.
