Changeset 28304 for branches/czw_branch/20100519/psModules
- Timestamp:
- Jun 10, 2010, 6:28:51 PM (16 years ago)
- Location:
- branches/czw_branch/20100519
- Files:
-
- 7 edited
- 1 copied
-
. (modified) (1 prop)
-
psModules/src/camera/pmFPAfileIO.c (modified) (1 diff)
-
psModules/src/config/pmConfigMask.c (modified) (1 diff)
-
psModules/src/config/pmConfigMask.h (modified) (4 diffs)
-
psModules/src/detrend/pmGainTweak.c (copied) (copied from trunk/psModules/src/detrend/pmGainTweak.c )
-
psModules/src/extras/pmVisual.c (modified) (1 diff)
-
psModules/src/imcombine/pmSubtraction.c (modified) (2 diffs)
-
psModules/src/objects/pmSourceMatch.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100519
- Property svn:mergeinfo changed
-
branches/czw_branch/20100519/psModules/src/camera/pmFPAfileIO.c
r27989 r28304 751 751 file->filename = pmFPAfileName(file, view, config); 752 752 if (!file->filename) { 753 psError(PS_ERR_IO, true, "Unable to determine filename ");753 psError(PS_ERR_IO, true, "Unable to determine filename for file %s", file->name); 754 754 return false; 755 755 } -
branches/czw_branch/20100519/psModules/src/config/pmConfigMask.c
r25828 r28304 8 8 9 9 #include "pmConfigMask.h" 10 11 // Structure to hold the properties of a mask value 12 typedef struct { 13 char *badMaskName; // name for "bad" (i.e., mask me please) pixels 14 char *fallbackName; // Fallback name in case a bad mask name is not defined 15 psImageMaskType defaultMaskValue; // Default value in case a bad mask name and its fallback are not defined 16 bool isBad; // include this value as part of the MASK.VALUE entry (generically bad) 17 } pmConfigMaskInfo; 10 18 11 19 static pmConfigMaskInfo masks[] = { -
branches/czw_branch/20100519/psModules/src/config/pmConfigMask.h
r21183 r28304 20 20 /// @{ 21 21 22 // structure to hold the properties of a mask value23 typedef struct {24 char *badMaskName; // name for "bad" (i.e., mask me please) pixels25 char *fallbackName; // Fallback name in case a bad mask name is not defined26 psImageMaskType defaultMaskValue; // Default value in case a bad mask name and its fallback are not defined27 bool isBad; // include this value as part of the MASK.VALUE entry (generically bad)28 } pmConfigMaskInfo;29 30 22 // pmConfigMaskSetInMetadata examines named mask values and set the bits for maskValue and 31 23 // markValue. Ensures that the below-named mask values are set, and calculates the mask value … … 33 25 // name is not found, or the default values if the fallback name is not found. 34 26 bool pmConfigMaskSetInMetadata(psImageMaskType *outMaskValue, // Value of MASK.VALUE, returned 35 psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned36 psMetadata *source // Source of mask bits27 psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned 28 psMetadata *source // Source of mask bits 37 29 ); 38 30 … … 40 32 // Get a mask value by name(s) 41 33 psImageMaskType pmConfigMaskGetFromMetadata(psMetadata *source, // Source of masks 42 const char *masks // Mask values to get34 const char *masks // Mask values to get 43 35 ); 44 36 45 37 46 // lookup an image mask value by name from a psMetadata, without requiring the entry to 38 // lookup an image mask value by name from a psMetadata, without requiring the entry to 47 39 // be of type psImageMaskType, but verifying that it will fit in psImageMaskType 48 40 psImageMaskType psMetadataLookupImageMaskFromGeneric (bool *status, const psMetadata *md, const char *name); … … 50 42 // Remove from the header keywords starting with the provided string 51 43 int pmConfigMaskRemoveHeaderKeywords(psMetadata *header, // Header from which to remove keywords 52 const char *start // Remove keywords that start with this string44 const char *start // Remove keywords that start with this string 53 45 ); 54 46 -
branches/czw_branch/20100519/psModules/src/extras/pmVisual.c
r25754 r28304 86 86 87 87 88 // ask the user to continue or not. give up after 2 seconds. 89 // XXX add option to turn on/off timeouts? 88 90 bool pmVisualAskUser(bool *plotFlag) 89 91 { 92 struct timeval timeout; 93 fd_set fdSet; 94 int status; 95 90 96 char key[10]; 91 97 if (plotFlag) { 92 fprintf (std out, "[c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) ");98 fprintf (stderr, "[p]ause? [c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) "); 93 99 } else { 94 fprintf (stdout, "[c]ontinue? [a]bort all visual plots? (c) "); 95 } 96 if (!fgets(key, 8, stdin)) { 97 psWarning("Unable to read option"); 98 } 99 if (plotFlag && (key[0] == 's')) { 100 *plotFlag = false; 101 } 102 if (key[0] == 'a') { 103 isVisual = false; 100 fprintf (stderr, "[p]ause? [c]ontinue? [a]bort all visual plots? (c) "); 101 } 102 103 /* Wait up to 1.0 second for a response, then continue */ 104 timeout.tv_sec = 2; 105 timeout.tv_usec = 0; 106 107 FD_ZERO (&fdSet); 108 FD_SET (STDIN_FILENO, &fdSet); 109 110 status = select (1, &fdSet, NULL, NULL, &timeout); 111 if (status <= 0) { 112 fprintf (stderr, "\n"); 113 return true; // if no data, give up 114 } 115 116 while (true) { 117 if (!fgets(key, 8, stdin)) { 118 psWarning("Unable to read option"); 119 } 120 switch (key[0]) { 121 case 's': 122 if (plotFlag) *plotFlag = false; 123 *plotFlag = false; 124 return true; 125 case 'a': 126 isVisual = false; 127 return true; 128 case 'c': 129 case '\n': 130 return true; 131 default: 132 break; 133 } 134 135 if (plotFlag) { 136 fprintf (stderr, "[c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) "); 137 } else { 138 fprintf (stderr, "[c]ontinue? [a]bort all visual plots? (c) "); 139 } 104 140 } 105 141 return true; -
branches/czw_branch/20100519/psModules/src/imcombine/pmSubtraction.c
r27086 r28304 32 32 #define MIN_SAMPLE_STATS 7 // Minimum number to use sample statistics; otherwise use quartiles 33 33 #define USE_KERNEL_ERR // Use kernel error image? 34 #define NUM_COVAR_POS 5 // Number of positions for covariance calculation 34 35 35 36 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 1328 1329 // This can be fairly involved, so we only do it for a single instance 1329 1330 // Enable threads for covariance calculation, since we're not threading on top of it. 1331 float position[NUM_COVAR_POS] = { -1.0, -0.5, 0.0, +0.5, +1.0 }; // Positions for covariance calculations 1330 1332 oldThreads = psImageCovarianceSetThreads(true); 1331 1333 if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1332 psKernel *kernel = pmSubtractionKernel(kernels, 0.0, 0.0, false); // Convolution kernel 1333 psKernelTruncate(kernel, covarFrac); 1334 out1->covariance = psImageCovarianceCalculate(kernel, ro1->covariance); 1335 psFree(kernel); 1334 psArray *covars = psArrayAlloc(PS_SQR(NUM_COVAR_POS)); // Covariances 1335 for (int y = 0, i = 0; y < NUM_COVAR_POS; y++) { 1336 for (int x = 0; x < NUM_COVAR_POS; x++, i++) { 1337 psKernel *kernel = pmSubtractionKernel(kernels, position[x], position[y], 1338 false); // Convolution kernel 1339 psKernelTruncate(kernel, covarFrac); 1340 covars->data[i] = psImageCovarianceCalculate(kernel, ro1->covariance); 1341 psFree(kernel); 1342 } 1343 } 1344 out1->covariance = psImageCovarianceAverage(covars); 1345 psFree(covars); 1336 1346 } 1337 1347 if (kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1338 psKernel *kernel = pmSubtractionKernel(kernels, 0.0, 0.0, 1339 kernels->mode == PM_SUBTRACTION_MODE_DUAL); // Conv. kernel 1340 psKernelTruncate(kernel, covarFrac); 1341 out2->covariance = psImageCovarianceCalculate(kernel, ro2->covariance); 1342 psFree(kernel); 1348 psArray *covars = psArrayAlloc(PS_SQR(NUM_COVAR_POS)); // Covariances 1349 for (int y = 0, i = 0; y < NUM_COVAR_POS; y++) { 1350 for (int x = 0; x < NUM_COVAR_POS; x++, i++) { 1351 psKernel *kernel = pmSubtractionKernel(kernels, position[x], position[y], 1352 kernels->mode == PM_SUBTRACTION_MODE_DUAL); // Convolution kernel 1353 psKernelTruncate(kernel, covarFrac); 1354 covars->data[i] = psImageCovarianceCalculate(kernel, ro2->covariance); 1355 psFree(kernel); 1356 } 1357 } 1358 out2->covariance = psImageCovarianceAverage(covars); 1359 psFree(covars); 1343 1360 } 1344 1361 psImageCovarianceSetThreads(oldThreads); -
branches/czw_branch/20100519/psModules/src/objects/pmSourceMatch.c
r27333 r28304 280 280 psFree(boundsMaster); 281 281 282 if (!matches) { 283 psError(PM_ERR_OBJECTS, true, "No matches made."); 284 return NULL; 285 } 286 282 287 if (cullSingles) { 283 288 // Now cull the matches that contain only a single star … … 300 305 } 301 306 307 if (matches->n == 0) { 308 psError(PM_ERR_OBJECTS, true, "No matches made."); 309 psFree(matches); 310 return NULL; 311 } 312 302 313 return matches; 303 314 } … … 311 322 psArray *matches = pmSourceMatchSources(sourceArrays, radius, false); // Source matches 312 323 if (!matches) { 313 psError( PS_ERR_UNKNOWN, false, "Unable to match source lists.");324 psError(psErrorCodeLast(), false, "Unable to match source lists."); 314 325 return NULL; 315 326 }
Note:
See TracChangeset
for help on using the changeset viewer.
