Changeset 13419
- Timestamp:
- May 18, 2007, 3:22:48 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotApResid.c (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r12792 r13419 132 132 stats->max = 3.0; 133 133 134 #define P_APTREND_SWITCH_CLEANUP /* Cleanup memory on error in ApTrendOption switch */ \ 135 psFree(psf->growth); psf->growth = NULL; \ 136 psFree(mask); \ 137 psFree(xPos); \ 138 psFree(yPos); \ 139 psFree(flux); \ 140 psFree(r2rflux); \ 141 psFree(apResid); \ 142 psFree(dMag); \ 143 psFree(stats) 144 134 145 // no correction 135 146 switch (ApTrendOption) { … … 143 154 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 144 155 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 156 P_APTREND_SWITCH_CLEANUP; 145 157 return false; 146 158 } … … 150 162 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 151 163 psError(PSPHOT_ERR_PHOTOM, false, "Fitting aperture correction"); 164 P_APTREND_SWITCH_CLEANUP; 152 165 return false; 153 166 } … … 159 172 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 160 173 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 174 P_APTREND_SWITCH_CLEANUP; 161 175 return false; 162 176 } … … 166 180 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 167 181 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting sky bias"); 182 P_APTREND_SWITCH_CLEANUP; 168 183 return false; 169 184 } … … 175 190 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 176 191 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 192 P_APTREND_SWITCH_CLEANUP; 177 193 return false; 178 194 } … … 182 198 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 183 199 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting sky bias"); 200 P_APTREND_SWITCH_CLEANUP; 184 201 return false; 185 202 } … … 189 206 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 190 207 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting skysat"); 208 P_APTREND_SWITCH_CLEANUP; 191 209 return false; 192 210 } … … 198 216 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 199 217 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 218 P_APTREND_SWITCH_CLEANUP; 200 219 return false; 201 220 } … … 205 224 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 206 225 psError(PSPHOT_ERR_PHOTOM, false, "fitting, XY_LIN"); 226 P_APTREND_SWITCH_CLEANUP; 207 227 return false; 208 228 } … … 214 234 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 215 235 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 236 P_APTREND_SWITCH_CLEANUP; 216 237 return false; 217 238 } … … 221 242 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 222 243 psError(PSPHOT_ERR_PHOTOM, false, "Fitting XY_QUAD"); 244 P_APTREND_SWITCH_CLEANUP; 223 245 return false; 224 246 } … … 230 252 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 231 253 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 254 P_APTREND_SWITCH_CLEANUP; 232 255 return false; 233 256 } … … 237 260 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 238 261 psError(PSPHOT_ERR_PHOTOM, false, "Fitting sky xy_lin"); 262 P_APTREND_SWITCH_CLEANUP; 239 263 return false; 240 264 } … … 246 270 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 247 271 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 272 P_APTREND_SWITCH_CLEANUP; 248 273 return false; 249 274 } … … 253 278 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 254 279 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting sky bias"); 280 P_APTREND_SWITCH_CLEANUP; 255 281 return false; 256 282 } … … 260 286 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 261 287 psError(PSPHOT_ERR_PHOTOM, false, "Fitting skyset xy_lin"); 288 P_APTREND_SWITCH_CLEANUP; 262 289 return false; 263 290 } … … 269 296 if (!psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 270 297 psError(PSPHOT_ERR_PHOTOM, false, "Failed to measure apTrend"); 298 P_APTREND_SWITCH_CLEANUP; 271 299 return false; 272 300 } … … 276 304 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 277 305 psError(PSPHOT_ERR_PHOTOM, false, "fitting skyBias"); 306 P_APTREND_SWITCH_CLEANUP; 278 307 return false; 279 308 } … … 283 312 if (!psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux)) { 284 313 psError(PSPHOT_ERR_PHOTOM, false, "fitting all"); 314 P_APTREND_SWITCH_CLEANUP; 285 315 return false; 286 316 } … … 290 320 return false; 291 321 } 292 322 #undef P_APTREND_SWITCH_CLEANUP 323 293 324 // construct the fitted values and the residuals 294 325 psVector *fit = psPolynomial4DEvalVector (psf->ApTrend, xPos, yPos, r2rflux, flux);
Note:
See TracChangeset
for help on using the changeset viewer.
