IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25409


Ignore:
Timestamp:
Sep 15, 2009, 4:08:45 PM (17 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/20090715/psphot
Files:
9 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src/Makefile.am

    r25275 r25409  
    148148        psphotPetrosianAnalysis.c      \
    149149        pmPetrosian.c
    150 
    151 
    152 # dropped? psphotGrowthCurve.c
     150        psphotEfficiency.c
    153151
    154152include_HEADERS = \
  • branches/eam_branches/20090715/psphot/src/psphot.h

    r25386 r25409  
    5050bool            psphotPSFstats (pmReadout *readout, psMetadata *recipe, pmPSF *psf);
    5151bool            psphotMomentsStats (pmReadout *readout, psMetadata *recipe, psArray *sources);
    52 bool            psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, bool final);
     52bool            psphotFitSourcesLinear (pmReadout *readout, psArray *sources, const psMetadata *recipe, const pmPSF *psf, bool final);
    5353bool            psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal);
    5454
    5555bool            psphotReplaceAllSources (psArray *sources, psMetadata *recipe);
    56 bool            psphotRemoveAllSources (psArray *sources, psMetadata *recipe);
     56bool            psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe);
    5757
    5858bool            psphotBlendFit (pmConfig *config, pmReadout *readout, psArray *sources, pmPSF *psf);
     
    6565bool            psphotGuessModel_Threaded (psThreadJob *job);
    6666
    67 bool            psphotMagnitudes (pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, pmPSF *psf);
     67bool            psphotMagnitudes (pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, const pmPSF *psf);
    6868bool            psphotMagnitudes_Threaded (psThreadJob *job);
    6969
     
    7777bool            psphotExtendedSourceAnalysis (pmReadout *readout, psArray *sources, psMetadata *recipe);
    7878bool            psphotExtendedSourceFits (pmReadout *readout, psArray *sources, psMetadata *recipe);
     79bool            psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources);
    7980
    8081// thread-related:
     
    148149pmPSF          *psphotLoadPSF (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
    149150bool            psphotSetHeaderNstars (psMetadata *recipe, psArray *sources);
    150 bool            psphotAddNoise (pmReadout *readout, psArray *sources, psMetadata *recipe);
    151 bool            psphotSubNoise (pmReadout *readout, psArray *sources, psMetadata *recipe);
    152 bool            psphotAddOrSubNoise (pmReadout *readout, psArray *sources, psMetadata *recipe, bool add);
     151bool            psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);
     152bool            psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);
     153bool            psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add);
    153154bool            psphotRadialPlot (int *kapa, const char *filename, pmSource *source);
    154155bool            psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe);
  • branches/eam_branches/20090715/psphot/src/psphotAddNoise.c

    r21519 r25409  
    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
  • branches/eam_branches/20090715/psphot/src/psphotFitSourcesLinear.c

    r23445 r25409  
    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;
  • branches/eam_branches/20090715/psphot/src/psphotMagnitudes.c

    r23349 r25409  
    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);
  • branches/eam_branches/20090715/psphot/src/psphotReadout.c

    r25357 r25409  
    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);
     
    226226    psphotMagnitudes(config, readout, view, sources, psf);
    227227
     228    if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) {
     229        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
     230        psErrorClear();
     231    }
     232
    228233    // replace failed sources?
    229234    // psphotReplaceUnfitSources (sources);
  • branches/eam_branches/20090715/psphot/src/psphotReadoutMinimal.c

    r25022 r25409  
    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);
  • branches/eam_branches/20090715/psphot/src/psphotReplaceUnfit.c

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

    r21407 r25409  
    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.