IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13613


Ignore:
Timestamp:
Jun 4, 2007, 10:17:11 AM (19 years ago)
Author:
Paul Price
Message:

Mask is optional, created if not provided.

Location:
trunk/ppStack/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCamera.c

    r13528 r13613  
    3535
    3636        psString mask = psMetadataLookupStr(NULL, input, "MASK"); // Name of mask
    37         if (!mask || strlen(mask) == 0) {
    38             psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks MASK of type STR", item->name);
    39             psFree(iter);
    40             return false;
    41         }
    4237
    4338        float seeing = psMetadataLookupF32(NULL, input, "SEEING"); // Seeing FWHM
     
    8075        }
    8176
    82         // Add the mask file
    83         psArray *maskFiles = psArrayAlloc(1); // Array of filenames for this FPA
    84         maskFiles->data[0] = psMemIncrRefCounter(mask);
    85         psMetadataAddArray(config->arguments, PS_LIST_TAIL, "MASK.FILENAMES", PS_META_REPLACE,
    86                            "Filenames of mask files", maskFiles);
    87         psFree(maskFiles);
     77        // Optionally add the mask file
     78        if (mask && strlen(mask) > 0) {
     79            psArray *maskFiles = psArrayAlloc(1); // Array of filenames for this FPA
     80            maskFiles->data[0] = psMemIncrRefCounter(mask);
     81            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "MASK.FILENAMES", PS_META_REPLACE,
     82                               "Filenames of mask files", maskFiles);
     83            psFree(maskFiles);
    8884
    89         bool status;
    90         pmFPAfile *maskFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPSTACK.INPUT.MASK", "MASK.FILENAMES");
    91         if (!status) {
    92             psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", i, mask);
    93             return false;
    94         }
    95         if (maskFile->type != PM_FPA_FILE_MASK) {
    96             psError(PS_ERR_IO, true, "PPSTACK.INPUT.MASK is not of type MASK");
    97             return false;
     85            bool status;
     86            pmFPAfile *maskFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPSTACK.INPUT.MASK", "MASK.FILENAMES");
     87            if (!status) {
     88                psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", i, mask);
     89                return false;
     90            }
     91            if (maskFile->type != PM_FPA_FILE_MASK) {
     92                psError(PS_ERR_IO, true, "PPSTACK.INPUT.MASK is not of type MASK");
     93                return false;
     94            }
    9895        }
    9996
  • trunk/ppStack/src/ppStackReadout.c

    r13515 r13613  
    8080        psArrayAdd(stack, ARRAY_BUFFER, data);
    8181        psFree(data);                   // Drop reference
     82
     83        // Ensure there is a mask, or pmStackCombine will complain
     84        if (!ro->mask) {
     85            ro->mask = psImageAlloc(ro->image->numCols, ro->image->numRows, PS_TYPE_MASK);
     86            psImageInit(ro->mask, 0);
     87        }
     88
    8289        fileNum++;
    8390    }
Note: See TracChangeset for help on using the changeset viewer.