- Timestamp:
- Jul 17, 2014, 12:30:45 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712/psModules
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
src/objects (modified) (1 prop)
-
src/objects/pmPSFtryFitPSF.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712/psModules
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/psModules/src/objects
- Property svn:ignore
-
old new 12 12 pmSourceIO_CMF_PS1_V1.v1.c 13 13 pmSourceIO_CMF_PS1_V4.c 14 pmSourceIO_CMF_PS1_V5.c 14 15 pmSourceIO_CMF_PS1_SV1.c 15 16 pmSourceIO_CMF_PS1_SV2.c 17 pmSourceIO_CMF_PS1_SV3.c 16 18 pmSourceIO_CMF_PS1_DV1.c 17 19 pmSourceIO_CMF_PS1_DV2.c 18 20 pmSourceIO_CMF_PS1_DV3.c 19 21 pmSourceIO_CMF_PS1_DV4.c
-
- Property svn:ignore
-
branches/eam_branches/ipp-ops-20130712/psModules/src/objects/pmPSFtryFitPSF.c
r35923 r37066 27 27 #include "pmMoments.h" 28 28 #include "pmModelFuncs.h" 29 #include "pmModelClass.h" 29 30 #include "pmModel.h" 30 31 #include "pmModelUtils.h" 31 #include "pmModelClass.h"32 32 #include "pmSourceMasks.h" 33 33 #include "pmSourceExtendedPars.h" 34 34 #include "pmSourceDiffStats.h" 35 35 #include "pmSourceSatstar.h" 36 #include "pmSourceLensing.h" 36 37 #include "pmSource.h" 37 38 #include "pmSourceFitModel.h" … … 118 119 psfTry->psf->nPSFstars = Npsf; 119 120 120 // DEBUG code: save the PSF model fit data in detail121 # ifdef DEBUG122 123 char filename[64];124 snprintf (filename, 64, "psffit.%dx%d.dat", psfTry->psf->trendNx, psfTry->psf->trendNy);125 FILE *f = fopen (filename, "w");126 psAssert (f, "failed open");127 128 for (int i = 0; i < psfTry->sources->n; i++) {129 130 // skip masked sources131 if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) continue;132 133 pmSource *source = psfTry->sources->data[i];134 135 fprintf (f, "%6.1f %6.1f : %6.1f %6.1f : %8.3f %8.3f %8.3f : %f : %f %f %f : %f\n",136 source->peak->xf, source->peak->yf,137 source->modelPSF->params->data.F32[PM_PAR_XPOS], source->modelPSF->params->data.F32[PM_PAR_YPOS],138 source->psfMag, source->apMag, source->psfMagErr,139 source->modelPSF->params->data.F32[PM_PAR_I0],140 source->modelPSF->params->data.F32[PM_PAR_SXX], source->modelPSF->params->data.F32[PM_PAR_SXY],141 source->modelPSF->params->data.F32[PM_PAR_SYY], source->modelPSF->params->data.F32[PM_PAR_7]);142 }143 fclose (f);144 # endif145 146 121 pmSourceVisualShowModelFits (psfTry->psf, psfTry->sources, maskVal); 147 122 148 psLogMsg ("psphot.psftry", PS_LOG_MINUTIA, "fit psf: %f sec for %d of %ld sources \n", psTimerMark ("psf.fit"), Npsf, psfTry->sources->n);123 psLogMsg ("psphot.psftry", PS_LOG_MINUTIA, "fit psf: %f sec for %d of %ld sources (%d x %d model)\n", psTimerMark ("psf.fit"), Npsf, psfTry->sources->n, psfTry->psf->trendNx, psfTry->psf->trendNy); 149 124 psTrace ("psModules.object", 3, "keeping %d of %ld PSF candidates (PSF)\n", Npsf, psfTry->sources->n); 150 125 151 126 if (Npsf == 0) { 152 psError(PS_ERR_UNKNOWN, false, "No sources with good PSF fits after model is built."); 153 return false; 127 #if 0 128 // DEBUG code: save the PSF model fit data in detail 129 130 char hostname[256]; 131 gethostname (hostname, 256); 132 133 int pid = getpid(); 134 135 char filename[64]; 136 snprintf (filename, 64, "psffit.%s.%d.%dx%d.dat", hostname, pid, psfTry->psf->trendNx, psfTry->psf->trendNy); 137 FILE *f = fopen (filename, "w"); 138 psAssert (f, "failed open"); 139 140 for (int i = 0; i < psfTry->sources->n; i++) { 141 142 // skip masked sources 143 // if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) continue; 144 145 pmSource *source = psfTry->sources->data[i]; 146 147 if (!source->modelPSF) continue; 148 149 float par7 = (source->modelPSF->params->n == 7) ? -100 : source->modelPSF->params->data.F32[PM_PAR_7]; 150 fprintf (f, "%6.1f %6.1f : %6.1f %6.1f : %8.3f %8.3f %8.3f : %f : %f %f %f : %f %d\n", 151 source->peak->xf, source->peak->yf, 152 source->modelPSF->params->data.F32[PM_PAR_XPOS], source->modelPSF->params->data.F32[PM_PAR_YPOS], 153 source->psfMag, source->apMag, source->psfMagErr, 154 source->modelPSF->params->data.F32[PM_PAR_I0], 155 source->modelPSF->params->data.F32[PM_PAR_SXX], source->modelPSF->params->data.F32[PM_PAR_SXY], 156 source->modelPSF->params->data.F32[PM_PAR_SYY], par7, 157 psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i]); 158 } 159 fclose (f); 160 #endif 161 psError(PS_ERR_UNKNOWN, false, "No sources with good PSF fits after model is built."); 162 return false; 154 163 } 155 164
Note:
See TracChangeset
for help on using the changeset viewer.
