Changeset 34041 for branches/meh_branches/ppstack_test/ppImage/src
- Timestamp:
- Jun 19, 2012, 5:24:19 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 8 edited
- 1 copied
-
. (modified) (1 prop)
-
ppImage/src (modified) (1 prop)
-
ppImage/src/Makefile.am (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (3 diffs)
-
ppImage/src/ppImageCheckNoise.c (copied) (copied from trunk/ppImage/src/ppImageCheckNoise.c )
-
ppImage/src/ppImageDetrendReadout.c (modified) (5 diffs)
-
ppImage/src/ppImageLoop.c (modified) (1 diff)
-
ppImage/src/ppImageOptions.c (modified) (4 diffs)
-
ppImage/src/ppImageParseCamera.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ppImage/src
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120405/ppImage/src (added) merged: 33949
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ppImage/src/Makefile.am
r30655 r34041 59 59 ppImageParityFlip.c \ 60 60 ppImageCheckCTE.c \ 61 ppImageCheckNoise.c \ 61 62 ppImageFileCheck.c \ 62 63 ppImageVersion.c \ -
branches/meh_branches/ppstack_test/ppImage/src/ppImage.h
r33415 r34041 48 48 bool doStats; // call ppStats on the image 49 49 bool checkCTE; // measure pixel-based variance 50 bool checkNoise; // measure cell-level variance 50 51 bool applyParity; // Apply Cell parities 51 52 … … 56 57 bool addNoise; // Add noise to degrade MD image to 3pi 57 58 59 bool hasVideo; // Determine if this OTA has a video cell 60 bool useVideoDark; // Should we use a video dark if we can? 61 bool useVideoMask; // Should we use a video mask if we can? 62 58 63 // output files requested 59 64 bool BaseFITS; … … 172 177 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view); 173 178 179 bool ppImageCheckNoise(pmConfig *config, ppImageOptions *options, pmFPAview *view); 180 174 181 bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask); 175 182 -
branches/meh_branches/ppstack_test/ppImage/src/ppImageDetrendReadout.c
r29926 r34041 35 35 } 36 36 } 37 37 // Check to see if we're in a chip that contains video 38 bool hasVideo = false; 39 { 40 if (psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE")) { 41 psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); 42 char *Vptr = strchr(psMetadataLookupStr(NULL,input->parent->parent->hdu->header,"CELLMODE"),'V'); 43 if (Vptr) { 44 hasVideo = true; 45 psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); 46 } 47 } 48 } 49 50 38 51 // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine. 39 52 if (options->doMaskBuild) { … … 44 57 // apply the externally supplied mask to the input->mask pixels 45 58 if (options->doMask) { 46 pmReadout *mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK"); 47 pmMaskBadPixels(input, mask, options->maskValue); 59 pmReadout *mask; 60 if ((options->useVideoMask)&&(hasVideo)) { 61 mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEOMASK"); 62 } 63 else { 64 mask = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.MASK"); 65 } 66 pmMaskBadPixels(input, mask, options->maskValue); 48 67 } 49 68 if (options->doMaskBurntool) { … … 80 99 psMetadata *recipe = psMetadataLookupPtr (&mdok, config->recipes, RECIPE_NAME); 81 100 assert(mdok && recipe); 82 if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) { 101 102 if ((options->useVideoDark)&&(hasVideo)) { 103 if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) { 104 oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.VIDEODARK"); 105 } else { 106 dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.VIDEODARK"); 107 } 108 } 109 else { 110 if (psMetadataLookupBool(&mdok, recipe, "OLDDARK")) { 83 111 oldDark = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.DARK"); 84 } else {112 } else { 85 113 dark = pmFPAfileThisCell(config->files, detview, "PPIMAGE.DARK"); 86 } 114 } 115 } 87 116 } 88 117 … … 110 139 // offset information, we are not really getting exactly the right mapping from the 111 140 // original file. 141 // CZW 2012-03-21: I do not believe this is true anymore. In any case, this seems to be what 142 // ppImageReplaceBackground does to do sky subtraction. 112 143 psImageBinning *binning = psImageBinningAlloc(); 113 144 binning->nXruff = noiseMap->image->numCols; … … 119 150 psImageUnbin (noiseImage, noiseMap->image, binning); 120 151 psFree (binning); 152 // Stolen from pmSkySubtract.c 153 // CZW: Unneeded, as psImageUnbin does the bilinear interpolation? It still looks blocky. 154 /* psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe */ 155 /* psAssert(recipe, "Should be there!"); */ 156 157 /* psS32 xBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.XBIN"); */ 158 /* psS32 yBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.YBIN"); */ 159 /* psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, */ 160 /* noiseMap->image, */ 161 /* NULL, NULL, */ 162 /* 0, 0.0, 0.0, 0, 0, 0.0); */ 163 /* for (psS32 row = 0; row < input->image->numRows; row++) { */ 164 /* for (psS32 col = 0; col < input->image->numCols; col++) { */ 165 /* // We calculate the F32 value of the pixel coordinates in the */ 166 /* // binned image and then use a pixel interpolation routine to */ 167 /* // determine the value of the pixel at that location. */ 168 /* psF32 binRowF64 = ((psF32) row) / ((psF32) yBinFactor); */ 169 /* psF32 binColF64 = ((psF32) col) / ((psF32) xBinFactor); */ 170 /* // We add 0.5 to the pixel locations since the pixel */ 171 /* // interpolation routine defines the location of pixel */ 172 /* // (i, j) as (i+0.5, j+0.5). */ 173 /* binRowF64+= 0.5; */ 174 /* binColF64+= 0.5; */ 175 176 /* double binPixel; */ 177 /* if (!psImagePixelInterpolate(&binPixel, NULL, NULL, binColF64, binRowF64, interp)) { */ 178 /* psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); */ 179 /* psFree(interp); */ 180 /* psFree(noiseImage); */ 181 /* return NULL; */ 182 /* } */ 183 /* noiseImage->data.F32[row][col] = binPixel; */ 184 /* } */ 185 /* } */ 186 /* psFree(interp); */ 121 187 } 122 188 -
branches/meh_branches/ppstack_test/ppImage/src/ppImageLoop.c
r33415 r34041 126 126 } 127 127 128 if (!ppImageCheckNoise (config, options, view)) { 129 ESCAPE("Unable to generate noisemap"); 130 } 131 128 132 // optionally degrade a MD image to 3pi exposure times 129 133 if (!ppImageAddNoise(config, options, view, input->fpa)){ -
branches/meh_branches/ppstack_test/ppImage/src/ppImageOptions.c
r33415 r34041 41 41 options->doStats = false; // Measure and save image statistics 42 42 options->checkCTE = false; // Measure pixel-based variance 43 options->checkNoise = false; // Measure cell-level variances. 43 44 options->applyParity = false; // Apply Cell parities 44 45 options->doMaskStats = false; // Calculate mask fractions 45 46 options->addNoise = false; //Degrade an MD image to a 3pi image 46 47 options->hasVideo = false; // Determine if this OTA has a video cell 48 options->useVideoDark = false; // Use video dark if we can? 49 options->useVideoMask = false; // Use video mask if we can? 47 50 // output files requested 48 51 options->BaseFITS = false; // create output image … … 319 322 320 323 options->checkCTE = psMetadataLookupBool(NULL, recipe, "CHECK.CTE"); 324 options->checkNoise = psMetadataLookupBool(NULL, recipe, "CHECK.NOISE"); 321 325 322 326 /* doMaskBuild : there are some cases where we require a mask, so we force doMaskBuild to be set even if the user specified 'FALSE' … … 360 364 options->fringeKeep = psMetadataLookupF32(NULL, recipe, "FRINGE.KEEP"); 361 365 366 // Video cell options 367 if (psMetadataLookup(recipe, "USE.VIDEO.DARK")) { 368 options->useVideoDark = psMetadataLookupBool(NULL,recipe,"USE.VIDEO.DARK"); 369 } 370 if (psMetadataLookup(recipe, "USE.VIDEO.MASK")) { 371 options->useVideoMask = psMetadataLookupBool(NULL,recipe,"USE.VIDEO.MASK"); 372 } 373 362 374 // Pattern correction 363 375 if (psMetadataLookup(format, "PATTERN.ROW.ORDER")) { … … 416 428 options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, recipe, "PATTERN.CONTINUITY.WIDTH"); 417 429 } 418 430 419 431 420 432 // Remnance options -
branches/meh_branches/ppstack_test/ppImage/src/ppImageParseCamera.c
r29833 r34041 22 22 ppImageOptions *options = ppImageOptionsParse(config); 23 23 24 // parse the header to extract out whether this OTA has video cells. 25 // CZW: 2012-05-01 I'm somewhat ashamed of what needs to be done to get to the header. There has to be a simpler way, right? 26 /* pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest */ 27 /* pmChip *chip; // Chip from FPA */ 28 /* while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) { */ 29 /* if (!chip->process || !chip->file_exists) { */ 30 /* continue; */ 31 /* } */ 32 /* /\* if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { *\/ */ 33 /* /\* continue; *\/ */ 34 /* /\* } *\/ */ 35 /* psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */ 36 /* if (psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE")) { */ 37 /* psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */ 38 /* char *Vptr = strchr(psMetadataLookupStr(NULL,chip->hdu->header,"CELLMODE"),'V'); */ 39 /* if (Vptr) { */ 40 /* options->hasVideo = true; */ 41 /* psWarning("VIDEO: %d %d %d\n",(int) options->hasVideo,(int) options->useVideoDark, (int) options->useVideoMask); */ 42 /* } */ 43 /* } */ 44 /* } */ 45 /* pmFPAviewReset(view); */ 46 /* psFree(view); */ 47 24 48 // the following are defined from the argument list, if given, 25 49 // otherwise they revert to the config information … … 42 66 } 43 67 if (options->doDark) { 44 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK", 45 PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) { 68 // Always load the regular Dark 69 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.DARK", "DARK", 70 PM_FPA_FILE_DARK, PM_DETREND_TYPE_DARK)) { 71 psError(PS_ERR_IO, false, "Can't find a dark image source"); 72 psFree(options); 73 return NULL; 74 } 75 // Sometimes load the video dark if we need it. 76 if (options->useVideoDark) { 77 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEODARK", "DARK", 78 PM_FPA_FILE_DARK, PM_DETREND_TYPE_VIDEODARK)) { 46 79 psError(PS_ERR_IO, false, "Can't find a dark image source"); 47 80 psFree(options); 48 81 return NULL; 49 82 } 83 } 50 84 } 51 85 if (options->doMask) { 52 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK", 53 PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) { 86 // Always load the regular mask 87 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.MASK", "MASK", 88 PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) { 89 psError(PS_ERR_IO, false, "Can't find a mask image source"); 90 psFree(options); 91 return NULL; 92 } 93 94 if (options->useVideoMask) { 95 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.VIDEOMASK", "MASK", 96 PM_FPA_FILE_MASK, PM_DETREND_TYPE_VIDEOMASK)) { 54 97 psError(PS_ERR_IO, false, "Can't find a mask image source"); 55 98 psFree(options); 56 99 return NULL; 57 100 } 101 } 58 102 } 59 103 if (options->doShutter) {
Note:
See TracChangeset
for help on using the changeset viewer.
