IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30255


Ignore:
Timestamp:
Jan 12, 2011, 4:31:04 PM (15 years ago)
Author:
watersc1
Message:

Fixed the blank image bug. Now to figure out how to get that offset stored someplace

Location:
branches/czw_branch/20101203
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203/psLib/src/fits/psFitsScale.c

    r30119 r30255  
    213213    switch (options->scaling) {
    214214      case PS_FITS_SCALE_STDEV_POSITIVE:
     215      case PS_FITS_SCALE_LOG_STDEV_POSITIVE:
    215216        // Put (mean - N sigma) at the lowest possible value: predominantly positive images
    216217        imageVal = mean - options->stdevNum * stdev;
     
    218219        break;
    219220      case PS_FITS_SCALE_STDEV_NEGATIVE:
     221      case PS_FITS_SCALE_LOG_STDEV_NEGATIVE:
    220222        // Put (mean + N sigma) at the highest possible value: predominantly negative images
    221223        imageVal = mean + options->stdevNum * stdev;
     
    223225        break;
    224226      case PS_FITS_SCALE_STDEV_BOTH:
     227      case PS_FITS_SCALE_LOG_STDEV_BOTH:
    225228        // Put mean right in the middle: images with an equal abundance of positive and negative values
    226229        imageVal = mean;
     
    263266        for (int x = 0; x < numCols; x++) {
    264267          psF32 value = image->data.F32[y][x];
    265           if (!isfinite(value)) {
     268          if (isfinite(value)) {
    266269            if (value < offset) {
    267270              offset = value;
     
    275278        for (int x = 0; x < numCols; x++) {
    276279          psF64 value = image->data.F64[y][x];
    277           if (!isfinite(value)) {
     280          if (isfinite(value)) {
    278281            if (value < offset) {
    279282              offset = value;
     
    289292    }
    290293    // We only need to offset images that go negative.
    291     if (offset > 0.0) {
    292       offset = 0.0;
    293     }
     294/*     if (offset > 0.0) { */
     295/*       offset = 0.0; */
     296/*     } */
    294297    // Write offset to header
    295298    // How?
     
    300303      for (int y = 0; y < numRows; y++) {
    301304        for (int x = 0; x < numCols; x++) {
     305          if (x == 2331 && y == 2843) {
     306            fprintf(stderr,"psFS32: %d %d %g %g %g\n",x,y,offset,image->data.F32[y][x],log10(image->data.F32[y][x] - offset));
     307          }
    302308          image->data.F32[y][x] = (log10( image->data.F32[y][x] - offset));
    303309        }
     
    307313        for (int y = 0; y < numRows; y++) {
    308314          for (int x = 0; x < numCols; x++) {
     315            //      fprintf(stderr,"psFS64: %d %d %g %g %g\n",x,y,offset,image->data.F64[y][x],log10(image->data.F64[y][x] - offset));
    309316            image->data.F64[y][x] = (log10( image->data.F64[y][x] - offset));
    310317          }
     
    704711    if (strcasecmp(string, "STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_STDEV_NEGATIVE;
    705712    if (strcasecmp(string, "STDEV_BOTH") == 0)     return PS_FITS_SCALE_STDEV_BOTH;
     713    if (strcasecmp(string, "LOG_RANGE") == 0)      return PS_FITS_SCALE_LOG_RANGE;
     714    if (strcasecmp(string, "LOG_STDEV_POSITIVE") == 0) return PS_FITS_SCALE_LOG_STDEV_POSITIVE;
     715    if (strcasecmp(string, "LOG_STDEV_NEGATIVE") == 0) return PS_FITS_SCALE_LOG_STDEV_NEGATIVE;
     716    if (strcasecmp(string, "LOG_STDEV_BOTH") == 0) return PS_FITS_SCALE_LOG_STDEV_BOTH;
    706717    if (strcasecmp(string, "MANUAL") == 0)         return PS_FITS_SCALE_MANUAL;
    707718
  • branches/czw_branch/20101203/psModules/src/camera/pmFPAfileDefine.c

    r27657 r30255  
    282282              case PS_FITS_SCALE_NONE:
    283283              case PS_FITS_SCALE_RANGE:
     284              case PS_FITS_SCALE_LOG_RANGE:
    284285                // No options required
    285286                break;
    286287              case PS_FITS_SCALE_STDEV_POSITIVE:
    287288              case PS_FITS_SCALE_STDEV_NEGATIVE:
     289              case PS_FITS_SCALE_LOG_STDEV_POSITIVE:
     290              case PS_FITS_SCALE_LOG_STDEV_NEGATIVE:
    288291                options->stdevNum = parseOptionFloat(scheme, "STDEV.NUM", source); // Padding to edge
    289292                if (!isfinite(options->stdevNum)) {
     
    295298                // Flow through
    296299              case PS_FITS_SCALE_STDEV_BOTH:
     300              case PS_FITS_SCALE_LOG_STDEV_BOTH:
    297301                options->stdevBits = parseOptionInt(scheme, "STDEV.BITS", source, 0); // Bits for stdev
    298302                if (options->stdevBits <= 0) {
Note: See TracChangeset for help on using the changeset viewer.