IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 1, 2013, 5:01:08 PM (13 years ago)
Author:
watersc1
Message:

Merging changes that implement FPA level background continuity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStack.c

    r34842 r35081  
    13851385
    13861386  psVector *pixelData = psVectorAlloc(input->n,PS_TYPE_F32);
     1387  psVector *pixelMask = psVectorAlloc(input->n,PS_TYPE_VECTOR_MASK);
    13871388  psStats  *stats     = psStatsAlloc(PS_STAT_ROBUST_MEDIAN);
    13881389
     
    13921393        pmReadout *ro  = stack->data[i];
    13931394        psImage *image = ro->image;
     1395        pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0;
    13941396        pixelData->data.F32[i] = image->data.F32[y][x];
     1397        if (isfinite(image->data.F32[y][x])&&
     1398            (fabs(image->data.F32[y][x]) < 1e5)) {
     1399          pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0;
     1400        }
     1401        else {
     1402          pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1;
     1403        }
     1404#if (0)
     1405      if ((x == 59)&&(y > 40)&&(y < 50)) {
     1406          fprintf(stderr,"%d %d %d %d %g\n",
     1407                  x,y,i,pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i],pixelData->data.F32[i]);
     1408        }
    13951409      }
    1396       if (!psVectorStats(stats,pixelData,NULL,NULL,0)) {
     1410#endif
     1411      if (!psVectorStats(stats,pixelData,NULL,pixelMask,1)) {
    13971412        psError(PS_ERR_UNKNOWN, false, "Unable to calculate median");
    13981413        psFree(stats);
    13991414        psFree(pixelData);
     1415        psFree(pixelMask);
    14001416        psFree(stack);
    14011417        return(false);
     
    14031419      combined->image->data.F32[y][x] = stats->robustMedian;
    14041420      combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = 0;
     1421#if (0)
     1422      if ((x == 59)&&(y > 40)&&(y < 50)) {
     1423        fprintf(stderr,"%d %d %d %d %g\n",
     1424                x,y,-1,combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x],
     1425                combined->image->data.F32[y][x]);
     1426      }
     1427#endif
    14051428    }
    14061429  }
     
    14081431  psFree(stats);
    14091432  psFree(pixelData);
     1433  psFree(pixelMask);
    14101434  psFree(stack);
    14111435  return (true);
Note: See TracChangeset for help on using the changeset viewer.