Changeset 5987 for branches/eam_rel9_p0/psModules/src/objects/pmPSF.c
- Timestamp:
- Jan 13, 2006, 9:03:52 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_p0/psModules/src/objects/pmPSF.c
r5958 r5987 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.3.4. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-01-1 0 04:46:03$8 * @version $Revision: 1.3.4.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-01-14 07:03:52 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 57 57 return; 58 58 59 psFree (psf->ApTrend); 60 psFree (psf->growth); 59 61 psFree (psf->params); 60 62 return; … … 83 85 psf->dApResid = 0.0; 84 86 psf->skyBias = 0.0; 85 86 // the ApTrend components are (x, y, rflux) 87 psf->ApTrend = psPolynomial3DAlloc (2, 2, 1, PS_POLYNOMIAL_ORD); 88 89 // we do not allow any rflux vs X,Y cross-terms 90 psf->ApTrend->mask[0][1][1] = 1; // rflux x^0 y^1 91 psf->ApTrend->mask[0][2][1] = 1; // rflux x^0 y^2 92 psf->ApTrend->mask[1][0][1] = 1; // rflux x^1 y^0 93 psf->ApTrend->mask[1][1][1] = 1; // rflux x^1 y^1 94 psf->ApTrend->mask[1][2][1] = 1; // rflux x^1 y^2 95 psf->ApTrend->mask[2][0][1] = 1; // rflux x^2 y^0 96 psf->ApTrend->mask[2][1][1] = 1; // rflux x^2 y^1 97 psf->ApTrend->mask[2][2][1] = 1; // rflux x^2 y^2 98 99 // only 2nd order terms, no such combinations 100 psf->ApTrend->mask[2][2][0] = 1; // x^2 y^2 101 psf->ApTrend->mask[2][1][0] = 1; // x^2 y^1 102 psf->ApTrend->mask[1][2][0] = 1; // x^1 y^2 103 104 // total free parameters = 18 - 11 = 7 87 psf->skySat = 0.0; 88 89 // the ApTrend components are (x, y, r2rflux, flux) 90 psf->ApTrend = psPolynomial4DAlloc (2, 2, 1, 1, PS_POLYNOMIAL_ORD); 91 pmPSF_MaskApTrend (psf, PM_PSF_SKYBIAS); 92 93 // don't define a growth curve : user needs to choose radius bins 94 psf->growth = NULL; 105 95 106 96 Nparams = pmModelParameterCount (type); … … 208 198 return (modelPSF); 209 199 } 200 201 // zero and mask out all terms: 202 static bool maskAllTerms (psPolynomial4D *trend) 203 { 204 205 for (int i = 0; i < trend->nX + 1; i++) { 206 for (int j = 0; j < trend->nY + 1; j++) { 207 for (int k = 0; k < trend->nZ + 1; k++) { 208 for (int m = 0; m < trend->nT + 1; m++) { 209 trend->mask[i][j][k][m] = 1; // mask coeff 210 trend->coeff[i][j][k][m] = 0; // zero coeff 211 } 212 } 213 } 214 } 215 return true; 216 } 217 218 /*********************************************** 219 * this function masks the psf.ApTrend polynomial 220 * to enable the specific subset of the coefficients 221 **********************************************/ 222 bool pmPSF_MaskApTrend (pmPSF *psf, pmPSF_ApTrendOptions option) 223 { 224 225 switch (option) { 226 case PM_PSF_NONE: 227 maskAllTerms (psf->ApTrend); 228 return true; 229 230 case PM_PSF_CONSTANT: 231 maskAllTerms (psf->ApTrend); 232 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 233 return true; 234 235 case PM_PSF_SKYBIAS: 236 maskAllTerms (psf->ApTrend); 237 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 238 psf->ApTrend->mask[0][0][1][0] = 0; // unmask skybias 239 return true; 240 241 case PM_PSF_SKYSAT: 242 maskAllTerms (psf->ApTrend); 243 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 244 psf->ApTrend->mask[0][0][1][0] = 0; // unmask skybias 245 psf->ApTrend->mask[0][0][0][1] = 0; // unmask skybias 246 return true; 247 248 case PM_PSF_XY_LIN: 249 maskAllTerms (psf->ApTrend); 250 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 251 psf->ApTrend->mask[1][0][0][0] = 0; // unmask x 252 psf->ApTrend->mask[0][1][0][0] = 0; // unmask y 253 return true; 254 255 case PM_PSF_XY_QUAD: 256 maskAllTerms (psf->ApTrend); 257 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 258 psf->ApTrend->mask[1][0][0][0] = 0; // unmask x 259 psf->ApTrend->mask[2][0][0][0] = 0; // unmask x^2 260 psf->ApTrend->mask[1][1][0][0] = 0; // unmask x y 261 psf->ApTrend->mask[0][1][0][0] = 0; // unmask y 262 psf->ApTrend->mask[0][2][0][0] = 0; // unmask y^2 263 return true; 264 265 case PM_PSF_SKY_XY_LIN: 266 maskAllTerms (psf->ApTrend); 267 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 268 psf->ApTrend->mask[1][0][0][0] = 0; // unmask x 269 psf->ApTrend->mask[0][1][0][0] = 0; // unmask y 270 psf->ApTrend->mask[0][0][1][0] = 0; // unmask skybias 271 return true; 272 273 case PM_PSF_SKYSAT_XY_LIN: 274 maskAllTerms (psf->ApTrend); 275 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 276 psf->ApTrend->mask[1][0][0][0] = 0; // unmask x 277 psf->ApTrend->mask[0][1][0][0] = 0; // unmask y 278 psf->ApTrend->mask[0][0][1][0] = 0; // unmask skybias 279 psf->ApTrend->mask[0][0][0][1] = 0; // unmask skysat 280 return true; 281 282 case PM_PSF_ALL: 283 default: 284 maskAllTerms (psf->ApTrend); 285 psf->ApTrend->mask[0][0][0][0] = 0; // unmask constant 286 psf->ApTrend->mask[0][0][1][0] = 0; // unmask skybias 287 psf->ApTrend->mask[0][0][0][1] = 0; // unmask skysat 288 289 psf->ApTrend->mask[1][0][0][0] = 0; // unmask x 290 psf->ApTrend->mask[2][0][0][0] = 0; // unmask x^2 291 psf->ApTrend->mask[1][1][0][0] = 0; // unmask x y 292 psf->ApTrend->mask[0][1][0][0] = 0; // unmask y 293 psf->ApTrend->mask[0][2][0][0] = 0; // unmask y^2 294 return true; 295 } 296 return false; 297 }
Note:
See TracChangeset
for help on using the changeset viewer.
