IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25383 for trunk/psphot


Ignore:
Timestamp:
Sep 15, 2009, 12:45:01 PM (17 years ago)
Author:
Paul Price
Message:

Merging branches/pap (detection efficiency development) into trunk.

Location:
trunk
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/psphot/doc/efficiency.txt

  • trunk/psphot/src/Makefile.am

    r24586 r25383  
    128128        psphotCheckStarDistribution.c  \
    129129        psphotThreadTools.c            \
    130         psphotAddNoise.c
     130        psphotAddNoise.c               \
     131        psphotEfficiency.c
    131132
    132133# dropped? psphotGrowthCurve.c
  • trunk/psphot/src/psphot.h

    r24890 r25383  
    4949bool            psphotPSFstats (pmReadout *readout, psMetadata *recipe, pmPSF *psf);
    5050bool            psphotMomentsStats (pmReadout *readout, psMetadata *recipe, psArray *sources);
    51 bool            psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, bool final);
     51bool            psphotFitSourcesLinear (pmReadout *readout, psArray *sources, const psMetadata *recipe, const pmPSF *psf, bool final);
    5252bool            psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal);
    5353
    5454bool            psphotReplaceAllSources (psArray *sources, psMetadata *recipe);
    55 bool            psphotRemoveAllSources (psArray *sources, psMetadata *recipe);
     55bool            psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe);
    5656
    5757bool            psphotBlendFit (pmConfig *config, pmReadout *readout, psArray *sources, pmPSF *psf);
     
    6464bool            psphotGuessModel_Threaded (psThreadJob *job);
    6565
    66 bool            psphotMagnitudes (pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, pmPSF *psf);
     66bool            psphotMagnitudes (pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, const pmPSF *psf);
    6767bool            psphotMagnitudes_Threaded (psThreadJob *job);
    6868
     
    7676bool            psphotExtendedSourceAnalysis (pmReadout *readout, psArray *sources, psMetadata *recipe);
    7777bool            psphotExtendedSourceFits (pmReadout *readout, psArray *sources, psMetadata *recipe);
     78bool            psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources);
    7879
    7980// thread-related:
     
    147148pmPSF          *psphotLoadPSF (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
    148149bool            psphotSetHeaderNstars (psMetadata *recipe, psArray *sources);
    149 bool            psphotAddNoise (pmReadout *readout, psArray *sources, psMetadata *recipe);
    150 bool            psphotSubNoise (pmReadout *readout, psArray *sources, psMetadata *recipe);
    151 bool            psphotAddOrSubNoise (pmReadout *readout, psArray *sources, psMetadata *recipe, bool add);
     150bool            psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);
     151bool            psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);
     152bool            psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add);
    152153bool            psphotRadialPlot (int *kapa, const char *filename, pmSource *source);
    153154bool            psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe);
  • trunk/psphot/src/psphotAddNoise.c

    r21519 r25383  
    11# include "psphotInternal.h"
    22
    3 bool psphotAddNoise (pmReadout *readout, psArray *sources, psMetadata *recipe) {
     3bool psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe) {
    44  return psphotAddOrSubNoise (readout, sources, recipe, true);
    55}
    66
    7 bool psphotSubNoise (pmReadout *readout, psArray *sources, psMetadata *recipe) {
     7bool psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe) {
    88  return psphotAddOrSubNoise (readout, sources, recipe, false);
    99}
    1010
    11 bool psphotAddOrSubNoise (pmReadout *readout, psArray *sources, psMetadata *recipe, bool add) {
     11bool psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add) {
    1212
    1313    bool status = false;
     
    4242    PS_ASSERT (status, false);
    4343    if (isfinite(GAIN)) {
    44         FACTOR /= GAIN;
     44        FACTOR /= GAIN;
    4545    }
    4646
     
    7070        oldshape.sxy = PAR[PM_PAR_SXY];
    7171
    72         // XXX can this be done more intelligently?
    73         if (oldI0 == 0.0) continue;
    74         if (!isfinite(oldI0)) continue;
     72        // XXX can this be done more intelligently?
     73        if (oldI0 == 0.0) continue;
     74        if (!isfinite(oldI0)) continue;
    7575
    7676        // increase size and height of source
  • trunk/psphot/src/psphotFake.c

  • trunk/psphot/src/psphotFitSourcesLinear.c

    r23445 r25383  
    1212static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psImageMaskType markVal);
    1313
    14 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, bool final) {
     14bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, const psMetadata *recipe, const pmPSF *psf, bool final) {
    1515
    1616    bool status;
  • trunk/psphot/src/psphotMagnitudes.c

    r23349 r25383  
    11# include "psphotInternal.h"
    22
    3 bool psphotMagnitudes(pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, pmPSF *psf) {
     3bool psphotMagnitudes(pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, const pmPSF *psf) {
    44
    55    bool status = false;
     
    6464
    6565            psArrayAdd(job->args, 1, cells->data[j]); // sources
    66             psArrayAdd(job->args, 1, psf);
     66            psArrayAdd(job->args, 1, (pmPSF*)psf);    // Casting away const
    6767            psArrayAdd(job->args, 1, binning);
    6868            psArrayAdd(job->args, 1, backModel);
  • trunk/psphot/src/psphotReadout.c

    r24890 r25383  
    6161    // display the backsub and backgnd images
    6262    psphotVisualShowBackground (config, view, readout);
    63    
     63
    6464    // run a single-model test if desired (exits from here if test is run)
    6565    psphotModelTest (config, view, recipe);
     
    224224    psphotMagnitudes(config, readout, view, sources, psf);
    225225
     226    if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) {
     227        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
     228        psErrorClear();
     229    }
     230
    226231    // replace failed sources?
    227232    // psphotReplaceUnfitSources (sources);
  • trunk/psphot/src/psphotReadoutMinimal.c

    r24890 r25383  
    9797    psphotMagnitudes(config, readout, view, sources, psf);
    9898
     99    if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) {
     100        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
     101        psErrorClear();
     102    }
     103
    99104    // drop the references to the image pixels held by each source
    100105    psphotSourceFreePixels (sources);
  • trunk/psphot/src/psphotReplaceUnfit.c

    r21519 r25383  
    4747}
    4848
    49 bool psphotRemoveAllSources (psArray *sources, psMetadata *recipe) {
     49bool psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe) {
    5050
    5151    bool status;
  • trunk/psphot/src/psphotSignificanceImage.c

    r21407 r25383  
    2222    }
    2323
    24     bool status_x, status_y;
    25     float FWHM_X = psMetadataLookupF32 (&status_x, recipe, "FWHM_X");
    26     float FWHM_Y = psMetadataLookupF32 (&status_y, recipe, "FWHM_Y");
    27     if (status_x && status_y) {
    28       // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?)
    29       SIGMA_SMTH  = 0.5*(FWHM_X + FWHM_Y) / (2.0*sqrt(2.0*log(2.0)));
    30       NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
    31       guess = false;
     24    bool statusMajor, statusMinor;
     25    float fwhmMajor = psMetadataLookupF32(&statusMajor, recipe, "FWHM_MAJ");
     26    float fwhmMinor = psMetadataLookupF32(&statusMinor, recipe, "FWHM_MIN");
     27    if (statusMajor && statusMinor) {
     28        // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?)
     29        if (!isfinite(fwhmMajor) || !isfinite(fwhmMinor) || fwhmMajor == 0.0 || fwhmMinor == 0.0) {
     30            psWarning("fwhmMajor (%f) or fwhmMinor (%f) is bad!", fwhmMajor, fwhmMinor);
     31        }
     32        SIGMA_SMTH  = 0.5*(fwhmMajor + fwhmMinor) / (2.0*sqrt(2.0*log(2.0)));
     33        NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
     34        guess = false;
    3235    } else {
    33       // if we do not know the FWHM, use the guess smoothing kernel supplied.
    34       // it is a configuration error if these are not supplied
    35       SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_SIGMA");
    36       PS_ASSERT (status, NULL);
    37       NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
    38       PS_ASSERT (status, NULL);
    39       guess = true;
     36        // if we do not know the FWHM, use the guess smoothing kernel supplied.
     37        // it is a configuration error if these are not supplied
     38        SIGMA_SMTH  = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_SIGMA");
     39        PS_ASSERT (status, NULL);
     40        NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
     41        PS_ASSERT (status, NULL);
     42        guess = true;
    4043    }
    4144    // record the actual smoothing sigma
Note: See TracChangeset for help on using the changeset viewer.