IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2009, 6:15:31 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppSub

  • branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubArguments.c

    r23352 r23594  
    260260    }
    261261
    262     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[3]);
     262    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
    263263
    264264
     
    282282    const char *refImage = psMetadataLookupStr(NULL, arguments, "-refimage"); // Name of reference image
    283283    if (refImage && strlen(refImage) > 0) {
    284         fileList("INPUT", refImage, "Name of the reference image", config);
     284        fileList("REF", refImage, "Name of the reference image", config);
    285285    }
    286286    const char *refMask = psMetadataLookupStr(NULL, arguments, "-refmask"); // Name of reference mask
  • branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubCamera.c

    r23352 r23594  
    3333
    3434    // look for the file on the RUN metadata
    35     pmFPAfile *file = pmFPAfileDefineFromRun(&status, config, filerule); // File to return
     35    pmFPAfile *file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return
    3636    if (!status) {
    3737        psError(PS_ERR_UNKNOWN, false, "Failed to load file definition for %s", filerule);
     
    6666static pmFPAfile *defineOutputFile(pmConfig *config, // Configuration
    6767                                   pmFPAfile *template,    // File to use as basis for definition
     68                                   bool source, // Is template a source (T), or for binding (F)?
    6869                                   char *filerule,     // Name of file rule
    6970                                   pmFPAfileType fileType // Type of file
     
    7172{
    7273
    73     pmFPAfile *file = pmFPAfileDefineFromFile(config, template, 1, 1, filerule);
     74    pmFPAfile *file = source ? pmFPAfileDefineFromFile(config, template, 1, 1, filerule) :
     75        pmFPAfileDefineOutput(config, template->fpa, filerule);
    7476    if (!file) {
    7577        psError(PS_ERR_IO, false, _("Unable to generate output file from %s"), filerule);
     
    9698
    9799    // look for the file on the RUN metadata
    98     pmFPAfile *file = pmFPAfileDefineFromRun(&status, config, filerule); // File to return
     100    pmFPAfile *file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return
    99101    if (!status) {
    100102        psError(PS_ERR_UNKNOWN, false, "Failed to load file definition for %s", filerule);
     
    108110    // define new version of file
    109111    if (!file) {
    110         pmFPAfileDefineOutput(config, bind ? bind->fpa : NULL, filerule);
     112        file = pmFPAfileDefineOutput(config, bind ? bind->fpa : NULL, filerule);
    111113        if (!status) {
    112114            psError(PS_ERR_UNKNOWN, false, "Failed to load file definition for %s", filerule);
     
    160162
    161163    // Output image
    162     pmFPAfile *output = defineOutputFile(config, input, "PPSUB.OUTPUT", PM_FPA_FILE_IMAGE);
    163     pmFPAfile *outMask = defineOutputFile(config, output, "PPSUB.OUTPUT.MASK", PM_FPA_FILE_MASK);
     164    pmFPAfile *output = defineOutputFile(config, input, true, "PPSUB.OUTPUT", PM_FPA_FILE_IMAGE);
     165    pmFPAfile *outMask = defineOutputFile(config, output, false, "PPSUB.OUTPUT.MASK", PM_FPA_FILE_MASK);
    164166    if (!output || !outMask) {
    165167        psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     
    170172    pmFPAfile *outVar = NULL;
    171173    if (inVar && refVar) {
    172         outVar = defineOutputFile(config, output, "PPSUB.OUTPUT.VARIANCE", PM_FPA_FILE_VARIANCE);
     174        outVar = defineOutputFile(config, output, false, "PPSUB.OUTPUT.VARIANCE", PM_FPA_FILE_VARIANCE);
    173175        if (!outVar) {
    174176            psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     
    180182
    181183    // Convolved input image
    182     pmFPAfile *inConvImage = defineOutputFile(config, input, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE);
    183     pmFPAfile *inConvMask = defineOutputFile(config, input, "PPSUB.INPUT.CONV.MASK", PM_FPA_FILE_MASK);
     184    pmFPAfile *inConvImage = defineOutputFile(config, input, true, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE);
     185    pmFPAfile *inConvMask = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.MASK",
     186                                             PM_FPA_FILE_MASK);
    184187    if (!inConvImage || !inConvMask) {
    185188        psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     
    187190    }
    188191    if (inVar) {
    189         pmFPAfile *inConvVar = defineOutputFile(config, input, "PPSUB.INPUT.CONV.VARIANCE",
     192        pmFPAfile *inConvVar = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.VARIANCE",
    190193                                                PM_FPA_FILE_VARIANCE);
    191194        if (!inConvVar) {
     
    196199
    197200    // Convolved ref image
    198     pmFPAfile *refConvImage = defineOutputFile(config, input, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE);
    199     pmFPAfile *refConvMask = defineOutputFile(config, input, "PPSUB.REF.CONV.MASK", PM_FPA_FILE_MASK);
     201    pmFPAfile *refConvImage = defineOutputFile(config, input, true, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE);
     202    pmFPAfile *refConvMask = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.MASK",
     203                                              PM_FPA_FILE_MASK);
    200204    if (!refConvImage || !refConvMask) {
    201205        psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     
    203207    }
    204208    if (refVar) {
    205         pmFPAfile *refConvVar = defineOutputFile(config, input, "PPSUB.REF.CONV.VARIANCE",
     209        pmFPAfile *refConvVar = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.VARIANCE",
    206210                                                 PM_FPA_FILE_VARIANCE);
    207211        if (!refConvVar) {
  • branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubDefineOutput.c

    r21524 r23594  
    2626    psAssert(view, "Require view");
    2727
    28     // generate an output readout
    2928    pmCell *outCell = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT"); // Output cell
    30     pmReadout *outRO = pmReadoutAlloc(outCell); // Output readout: subtraction
    3129    pmFPA *outFPA = outCell->parent->parent; // Output FPA
    3230    pmHDU *outHDU = outFPA->hdu; // Output HDU
    3331    if (!outHDU->header) {
    3432        outHDU->header = psMetadataAlloc();
     33    }
     34
     35    // generate an output readout (first check if it's already there by virtue of kernels)
     36    pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel
     37    if (!outRO) {
     38        outRO = pmReadoutAlloc(outCell); // Output readout: subtraction
    3539    }
    3640
  • branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubMatchPSFs.c

    r23352 r23594  
    5050
    5151    // Load pre-calculated kernel, if available
    52     pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNEL"); // RO with kernel
     52    pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel
    5353
    5454    // Sources in image, used for stamps: these must be loaded from previous analysis stages
     
    123123    float optThresh = psMetadataLookupF32(&mdok, recipe, "OPTIMUM.TOL"); // Tolerance for search
    124124
    125     // XXX Do we need/want to define different values for BAD and POOR subtraction vs BAD and POOR warp?
    126125    psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Bits to mask in inputs
    127     psImageMaskType maskPoor = pmConfigMaskGet("POOR.WARP", config); // Bits to mask for poor pixels
     126    psImageMaskType maskPoor = pmConfigMaskGet("CONV.POOR", config); // Bits to mask for poor pixels
    128127    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels
    129128
  • branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubSetMasks.c

    r21524 r23594  
    4343    psAssert(satValue, "SAT must be non-zero");
    4444
    45     psImageMaskType badValue = pmConfigMaskGet("BAD", config);
    46     psAssert(badValue, "BAD must be non-zero");
     45    psImageMaskType lowValue = pmConfigMaskGet("LOW", config);
     46    if (!lowValue) {
     47        // Look up old name for backward compatability
     48        lowValue = pmConfigMaskGet("BAD", config);
     49    }
     50    psAssert(lowValue, "LOW or BAD must be non-zero");
    4751
    4852    // input images
     
    5862    if (!inRO->mask) {
    5963        if (psMetadataLookupBool(NULL, recipe, "MASK.GENERATE")) {
    60             pmReadoutSetMask(inRO, satValue, badValue);
     64            pmReadoutSetMask(inRO, satValue, lowValue);
    6165        } else {
    6266            inRO->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
     
    6670    if (!refRO->mask) {
    6771        if (psMetadataLookupBool(NULL, recipe, "MASK.GENERATE")) {
    68             pmReadoutSetMask(refRO, satValue, badValue);
     72            pmReadoutSetMask(refRO, satValue, lowValue);
    6973        } else {
    7074            refRO->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
     
    9599    float poorFrac = psMetadataLookupF32(&mdok, recipe, "POOR.FRACTION"); // Fraction for "poor"
    96100
    97     psImageMaskType maskPoor = pmConfigMaskGet("POOR.WARP", config); // Bits to mask for poor pixels
     101    psImageMaskType maskPoor = pmConfigMaskGet("CONV.POOR", config); // Bits to mask for poor pixels
    98102    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels
    99103
Note: See TracChangeset for help on using the changeset viewer.