IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31441


Ignore:
Timestamp:
May 5, 2011, 10:08:44 AM (15 years ago)
Author:
eugene
Message:

merging updates from trunk

Location:
branches/eam_branches/ipp-20110404/ppSub/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/ppSub/src/ppSubDefineOutput.c

    r31156 r31441  
    4444
    4545    // Convolved input images
    46     pmReadout *inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input readout
    47     pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference readout
     46    psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE);
     47    bool noConvolve = psMetadataLookupBool(NULL, recipe, "NOCONVOLVE"); // Do not use convolved images.
     48
     49    pmReadout *inConv;
     50    if (noConvolve) {
     51      inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); // Input readout
     52    }
     53    else {
     54      inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input readout
     55    }
     56    pmReadout *refConv;
     57    if (noConvolve) {
     58      refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); // Reference readout
     59    }
     60    else {
     61      refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference readout
     62    }
    4863    psFree(view);
    4964
     
    6075        kernels = psMetadataLookupPtr(&mdok, analysis, PM_SUBTRACTION_ANALYSIS_KERNEL);
    6176    }
    62     if (!kernels) {
     77    if (!kernels && !noConvolve) {
    6378        psError(PPSUB_ERR_UNKNOWN, true, "Unable to find SUBTRACTION.KERNEL");
    6479        psFree(outRO);
     
    6681    }
    6782    psAssert (hdu, "unable to find HDU");
    68     psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.KERNEL", 0, "Subtraction kernel", kernels->description);
     83    if (!noConvolve) {
     84      psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.KERNEL", 0, "Subtraction kernel", kernels->description);
     85    }
    6986    outHDU->header = psMetadataCopy(outHDU->header, hdu->header);
    7087
  • branches/eam_branches/ipp-20110404/ppSub/src/ppSubLoop.c

    r30619 r31441  
    107107
    108108    // XXX if it exists, use the POS1, POS2 successs for the FWHMs
    109     if (!ppSubMatchPSFs(data)) {
     109    psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE);
     110    bool noConvolve = psMetadataLookupBool(NULL, recipe, "NOCONVOLVE"); // Do not use convolved images.
     111    if (noConvolve) {
     112      psWarning("not matching PSFs because NOCONVOLVE is TRUE\n");
     113    } else {
     114      if (!ppSubMatchPSFs(data)) {
    110115        psError(psErrorCodeLast(), false, "Unable to match PSFs.");
    111116        success = false;
    112117        goto ESCAPE;
    113     }
     118      }
     119    }
     120
    114121
    115122    if (data->quality) {
     
    132139
    133140    // Close input files
     141    if (!noConvolve) {
    134142    if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) {
    135143        psError(PPSUB_ERR_IO, false, "Unable to close input files.");
     
    137145        goto ESCAPE;
    138146    }
    139 
     147    }
    140148    if (!ppSubLowThreshold(data)) {
    141149        psError(psErrorCodeLast(), false, "Unable to threshold images.");
     
    157165    }
    158166
     167    if (!noConvolve) {
    159168    if (!data->quality && !ppSubMakePSF(data)) {
    160169        psError(psErrorCodeLast(), false, "Unable to generate PSF.");
     
    162171        goto ESCAPE;
    163172    }
    164 
     173    }
    165174    // Now we've got a PSF, blow away detections in case they're confused with real output detections
    166175    {
     
    187196    }
    188197    // dumpout(config, "diff.2a.fits");
    189 
     198    if (noConvolve) {
     199      if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) {
     200        psError(PPSUB_ERR_IO, false, "Unable to close input files.");
     201        success = false;
     202        goto ESCAPE;
     203      }
     204    }
     205   
    190206    // Higher order background subtraction using psphot
    191207    if (!ppSubBackground(config)) {
  • branches/eam_branches/ipp-20110404/ppSub/src/ppSubMakePSF.c

    r31156 r31441  
    3737
    3838    bool reverse = psMetadataLookupBool(NULL, config->arguments, "REVERSE"); // Reverse sense of subtraction?
    39 
     39   
    4040    bool mdok = false;                  // Status of MD lookup
    4141    pmReadout *minuend = NULL;          // Image that will be positive following subtraction
    4242    pmFPAfile *minuendFile = NULL;      // File for minuend image
    4343    pmFPAview *view = ppSubViewReadout(); // View to readout
    44     if (reverse) {
     44
     45    psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSUB_RECIPE); // Recipe for ppSub
     46    bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images.
     47
     48    if (!noConvolve) {
     49      printf("Using Convolved images because NOCONVOLVE is FALSE\n");
     50      if (reverse) {
    4551        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV");
    46         minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.REF.CONV");
    47     } else {
     52        minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.REF.CONV");
     53      } else {
    4854        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV");
    49         minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.INPUT.CONV");
     55        minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.INPUT.CONV");
     56      }
     57    }
     58    else {
     59      psWarning("Not using Convolved images because NOCONVOLVE  is TRUE\n");
     60      if (reverse) {
     61        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF");
     62        minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.REF");
     63      } else {
     64        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT");
     65        minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.INPUT");
     66      }
    5067    }
    5168
  • branches/eam_branches/ipp-20110404/ppSub/src/ppSubReadoutPhotometry.c

    r31363 r31441  
    6060    // grab the PSF information from the pmFPAfile PSPHOT.PSF.LOAD
    6161    pmFPAfile *psfFile = psMetadataLookupPtr(&mdok, config->files, "PSPHOT.PSF.LOAD"); // PSF file
     62
    6263    ppSubCopyPSF (photFile, psfFile, view);
    6364
  • branches/eam_branches/ipp-20110404/ppSub/src/ppSubReadoutSubtract.c

    r30619 r31441  
    3131
    3232    bool reverse = psMetadataLookupBool(&mdok, config->arguments, "REVERSE"); // Reverse sense of subtraction?
     33    bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images.
    3334    bool addPair = psMetadataLookupBool(&mdok, recipe, "ADD.NOT.SUBTRACT"); // add instead of subtracting
    3435
     
    3839    pmReadout *minuend = NULL;          // Positive image
    3940    pmReadout *subtrahend = NULL;       // Negative image
    40     if (reverse) {
     41    if (!noConvolve) {
     42      printf("Using Convolved images because NOCONVOLVE is FALSE\n");
     43      if (reverse) {
    4144        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV");
    4245        subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV");
    43     } else {
     46      } else {
    4447        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV");
    4548        subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV");
     49      }
     50    }
     51    else {
     52      psWarning("Not using Convolved images because NOCONVOLVE  is TRUE\n");
     53      if (reverse) {
     54        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF");
     55        subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT");
     56      } else {
     57        minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT");
     58        subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF");
     59      }
    4660    }
    4761
  • branches/eam_branches/ipp-20110404/ppSub/src/ppSubThreshold.c

    r30619 r31441  
    9595
    9696    // Input images
    97     pmReadout *in = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input image
     97    bool noConvolve = psMetadataLookupBool(NULL, recipe, "NOCONVOLVE");
     98
     99    pmReadout *in;
     100    if (noConvolve) {
     101      in = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); // Input image
     102    }
     103    else {
     104      in = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input image
     105    }
    98106    if (!in) {
    99107        psError(PPSUB_ERR_UNKNOWN, false, "Unable to find readout.");
     
    102110    }
    103111
    104     pmReadout *ref = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference image
     112    pmReadout *ref;
     113    if (noConvolve) {
     114      ref = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); // Reference image
     115    }
     116    else {
     117      ref = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference image
     118    }
    105119    if (!ref) {
    106120        psError(PPSUB_ERR_UNKNOWN, false, "Unable to find readout.");
Note: See TracChangeset for help on using the changeset viewer.