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/psphotStackMatchPSFsNext.c

    r30624 r32348  
    11# include "psphotInternal.h"
     2
     3// NOTE : element 0 of fwhmValues if the unmatched image, 
     4
     5int psphotStackMatchPSFsEntries (pmConfig *config, const pmFPAview *view, const char *filerule) {
     6
     7    int nRadialEntries = 0;
     8
     9    // find the currently selected readout
     10    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest
     11    psAssert (file, "missing file?");
     12   
     13    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     14    psAssert (readout, "missing readout?");
     15   
     16    bool status = false;
     17    psVector *fwhmValues = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES");
     18    if (!fwhmValues) {
     19        return 1;
     20    }
     21   
     22    nRadialEntries = fwhmValues->n;
     23    return nRadialEntries;
     24}
    225
    326// smooth the input image to match the next target PSF
     
    528// and that the smoothing can use a 1D Gaussian kernel of width sqrt(TARGET^2 - CURRENT^2)
    629// each subsequent call
    7 bool psphotStackMatchPSFsNext(bool *smoothAgain, pmConfig *config, const pmFPAview *view, const char *filerule, int lastSize)
     30bool psphotStackMatchPSFsNext(pmConfig *config, const pmFPAview *view, const char *filerule, int lastSize)
    831{
    9     bool status = true;
    10 
    11     // select the appropriate recipe information
    12     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    13     psAssert (recipe, "missing recipe?");
    14 
    15     psVector *fwhmValues = psMetadataLookupVector(&status, recipe, "PSPHOT.STACK.TARGET.PSF.FWHM"); // Magnitude offsets
    16     if (!status) {
    17         // must not be a vector, only one value requested
    18         *smoothAgain = false;
    19         return true;
    20     }
    21 
    22     if (lastSize + 1 >= fwhmValues->n) {
    23         // all done with target FWHM values
    24         *smoothAgain = false;
    25         return true;
    26     }
    27 
    2832    int num = psphotFileruleCount(config, filerule);
    2933
     
    3337    // loop over the available readouts
    3438    for (int i = 0; i < num; i++) {
    35         if (!psphotStackMatchPSFsNextReadout (config, view, filerule, i, recipe, fwhmValues, lastSize)) {
    36             psError (PSPHOT_ERR_CONFIG, false, "failed to smooth image %s (%d) to target PSF %f", filerule, i, fwhmValues->data.F32[lastSize+1]);
     39        if (!psphotStackMatchPSFsNextReadout (config, view, filerule, i, lastSize)) {
     40            psError (PSPHOT_ERR_CONFIG, false, "failed to smooth image %s (%d) to target PSF", filerule, i);
    3741            psImageConvolveSetThreads(oldThreads);
    3842            return false;
     
    4448}
    4549
    46 bool psphotStackMatchPSFsNextReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe, psVector *fwhmValues, int lastSize) {
     50bool psphotStackMatchPSFsNextReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, int lastSize) {
    4751
    4852    bool status = false;
     
    5862    psphotVisualShowImage(readout);
    5963
     64    // select the appropriate recipe information
     65    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     66    psAssert (recipe, "missing recipe?");
     67
    6068    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
    6169    psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels
     
    6674        psWarning("PEAKS_MIN_GAUSS is not set in recipe; using default value");
    6775        minGauss = 0.5;
     76    }
     77
     78    psVector *fwhmValues = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES");
     79    psAssert (fwhmValues, "need target PSFs");
     80
     81    if (lastSize + 1 >= fwhmValues->n) {
     82        return true;
    6883    }
    6984
     
    128143    // psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "SIGNIFICANCE_SCALE_FACTOR", PS_META_REPLACE, "Signicance scale factor", factor);
    129144
    130     // save the output fwhm values in the readout->analysis.  we may have / will have multiple output PSF sizes,
    131     // so we save this in a vector.  if the vector is not yet defined, create it
    132 
    133     psVector *fwhmValuesOut = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES");
    134     psAssert(fwhmValuesOut, "should already exist..");
    135     psVectorAppend(fwhmValuesOut, targetFWHM);
    136 
    137145    // do not generate a PSF if we already were supplied one
    138146    pmPSF *psfOld = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
Note: See TracChangeset for help on using the changeset viewer.