IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 7:38:09 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201 (main change was PATTERN to PATTERN.ROW, added PATTERN.CELL)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageBurntoolMask.c

    r25299 r26895  
    33#endif
    44
    5 /* #define PPIMAGE_BURNTOOL_DEBUG 1 */
     5#define PPIMAGE_BURNTOOL_DEBUG 0
    66
    77#include "ppImage.h"
     
    2323    return(false);
    2424  }
    25   long Nrows = psFitsTableSize(fits); 
     25  long Nrows = psFitsTableSize(fits);
    2626
    2727  long row = 0;
     
    3333  psImage *image = mask->mask;
    3434
    35  
     35
    3636  /* Set the maskValue from the recipes. */
    3737  psImageMaskType maskValue = options->burntoolMask;
    38 #ifdef PPIMAGE_BURNTOOL_DEBUG
     38#if PPIMAGE_BURNTOOL_DEBUG
    3939  psLogMsg("ppImageBurntoolMask", 4, "Status: %ld %d\n",Nrows,maskValue);
    4040#endif
     
    4747
    4848    if (psMetadataLookupS32(&status,rowMD,"cell") == burntool_cell) {
    49       if (((options->burntoolTrails & 0x01)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0))||
    50           ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))||
    51           ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0))) {
    52         /*       If the fit fails, burntool reports zero here.  This
    53                 signifies that it expected to see a trail (else why
    54                 fit) but did not find it when it attempted to
    55                 correct. */
    56 #ifdef PPIMAGE_BURNTOOL_DEBUG
    57         psLogMsg ("ppImageBurntoolMask", 4, "Masking! %d (%d %d %d) %d %d",
    58                   psMetadataLookupS32(&status,rowMD,"cell"),
    59                   ((options->burntoolTrails & 0x0001)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0)),
    60                   ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1)),
    61                   ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)),
    62                   options->burntoolTrails,
    63                   maskValue
    64                   );
     49      if (((options->burntoolTrails & 0x01)&&(psMetadataLookupS32(&status,rowMD,"func") == 4))||
     50          (((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))||
     51           ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)))) {
     52        /*       If the fit fails, burntool reports zero here.  This
     53                signifies that it expected to see a trail (else why
     54                fit) but did not find it when it attempted to
     55                correct. */
     56#if PPIMAGE_BURNTOOL_DEBUG
     57        psLogMsg ("ppImageBurntoolMask", 4, "Masking! %d (%d %d %d) %d %d",
     58                  psMetadataLookupS32(&status,rowMD,"cell"),
     59                  ((options->burntoolTrails & 0x0001)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0)),
     60                  ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1)),
     61                  ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)),
     62                  options->burntoolTrails,
     63                  maskValue
     64                  );
    6565#endif
    66         for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");
    67              i <= psMetadataLookupS32(&status,rowMD,"exfit");
    68              i++) {
     66        for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");
     67             i <= psMetadataLookupS32(&status,rowMD,"exfit");
     68             i++) {
    6969
    70           if (psMetadataLookupS32(&status,rowMD,"up") == 0) {
    71             for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) {
    72 /* #ifdef PPIMAGE_BURNTOOL_DEBUG */
    73 /*            psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */
    74 /*                     i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */
    75 /* #endif */
    76               image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
    77             }
    78           }
    79           else {
    80             for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) {
    81 /* #ifdef PPIMAGE_BURNTOOL_DEBUG */
    82 /*            psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */
    83 /*                     i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */
    84 /* #endif */
    85               image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
    86             }
    87           }
    88         }
     70          if (psMetadataLookupS32(&status,rowMD,"up") == 0) {
     71            for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) {
     72#if PPIMAGE_BURNTOOL_DEBUG
     73              psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
     74                       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue);
     75#endif
     76              image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
     77            }
     78          }
     79          else {
     80            for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) {
     81#if PPIMAGE_BURNTOOL_DEBUG
     82              psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
     83                       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue);
     84#endif
     85              image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
     86            }
     87          }
     88        }
    8989
    9090      }
     
    9595  return(status);
    9696}
    97            
    98 
    99 
    100    
Note: See TracChangeset for help on using the changeset viewer.