IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 10, 2010, 6:28:51 PM (16 years ago)
Author:
watersc1
Message:

Skycell Summary and stack Association stuff should be finished. I'll merge and do final tests on monday.

Location:
branches/czw_branch/20100519
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20100519

  • branches/czw_branch/20100519/ppSub/src/ppSubMaskStats.c

    r28043 r28304  
    99
    1010
    11 bool ppSubMaskStats(pmConfig *config, pmFPAview *view, psMetadata *stats) {
     11bool ppSubMaskStats(pmConfig *config, pmFPAview *view, psMetadata *stats)
     12{
    1213  PS_ASSERT_PTR_NON_NULL(view, false);
    1314  PS_ASSERT_PTR_NON_NULL(config, false);
     15
     16  pmReadout *readout = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT");
     17  if (!stats || !readout || !readout->data_exists) {
     18      // Nothing to process
     19      return(true);
     20  }
    1421
    1522  bool status;
    1623
    1724  psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, PPSUB_RECIPE);
    18   psU16 staticMaskVal = psMetadataLookupU32(&status, recipe, "MASKSTAT.STATIC");
    19   psU16 magicMaskVal = psMetadataLookupU32(&status, recipe, "MASKSTAT.MAGIC");
    20   psU16 dynamicMaskVal = psMetadataLookupU32(&status, recipe, "MASKSTAT.DYNAMIC");
    21   psU16 advisoryMaskVal = psMetadataLookupU32(&status, recipe, "MASKSTAT.ADVISORY");
     25  psImageMaskType staticMaskVal = psMetadataLookupImageMask(&status, recipe, "MASKSTAT.STATIC");
     26  psImageMaskType magicMaskVal = psMetadataLookupImageMask(&status, recipe, "MASKSTAT.MAGIC");
     27  psImageMaskType dynamicMaskVal = psMetadataLookupImageMask(&status, recipe, "MASKSTAT.DYNAMIC");
     28  psImageMaskType advisoryMaskVal = psMetadataLookupImageMask(&status, recipe, "MASKSTAT.ADVISORY");
    2229
    2330  psS32 Npix_valid = 0;
     
    2734  psS32 Npix_advisory = 0;
    2835
    29   psWarning("ppSubMaskStats: %d %d %d %d\n",staticMaskVal,magicMaskVal,dynamicMaskVal,advisoryMaskVal);
    30  
    31   pmReadout *readout = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT");
    32   if (!readout || !readout->data_exists) {
    33     // Nothing to process
    34     return(true);
    35   }
    3636  psImage *mask = readout->mask;  // Mask of interest;
    3737  if (!pmSingleImageMaskStats(mask,&Npix_valid,&Npix_static,&Npix_magic,
    38                               &Npix_dynamic,&Npix_advisory,
    39                               staticMaskVal,magicMaskVal,
    40                               dynamicMaskVal,advisoryMaskVal)) {
     38                              &Npix_dynamic,&Npix_advisory,
     39                              staticMaskVal,magicMaskVal,
     40                              dynamicMaskVal,advisoryMaskVal)) {
    4141    psError(PS_ERR_UNKNOWN, false, "Unable to calculate masks for readout.");
    4242    return(false);
    4343  }
    4444  psMetadataAddS32(stats, PS_LIST_TAIL,"MASKFRAC_NPIX", 0,
    45                    "Number of valid pixels", Npix_valid);
     45                   "Number of valid pixels", Npix_valid);
    4646  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_STATIC", 0,
    47                    "Fraction of pixels statically masked", (float) Npix_static / Npix_valid);
     47                   "Fraction of pixels statically masked", (float) Npix_static / Npix_valid);
    4848  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_DYNAMIC", 0,
    49                    "Fraction of pixels dynamically masked", (float) Npix_dynamic / Npix_valid);
     49                   "Fraction of pixels dynamically masked", (float) Npix_dynamic / Npix_valid);
    5050  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_MAGIC", 0,
    51                    "Fraction of pixels magically masked", (float) Npix_magic / Npix_valid);
     51                   "Fraction of pixels magically masked", (float) Npix_magic / Npix_valid);
    5252  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_ADVISORY", 0,
    53                    "Fraction of pixels masked as an advisory", (float) Npix_advisory / Npix_valid);
     53                   "Fraction of pixels masked as an advisory", (float) Npix_advisory / Npix_valid);
    5454  return(true);
    5555}
Note: See TracChangeset for help on using the changeset viewer.