- Timestamp:
- Jun 19, 2012, 5:24:19 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ppImage/src (modified) (1 prop)
-
ppImage/src/ppImageDetrendReadout.c (modified) (5 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/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
Note:
See TracChangeset
for help on using the changeset viewer.
