IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 30, 2023, 9:55:36 AM (3 years ago)
Author:
eugene
Message:

merge from branches/eam_branches/ppImage.20230123: add new non-linearity correction using new psSpline

Location:
trunk/ppImage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage

  • trunk/ppImage/src/ppImageDetrendReadout.c

    r39501 r42340  
    124124      // psLogMsg ("ppImage", 6, "nonlinear correction: %f sec\n", psTimerMark ("detrend.readout"));
    125125    }
     126    // New Non-linearity correction (exclusive of the above)
     127    if (options->doNewNonLin) {
     128      if (!ppImageDetrendNewNonLinear(input, detview, config)) {
     129        psError(PS_ERR_UNKNOWN, false, "Unable to correct Non-Linearity with new version (2023)");
     130        psFree(detview);
     131        return(false);
     132      }
     133      // psLogMsg ("ppImage", 6, "nonlinear correction: %f sec\n", psTimerMark ("detrend.readout"));
     134    }
    126135
    127136    // set up the dark and bias
     
    188197            psImageUnbin (noiseImage, noiseMap->image, binning);
    189198            psFree (binning);
    190             // Stolen from pmSkySubtract.c
    191             // CZW: Unneeded, as psImageUnbin does the bilinear interpolation?  It still looks blocky.
    192 /*          psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe */
    193 /*          psAssert(recipe, "Should be there!"); */
    194 
    195 /*          psS32 xBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.XBIN"); */
    196 /*          psS32 yBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.YBIN"); */
    197 /*          psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, */
    198 /*                                                                             noiseMap->image, */
    199 /*                                                                             NULL, NULL, */
    200 /*                                                                             0, 0.0, 0.0, 0, 0, 0.0); */
    201 /*          for (psS32 row = 0; row < input->image->numRows; row++) { */
    202 /*            for (psS32 col = 0; col < input->image->numCols; col++) { */
    203 /*              // We calculate the F32 value of the pixel coordinates in the */
    204 /*              // binned image and then use a pixel interpolation routine to */
    205 /*              // determine the value of the pixel at that location. */
    206 /*              psF32 binRowF64 = ((psF32) row) / ((psF32) yBinFactor); */
    207 /*              psF32 binColF64 = ((psF32) col) / ((psF32) xBinFactor); */
    208 /*              // We add 0.5 to the pixel locations since the pixel */
    209 /*              // interpolation routine defines the location of pixel */
    210 /*              // (i, j) as (i+0.5, j+0.5). */
    211 /*              binRowF64+= 0.5; */
    212 /*              binColF64+= 0.5; */
    213 
    214 /*              double binPixel; */
    215 /*              if (!psImagePixelInterpolate(&binPixel, NULL, NULL, binColF64, binRowF64, interp)) { */
    216 /*                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); */
    217 /*                psFree(interp); */
    218 /*                psFree(noiseImage); */
    219 /*                return NULL; */
    220 /*              } */
    221 /*              noiseImage->data.F32[row][col] = binPixel; */
    222 /*            } */
    223 /*          } */
    224 /*          psFree(interp); */
    225199        }
    226200
Note: See TracChangeset for help on using the changeset viewer.