IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2022, 5:08:10 PM (4 years ago)
Author:
tdeboer
Message:

adding CTE detection functionality and new CTE source flag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpSetMaskBits.c

    r27096 r42293  
    2020 * updated in the config metadata.
    2121 */
     22 
    2223bool pswarpSetMaskBits (pmConfig *config)
    2324{
     
    2627    psImageMaskType maskOut = 0x00;                     // mask for the output image
    2728
     29    // Look up recipe values
     30    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PSWARP_RECIPE); // Recipe for ppSim
     31    psAssert(recipe, "We checked this earlier, so it should be here.");
     32    bool doDetectCTE = psMetadataLookupBool(NULL, recipe, "DETECT.CTE"); // Do detections on pixels underneath CTE masks
     33
    2834    // this function sets the required single-image mask bits
    29     if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) {
    30         psError (psErrorCodeLast(), false, "Unable to define the mask bit values");
    31         return false;
     35    if(!doDetectCTE) {
     36      if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) {
     37          psError (psErrorCodeLast(), false, "Unable to define the mask bit values");
     38          return false;
     39      }
     40    } else {
     41      psMetadata *maskrecipe = psMetadataLookupMetadata(NULL, config->recipes, "MASKS"); // The recipe
     42      if (!maskrecipe) {
     43          psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find MASKS recipe.");
     44          return false;
     45      }
     46      if (!pswarpMaskSetInMetadata(&maskIn, &markIn, maskrecipe)) {
     47          psError (psErrorCodeLast(), false, "Unable to determine the mask value");
     48          return false;
     49      }
    3250    }
    33 
     51   
    3452    // mask for non-linear flat regions (default to DETECTOR if not defined)
    3553    psImageMaskType badMask = pmConfigMaskGet("CONV.BAD", config);
Note: See TracChangeset for help on using the changeset viewer.