- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/psModules
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psModules merged eligible /branches/eam_branches/stackphot.20100406/psModules 27623-27653 /branches/pap_delete/psModules 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/psModules/src/objects/pmPSFtryModel.c
r25819 r27838 72 72 } 73 73 74 // XXX set the min number of needed source more carefully (depends on psfTrendMode?) 75 int orderMax = PS_MAX (options->psfTrendNx, options->psfTrendNy); 76 if ((sources->n < 15) && (orderMax >= 3)) orderMax = 2; 77 if ((sources->n < 11) && (orderMax >= 2)) orderMax = 1; 78 if ((sources->n < 8) && (orderMax >= 1)) orderMax = 0; 74 // hard limit on minimum number of stars 79 75 if ((sources->n < 3)) { 80 76 psError (PS_ERR_UNKNOWN, true, "failed to determine PSF parameters"); … … 82 78 } 83 79 84 int orderMin; 80 // this is a bit tricky, because we have two cases (MAP vs POLY), and they have a different 81 // definition for 'order' (order_MAP = order_POLY + 1). in addition, we have a 82 // user-specified MAX order, which we should respect, regardless of the mode 83 84 // set the max order (0 = constant) which the number of psf stars can support: 85 // rule of thumb: require 3 stars per 'cell' (order+1)^2 86 int MaxOrderForStars = 0; 87 if (sources->n >= 12) MaxOrderForStars = 1; // 4 cells 88 if (sources->n >= 27) MaxOrderForStars = 2; // 9 cells 89 if (sources->n >= 48) MaxOrderForStars = 3; // 16 cells 90 if (sources->n > 75) MaxOrderForStars = 4; // 25 cells 91 92 int orderMax = PS_MAX (options->psfTrendNx, options->psfTrendNy); 93 int orderMin = 0; 85 94 if (options->psfTrendMode == PM_TREND_MAP) { 86 orderMin = 1; 87 orderMax = PS_MAX(orderMax, 1); 88 } else { 89 orderMin = 0; 90 } 95 MaxOrderForStars ++; 96 orderMin ++; 97 } 98 orderMax = PS_MIN (orderMax, MaxOrderForStars); 91 99 92 100 // save the raw source mask (generated by pmPSFtryFitEXT) … … 99 107 // as we loop over orders, we need to refer to the initial selection, but we modify the 100 108 // option values to match the current guess: save the max values here: 101 int Nx = options->psfTrendNx;102 int Ny = options->psfTrendNy;109 int Nx = (options->psfTrendMode == PM_TREND_MAP) ? options->psfTrendNx : options->psfTrendNx + 1; 110 int Ny = (options->psfTrendMode == PM_TREND_MAP) ? options->psfTrendNy : options->psfTrendNy + 1; 103 111 for (int i = orderMin; i <= orderMax; i++) { 104 112 … … 196 204 psStatsGetValue(stats, meanStat), psStatsGetValue(stats, stdevStat)); 197 205 198 psFree(flux);199 psFree(mask);200 psFree(chisq);201 202 206 if (!result) { 203 207 psError(PS_ERR_UNKNOWN, false, "Failed to fit psf->ChiTrend"); 204 208 psFree(psfTry); 205 return NULL; 206 } 207 } 209 psFree(flux); 210 psFree(mask); 211 psFree(chisq); 212 return NULL; 213 } 214 } 215 216 psFree(flux); 217 psFree(mask); 218 psFree(chisq); 208 219 209 220 for (int i = 0; i < psfTry->psf->ChiTrend->nX + 1; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
