IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2023, 12:59:09 PM (3 years ago)
Author:
tdeboer
Message:

burntool running updates

File:
1 edited

Legend:

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

    r26895 r42395  
    2424  }
    2525  long Nrows = psFitsTableSize(fits);
    26 
    2726  long row = 0;
    2827
    2928  psLogMsg ("ppImageBurntoolMask", 4, "Inside burntool mask %ld", Nrows);
    3029
     30  /* The new burntool tables and method coming into play in 2022 has a slightly different format (an extra column). Need to differentiate */
     31  psS16 BURNTOOL_STATE_GOOD = psMetadataLookupS16(NULL, config->camera, "BURNTOOL.STATE.GOOD");
     32
    3133  /* Redirects and Memory juggling. */
    3234  view->readout = 0;
    3335  psImage *image = mask->mask;
    34 
    3536
    3637  /* Set the maskValue from the recipes. */
     
    6465                  );
    6566#endif
    66         for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");
     67
     68        /* do separate masking strategy for old (14 and lower) and new burntool tables*/
     69        if (BURNTOOL_STATE_GOOD >= 15) {
     70          for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");
    6771             i <= psMetadataLookupS32(&status,rowMD,"exfit");
    6872             i++) {
    6973
    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            if (psMetadataLookupS32(&status,rowMD,"up") == 0) {
     75              for (int j = psMetadataLookupS32(&status,rowMD,"eyfit"); j <= psMetadataLookupS32(&status,rowMD,"y0"); j++) {
     76                #if PPIMAGE_BURNTOOL_DEBUG
     77                psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
    7478                       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;
     79                #endif
     80                image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
     81              }
     82            } else {
     83              for (int j = psMetadataLookupS32(&status,rowMD,"sy"); j < psMetadataLookupS32(&status,rowMD,"eyfit") ; j++) {
     84                #if PPIMAGE_BURNTOOL_DEBUG
     85                psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
     86                       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue);
     87                #endif
     88                image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
     89              }
    7790            }
    7891          }
    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",
     92        } else {
     93          for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");
     94             i <= psMetadataLookupS32(&status,rowMD,"exfit");
     95             i++) {
     96
     97            if (psMetadataLookupS32(&status,rowMD,"up") == 0) {
     98              for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) {
     99                #if PPIMAGE_BURNTOOL_DEBUG
     100                psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
    83101                       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;
     102                #endif
     103                image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
     104              }
     105            }
     106            else {
     107              for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) {
     108                #if PPIMAGE_BURNTOOL_DEBUG
     109                psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
     110                       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue);
     111                #endif
     112                image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
     113              }
    86114            }
    87115          }
     116
    88117        }
     118
    89119
    90120      }
Note: See TracChangeset for help on using the changeset viewer.