Changeset 7342 for trunk/psphot/src/psphotApResid.c
- Timestamp:
- Jun 5, 2006, 11:55:41 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotApResid.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r7326 r7342 100 100 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 101 101 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 102 103 stats->clipIter = 3; 104 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 105 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 102 if (psf->ApTrend == NULL) { 103 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 104 return false; 105 } 106 107 // apply the fit 108 stats->clipIter = 3; 109 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 110 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 111 if (psf->ApTrend == NULL) { 112 psError(PSPHOT_ERR_PHOTOM, false, "Fitting aperture correction"); 113 return false; 114 } 106 115 } 107 116 … … 112 121 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 113 122 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 123 if (psf->ApTrend == NULL) { 124 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 125 return false; 126 } 114 127 115 128 // apply the fit … … 117 130 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKYBIAS); 118 131 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 132 if (psf->ApTrend == NULL) { 133 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting sky bias"); 134 return false; 135 } 119 136 } 120 137 … … 124 141 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 125 142 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 143 if (psf->ApTrend == NULL) { 144 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 145 return false; 146 } 126 147 127 148 // apply the fit … … 129 150 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKYBIAS); 130 151 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 152 if (psf->ApTrend == NULL) { 153 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting sky bias"); 154 return false; 155 } 131 156 132 157 // apply the fit … … 134 159 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKYSAT); 135 160 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 161 if (psf->ApTrend == NULL) { 162 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting skysat"); 163 return false; 164 } 136 165 } 137 166 … … 142 171 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 143 172 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 173 if (psf->ApTrend == NULL) { 174 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 175 return false; 176 } 144 177 145 178 // apply the fit … … 147 180 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_XY_LIN); 148 181 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 182 if (psf->ApTrend == NULL) { 183 psError(PSPHOT_ERR_PHOTOM, false, "fitting, XY_LIN"); 184 return false; 185 } 149 186 } 150 187 … … 155 192 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 156 193 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 194 if (psf->ApTrend == NULL) { 195 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 196 return false; 197 } 157 198 158 199 // apply the fit … … 160 201 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_XY_QUAD); 161 202 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 203 if (psf->ApTrend == NULL) { 204 psError(PSPHOT_ERR_PHOTOM, false, "Fitting XY_QUAD"); 205 return false; 206 } 162 207 } 163 208 … … 168 213 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 169 214 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 215 if (psf->ApTrend == NULL) { 216 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 217 return false; 218 } 170 219 171 220 // apply the fit … … 173 222 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKY_XY_LIN); 174 223 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 224 if (psf->ApTrend == NULL) { 225 psError(PSPHOT_ERR_PHOTOM, false, "Fitting sky xy_lin"); 226 return false; 227 } 175 228 } 176 229 … … 181 234 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 182 235 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 236 if (psf->ApTrend == NULL) { 237 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting nothing"); 238 return false; 239 } 183 240 184 241 // apply the fit … … 186 243 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKYBIAS); 187 244 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 245 if (psf->ApTrend == NULL) { 246 psError(PSPHOT_ERR_PHOTOM, false, "clipping, fitting sky bias"); 247 return false; 248 } 188 249 189 250 // apply the fit … … 191 252 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKYSAT_XY_LIN); 192 253 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 254 if (psf->ApTrend == NULL) { 255 psError(PSPHOT_ERR_PHOTOM, false, "Fitting skyset xy_lin"); 256 return false; 257 } 193 258 } 194 259 … … 198 263 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_CONSTANT); 199 264 psf->ApTrend = psVectorClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 265 if (psf->ApTrend == NULL) { 266 psError(PSPHOT_ERR_PHOTOM, false, "constant"); 267 return false; 268 } 200 269 201 270 // fit just SkyBias and clip out objects which are too far from the median … … 203 272 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_SKYBIAS); 204 273 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 274 if (psf->ApTrend == NULL) { 275 psError(PSPHOT_ERR_PHOTOM, false, "fitting skyBias"); 276 return false; 277 } 205 278 206 279 // finally, fit x, y, SkyBias and clip out objects which are too far from the median … … 208 281 pmPSF_MaskApTrend (psf->ApTrend, PM_PSF_ALL); 209 282 psf->ApTrend = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux); 283 if (psf->ApTrend == NULL) { 284 psError(PSPHOT_ERR_PHOTOM, false, "fitting all"); 285 return false; 286 } 210 287 } 211 288
Note:
See TracChangeset
for help on using the changeset viewer.
