Changeset 25409
- Timestamp:
- Sep 15, 2009, 4:08:45 PM (17 years ago)
- Location:
- branches/eam_branches/20090715/psphot
- Files:
-
- 9 edited
- 3 copied
-
doc/efficiency.txt (copied) (copied from trunk/psphot/doc/efficiency.txt )
-
src/Makefile.am (modified) (1 diff)
-
src/psphot.h (modified) (4 diffs)
-
src/psphotAddNoise.c (modified) (3 diffs)
-
src/psphotEfficiency.c (copied) (copied from trunk/psphot/src/psphotEfficiency.c )
-
src/psphotFake.c (copied) (copied from trunk/psphot/src/psphotFake.c )
-
src/psphotFitSourcesLinear.c (modified) (1 diff)
-
src/psphotMagnitudes.c (modified) (2 diffs)
-
src/psphotReadout.c (modified) (2 diffs)
-
src/psphotReadoutMinimal.c (modified) (1 diff)
-
src/psphotReplaceUnfit.c (modified) (1 diff)
-
src/psphotSignificanceImage.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/Makefile.am
r25275 r25409 148 148 psphotPetrosianAnalysis.c \ 149 149 pmPetrosian.c 150 151 152 # dropped? psphotGrowthCurve.c 150 psphotEfficiency.c 153 151 154 152 include_HEADERS = \ -
branches/eam_branches/20090715/psphot/src/psphot.h
r25386 r25409 50 50 bool psphotPSFstats (pmReadout *readout, psMetadata *recipe, pmPSF *psf); 51 51 bool psphotMomentsStats (pmReadout *readout, psMetadata *recipe, psArray *sources); 52 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe,pmPSF *psf, bool final);52 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, const psMetadata *recipe, const pmPSF *psf, bool final); 53 53 bool psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal); 54 54 55 55 bool psphotReplaceAllSources (psArray *sources, psMetadata *recipe); 56 bool psphotRemoveAllSources ( psArray *sources,psMetadata *recipe);56 bool psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe); 57 57 58 58 bool psphotBlendFit (pmConfig *config, pmReadout *readout, psArray *sources, pmPSF *psf); … … 65 65 bool psphotGuessModel_Threaded (psThreadJob *job); 66 66 67 bool psphotMagnitudes (pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, pmPSF *psf);67 bool psphotMagnitudes (pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, const pmPSF *psf); 68 68 bool psphotMagnitudes_Threaded (psThreadJob *job); 69 69 … … 77 77 bool psphotExtendedSourceAnalysis (pmReadout *readout, psArray *sources, psMetadata *recipe); 78 78 bool psphotExtendedSourceFits (pmReadout *readout, psArray *sources, psMetadata *recipe); 79 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources); 79 80 80 81 // thread-related: … … 148 149 pmPSF *psphotLoadPSF (pmConfig *config, const pmFPAview *view, psMetadata *recipe); 149 150 bool 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);151 bool psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe); 152 bool psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe); 153 bool psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add); 153 154 bool psphotRadialPlot (int *kapa, const char *filename, pmSource *source); 154 155 bool psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe); -
branches/eam_branches/20090715/psphot/src/psphotAddNoise.c
r21519 r25409 1 1 # include "psphotInternal.h" 2 2 3 bool psphotAddNoise (pmReadout *readout, psArray *sources,psMetadata *recipe) {3 bool psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe) { 4 4 return psphotAddOrSubNoise (readout, sources, recipe, true); 5 5 } 6 6 7 bool psphotSubNoise (pmReadout *readout, psArray *sources,psMetadata *recipe) {7 bool psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe) { 8 8 return psphotAddOrSubNoise (readout, sources, recipe, false); 9 9 } 10 10 11 bool psphotAddOrSubNoise (pmReadout *readout, psArray *sources,psMetadata *recipe, bool add) {11 bool psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add) { 12 12 13 13 bool status = false; … … 42 42 PS_ASSERT (status, false); 43 43 if (isfinite(GAIN)) { 44 FACTOR /= GAIN;44 FACTOR /= GAIN; 45 45 } 46 46 … … 70 70 oldshape.sxy = PAR[PM_PAR_SXY]; 71 71 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; 75 75 76 76 // increase size and height of source -
branches/eam_branches/20090715/psphot/src/psphotFitSourcesLinear.c
r23445 r25409 12 12 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psImageMaskType markVal); 13 13 14 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe,pmPSF *psf, bool final) {14 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, const psMetadata *recipe, const pmPSF *psf, bool final) { 15 15 16 16 bool status; -
branches/eam_branches/20090715/psphot/src/psphotMagnitudes.c
r23349 r25409 1 1 # include "psphotInternal.h" 2 2 3 bool psphotMagnitudes(pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, pmPSF *psf) {3 bool psphotMagnitudes(pmConfig *config, pmReadout *readout, const pmFPAview *view, psArray *sources, const pmPSF *psf) { 4 4 5 5 bool status = false; … … 64 64 65 65 psArrayAdd(job->args, 1, cells->data[j]); // sources 66 psArrayAdd(job->args, 1, psf);66 psArrayAdd(job->args, 1, (pmPSF*)psf); // Casting away const 67 67 psArrayAdd(job->args, 1, binning); 68 68 psArrayAdd(job->args, 1, backModel); -
branches/eam_branches/20090715/psphot/src/psphotReadout.c
r25357 r25409 61 61 // display the backsub and backgnd images 62 62 psphotVisualShowBackground (config, view, readout); 63 63 64 64 // run a single-model test if desired (exits from here if test is run) 65 65 psphotModelTest (config, view, recipe); … … 226 226 psphotMagnitudes(config, readout, view, sources, psf); 227 227 228 if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) { 229 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 230 psErrorClear(); 231 } 232 228 233 // replace failed sources? 229 234 // psphotReplaceUnfitSources (sources); -
branches/eam_branches/20090715/psphot/src/psphotReadoutMinimal.c
r25022 r25409 97 97 psphotMagnitudes(config, readout, view, sources, psf); 98 98 99 if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) { 100 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 101 psErrorClear(); 102 } 103 99 104 // drop the references to the image pixels held by each source 100 105 psphotSourceFreePixels (sources); -
branches/eam_branches/20090715/psphot/src/psphotReplaceUnfit.c
r21519 r25409 47 47 } 48 48 49 bool psphotRemoveAllSources ( psArray *sources,psMetadata *recipe) {49 bool psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe) { 50 50 51 51 bool status; -
branches/eam_branches/20090715/psphot/src/psphotSignificanceImage.c
r21407 r25409 22 22 } 23 23 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; 32 35 } 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 supplied35 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; 40 43 } 41 44 // record the actual smoothing sigma
Note:
See TracChangeset
for help on using the changeset viewer.
