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

    r31452 r32348  
    9999
    100100/// Generate a fake image and add it in to the existing readout
    101 static bool effGenerate(psImage **xSrc, psImage **ySrc, // Positions of sources
     101static pmReadout *effGenerate(psImage **xSrc, psImage **ySrc, // Positions of sources
    102102                        const pmReadout *ro,            // Readout of interest
    103103                        const pmPSF *psf,               // Point-spread function
     
    152152        psFree(xAll);
    153153        psFree(yAll);
    154         return false;
     154        return NULL;
    155155    }
    156156    psFree(magAll);
     
    161161
    162162    psBinaryOp(ro->image, ro->image, "+", fakeRO->image);
    163     psFree(fakeRO);
    164 
    165     return true;
     163
     164    // return the readout so we can subtract it later
     165    return fakeRO;
    166166}
    167167
     
    169169{
    170170    bool status = true;
     171
     172    fprintf (stdout, "\n");
     173    psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Efficiency ---");
    171174
    172175    // select the appropriate recipe information
     
    290293
    291294    psImage *xFake = NULL, *yFake = NULL; // Coordinates of sources, each bin in a row
    292     if (!effGenerate(&xFake, &yFake, readout, psf, magOffsets,
    293                      numSources, magLim, radius, minFlux)) {
     295    pmReadout *fakeRO = effGenerate(&xFake, &yFake, readout, psf, magOffsets, numSources, magLim, radius, minFlux);
     296    if (!fakeRO) {
    294297        psError(PS_ERR_UNKNOWN, false, "Unable to generate fake sources");
    295298        psFree(xFake);
     
    416419    psFree(significance);
    417420
     421    // psphotFitSourcesLinearReadout subtracts the model fits
    418422    if (!psphotFitSourcesLinearReadout(recipe, readout, fakeSourcesAll, psf, true)) {
    419423        psError(PS_ERR_UNKNOWN, false, "Unable to perform linear fit on fake sources.");
     
    427431    psf->ApTrend = NULL;
    428432
     433    // measure the magnitudes and fluxes for the sources
    429434    if (!psphotMagnitudesReadout(config, recipe, view, readout, fakeSourcesAll, psf)) {
    430435        psError(PS_ERR_UNKNOWN, false, "Unable to measure magnitudes of fake sources.");
     
    433438        psf->ApTrend = apTrend; // Casting away const!
    434439        return false;
     440    }
     441
     442    // replace the subtracted model fits
     443    for (int i = 0; i < fakeSourcesAll->n; i++) {
     444        pmSource *source = fakeSourcesAll->data[i];
     445
     446        // replace other sources?
     447        if (!(source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED)) continue;
     448       
     449        pmSourceAdd (source, PM_MODEL_OP_FULL, maskVal);
    435450    }
    436451    psFree(fakeSourcesAll);
     
    515530    psFree(fakeSources);
    516531
     532    // subtract the faked sources from the original image
     533    psBinaryOp(readout->image, readout->image, "-", fakeRO->image);
     534    psFree(fakeRO);
     535
    517536    pmDetEff *de = pmDetEffAlloc(magLim, numSources, numBins); // Detection efficiency
    518537    de->magOffsets = psVectorCopy(NULL, magOffsets, PS_TYPE_F32);
     
    529548    psFree(de);
    530549
    531     psLogMsg("psphot", PS_LOG_INFO, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake"));
     550    psLogMsg("psphot", PS_LOG_WARN, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake"));
    532551
    533552    return true;
Note: See TracChangeset for help on using the changeset viewer.