Changeset 13512
- Timestamp:
- May 24, 2007, 11:48:31 AM (19 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 2 edited
-
ppStackArguments.c (modified) (2 diffs)
-
ppStackReadout.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackArguments.c
r13489 r13512 85 85 psMetadataAddU8(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value for bad pixels", 0); 86 86 psMetadataAddU8(arguments, PS_LIST_TAIL, "-mask-blank", 0, "Mask value for blank region", 0); 87 psMetadataAddStr(arguments, PS_LIST_TAIL, "-seeing", 0, "Name of file with seeing FWHMs", NULL); 87 88 88 89 if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 4) { … … 112 113 VALUE_ARG_RECIPE_INT("-mask-blank", "MASK.BLANK", U8, 0); 113 114 115 const char *seeingName = psMetadataLookupStr(NULL, arguments, "-seeing"); // Name of seeing file 116 if (seeingName && strlen(seeingName) > 0) { 117 psArray *seeing = psVectorsReadFromFile(seeingName, "%f"); // Array with seeing vector only 118 if (!seeing || seeing->n != 1) { 119 psError(PS_ERR_UNKNOWN, false, "Unable to read file with seeing FWHMs."); 120 psFree(seeing); 121 goto ERROR; 122 } 123 psMetadataAddVector(config->arguments, PS_LIST_TAIL, "SEEING", 0, "Seeing in each image", 124 seeing->data[0]); 125 psFree(seeing); 126 } 127 114 128 psTrace("ppStack", 1, "Done reading command-line arguments\n"); 115 129 psFree(arguments); -
trunk/ppStack/src/ppStackReadout.c
r13493 r13512 12 12 13 13 14 #define SEEING 1.0 // Seeing FWHM (pixels)15 14 #define WEIGHT 1.0 // Weighting 16 15 … … 18 17 { 19 18 // Get the recipe values 19 bool mdok; // Status of MD lookup 20 20 int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Rejection iterations 21 21 float combineRej = psMetadataLookupF32(NULL, config->arguments, "COMBINE.REJ"); // Combination threshold … … 24 24 psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Value to mask 25 25 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg. 26 psVector *seeing = psMetadataLookupPtr(&mdok, config->arguments, "SEEING"); // Seeing in each image 26 27 27 28 // Get the output target … … 39 40 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); // Statistics 40 41 psRandom *rng = psRandomAlloc(0, PS_RANDOM_TAUS); // Random number generator 42 int fileNum = 0; // Number of file 41 43 while ((item = psMetadataGetAndIncrement(inputIter))) { 42 44 assert(item->type == PS_DATA_UNKNOWN); … … 69 71 } 70 72 (void)psBinaryOp(ro->image, ro->image, "/", psScalarAlloc(exposure, PS_TYPE_F32)); 71 pmStackData *data = pmStackDataAlloc(ro, SEEING, WEIGHT); // Data to stack 73 pmStackData *data = pmStackDataAlloc(ro, seeing ? seeing->data.F32[fileNum] : 0.0, 74 WEIGHT); // Data to stack 72 75 psArrayAdd(stack, ARRAY_BUFFER, data); 73 76 psFree(data); // Drop reference 77 fileNum++; 74 78 } 75 79 psFree(inputIter); … … 107 111 #endif 108 112 109 if (!pmStackReject(stack, maskBad, extent, convolveRej)) { 113 // Only perform the additional rejection if we have seeing information 114 if (seeing && !pmStackReject(stack, maskBad, extent, convolveRej)) { 110 115 psError(PS_ERR_UNKNOWN, false, "Unable to reject input pixels."); 111 116 psFree(stack);
Note:
See TracChangeset
for help on using the changeset viewer.
