IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 28, 2008, 12:14:12 PM (18 years ago)
Author:
Paul Price
Message:

Was doing the photometry on the stacked image!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubReadout.c

    r17820 r17834  
    196196
    197197    // Photometry stage 1: measure the PSF
     198    pmPSF *psf = NULL;                  // PSF for photometry
    198199    if (psMetadataLookupBool(NULL, config->arguments, "PHOTOMETRY")) {
    199200        // We use a summed image as the basis for the PSF: this will have the maximum S/N.
     
    233234        psMetadataRemoveKey(photRO->analysis, "PSPHOT.HEADER");
    234235
    235         pmPSF *psf = psMetadataLookupPtr(NULL, photRO->parent->parent->analysis, "PSPHOT.PSF"); // PSF
     236        psf = psMemIncrRefCounter(psMetadataLookupPtr(NULL, photRO->parent->parent->analysis, "PSPHOT.PSF"));
    236237        if (!psf) {
    237238            psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSF from psphot");
     
    239240        }
    240241
    241         pmReadout *psfRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.PSF.LOAD");
    242         if (!psfRO) {
    243             psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PSPHOT.PSF.LOAD");
    244             return false;
    245         }
    246         psMetadataAddPtr(psfRO->parent->parent->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN,
    247                          "PSF from matched addition", psf);
     242        pmCell *photCell = pmFPAfileThisCell(config->files, view, "PSPHOT.INPUT");
     243        pmCellFreeReadouts(photCell);
    248244    }
    249245
     
    308304    }
    309305
     306    psTraceSetLevel("psphot", 6);
     307
    310308    // Photometry stage 2: find and measure sources on the subtracted image
    311309    if (psMetadataLookupBool(NULL, config->arguments, "PHOTOMETRY")) {
    312310        // The PSF should already be stored for the readout
    313311        pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
     312        pmFPACopy(photFile->fpa, outRO->parent->parent->parent);
     313
     314        pmReadout *psfRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.PSF.LOAD");
     315        if (!psfRO) {
     316            psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PSPHOT.PSF.LOAD");
     317            return false;
     318        }
     319        psMetadataAddPtr(psfRO->parent->parent->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN,
     320                         "PSF from matched addition", psf);
    314321
    315322        // Need to ensure aperture residual is not calculated
Note: See TracChangeset for help on using the changeset viewer.