IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 6, 2011, 1:32:31 PM (15 years ago)
Author:
eugene
Message:
  • clarified the output to show the stages and their timing more clearly
  • psphotStackReadout now uses the same functions as psphotReadout (deprecated FitLinearStack, ExtendedAnalysisByObject, RadialAnalysisByObject, etc)
  • psphotStack now does 2nd (5 sigma) detection pass and radial photometry of the un-matched image (as well as the matched images)
  • for speed, fitting uses a smaller subset of pixels than subtraction: the model is extended when the subtraction is performed to avoid a discontinuity
  • extended source analysis (petrosians) is threaded
  • iterative kron radius / magnitude analysis with down-weighted neighbors replaces the masked neighbor kron analysis. the result of this analysis is used by fitting guesses and is the value written to the PSF and XFIT tables.
  • the target matched PSFs are determined in advance and the 0 element of this array is always the unmatched image (with target PSF of NAN)
  • dQ, the difference between the upper and lower quartile, is measured (but not yet used to adjust the sky level. sky should be FITTED_MEAN - 2.5*dQ
  • fake sources inserted for the efficiency analysis are removed at the end of the analysis
  • radial apertures is now threaded
  • edge case petrosian mags are now handled without aborts (may still have a problem with the measured error of the petrosian radius)
  • new sersic model guess based on the psf size, the moments, and the kron flux. the psf - kron mag is used to guess the index, then the index is used to convert measured moments into model guess parameters. this uses empirical relationships between the quantities generated from fake images.
  • define the fit region and window region based on the 1st radial moments
  • use the kron S/N to determine if analysis is performed for extended sources, not the psf S/N
  • remove the old 'basic deblend' which did not really do any deblending and is superceeded by the deblending in KronIterate and the footprint analysis
Location:
trunk/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src

    • Property svn:ignore
      •  

        old new  
        2222psphotMakePSF
        2323psphotStack
         24psphotModelTest
  • trunk/psphot/src/psphotStackMatchPSFs.c

    r31154 r32348  
    2525    }
    2626
    27     // loop over the available readouts (ignore chisq image)
     27    // loop over the available readouts
    2828    for (int i = 0; i < num; i++) {
     29        // set up the PSF-matching parameters describing the input images
    2930        if (!psphotStackMatchPSFsPrepare (config, view, options, i)) {
    3031            psError (PSPHOT_ERR_CONFIG, false, "failed to set PSF matching options for entry %d", i);
     
    3334    }
    3435
    35     // Generate target PSF
     36    // XXX convolve == false might not be valid at the moment
    3637    if (options->convolve) {
    37         options->psf = psphotStackPSF(config, options->numCols, options->numRows, options->psfs, options->inputMask);
    38         if (!options->psf) {
     38        // Determine the 1st target PSF (either AUTO or defined by PSPHOT.STACK.TARGET.PSF.FWHM)
     39        // NOTE: this also set the full list of target FWHMs (options->targetSeeing)
     40        if (!psphotStackPSF(config, options)) {
    3941            psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
    4042            return false;
    4143        }
    42         psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "PSF.TARGET", PS_DATA_UNKNOWN, "Target PSF for stack", options->psf);
    43         options->targetSeeing = pmPSFtoFWHM(options->psf, 0.5 * options->numCols, 0.5 * options->numRows); // FWHM for target
    44         psLogMsg("psphotStack", PS_LOG_INFO, "Target seeing FWHM: %f\n", options->targetSeeing);
    45 
    46         // XXX is this needed to supply the psf to psphot??
    47         // pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSTACK.TARGET.PSF"); // Output chip
    48         // psMetadataAddPtr(outChip->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "Target PSF", options->psf);
    49         // outChip->data_exists = true;
    5044    }
    5145
     
    6357
    6458// convolve the image to match desired PSF
     59// XXX is this code consistent with 'convolve' = false?
    6560bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) {
    6661
     
    109104        saveMatchData(readoutOut, options, index);
    110105    }
    111     rescaleData(readoutOut, config, options, index);
     106
     107    // renormalize the stack variances to have sigma = 1.0
     108    if (!psphotStackRenormaliseVariance(config, readoutOut)) {
     109        psError(psErrorCodeLast(), false, "Unable to renormalise variance.");
     110        return false;
     111    }
    112112
    113113    // save the output fwhm values in the readout->analysis.  we may have / will have multiple output PSF sizes,
    114114    // so we save this in a vector.  if the vector is not yet defined, create it
    115     bool mdok = false;
    116     psVector *fwhmValues = psMetadataLookupVector(&mdok, readoutOut->analysis, "STACK.PSF.FWHM.VALUES");
    117     if (!fwhmValues) {
    118         fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32);
    119         psMetadataAddVector(readoutOut->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues);
    120         psFree(fwhmValues); // drops the extra copy
     115    // NOTE: fwhmValues as defined here has 1 + nMatched PSF : 0 == unmatched
     116    psVector *fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32);
     117    psVectorAppend(fwhmValues, NAN); // XXX this corresponds to the unmatched image set
     118    for (int i = 0; i < options->targetSeeing->n; i++) {
     119        psVectorAppend(fwhmValues, options->targetSeeing->data.F32[i]);
    121120    }
    122     psVectorAppend(fwhmValues, options->targetSeeing);
     121    psMetadataAddVector(readoutSrc->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues);
     122    psMetadataAddVector(readoutOut->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues);
     123    psFree(fwhmValues); // drops the extra copy
    123124
    124125    return true;
Note: See TracChangeset for help on using the changeset viewer.