Changeset 15254 for trunk/psModules/src/astrom
- Timestamp:
- Oct 9, 2007, 9:27:04 AM (19 years ago)
- Location:
- trunk/psModules/src/astrom
- Files:
-
- 3 edited
-
pmAstrometryDistortion.c (modified) (6 diffs)
-
pmAstrometryUtils.c (modified) (9 diffs)
-
pmAstrometryWCS.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryDistortion.c
r13653 r15254 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $10 * @date $Date: 2007- 06-06 00:43:19$9 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-10-09 19:27:04 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 62 62 63 63 psPolynomial2D *local = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, 1, 1); 64 local-> mask[1][1] = 1;64 local->coeffMask[1][1] = PS_POLY_MASK_SET; 65 65 66 66 // measure gradient for fractional chip regions … … 211 211 for (int i = 0; i <= fpa->toTPA->x->nX; i++) { 212 212 for (int j = 0; j <= fpa->toTPA->x->nY; j++) { 213 if (fpa->toTPA->x->mask[i][j]) { 214 if ((i > 0) && (i <= fpa->toTPA->x->nX)) { 215 localX->mask[i-1][j] = 1; 216 } 217 if ((j > 0) && (j <= fpa->toTPA->x->nY)) { 218 localY->mask[i][j-1] = 1; 219 } 220 } 213 if ((i > 0) && (i <= fpa->toTPA->x->nX)) { 214 localX->coeffMask[i-1][j] = fpa->toTPA->x->coeffMask[i][j]; 215 } 216 if ((j > 0) && (j <= fpa->toTPA->x->nY)) { 217 localY->coeffMask[i][j-1] = fpa->toTPA->x->coeffMask[i][j]; 218 } 221 219 } 222 220 } … … 240 238 fpa->toTPA->x->coeff[0][0] = 0; 241 239 for (int i = 1; i <= fpa->toTPA->x->nX; i++) { 242 if (!fpa->toTPA->x->mask[i][0]) { 243 fpa->toTPA->x->coeff[i][0] = localX->coeff[i-1][0] / i; 244 } 240 if (fpa->toTPA->x->coeffMask[i][0] & PS_POLY_MASK_SET) { 241 continue; 242 } 243 fpa->toTPA->x->coeff[i][0] = localX->coeff[i-1][0] / i; 245 244 } 246 245 for (int j = 1; j <= fpa->toTPA->x->nY; j++) { 247 if (!fpa->toTPA->x->mask[0][j]) { 248 fpa->toTPA->x->coeff[0][j] = localY->coeff[0][j-1] / j; 249 } 246 if (fpa->toTPA->x->coeffMask[0][j] & PS_POLY_MASK_SET) { 247 continue; 248 } 249 fpa->toTPA->x->coeff[0][j] = localY->coeff[0][j-1] / j; 250 250 } 251 251 for (int i = 1; i <= fpa->toTPA->x->nX; i++) { 252 252 for (int j = 1; j <= fpa->toTPA->x->nY; j++) { 253 if (!fpa->toTPA->x->mask[i][j]) { 254 fpa->toTPA->x->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); 255 } 253 if (fpa->toTPA->x->coeffMask[i][j] & PS_POLY_MASK_SET) { 254 continue; 255 } 256 fpa->toTPA->x->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); 256 257 } 257 258 } … … 268 269 for (int i = 0; i < fpa->toTPA->y->nX; i++) { 269 270 for (int j = 0; j < fpa->toTPA->y->nY; j++) { 270 if (fpa->toTPA->y->mask[i][j]) { 271 if ((i > 0) && (i <= fpa->toTPA->y->nX)) { 272 localX->mask[i-1][j] = 1; 273 } 274 if ((j > 0) && (j <= fpa->toTPA->y->nY)) { 275 localY->mask[i][j-1] = 1; 276 } 277 } 271 if ((i > 0) && (i <= fpa->toTPA->y->nX)) { 272 localX->coeffMask[i-1][j] = fpa->toTPA->y->coeffMask[i][j]; 273 } 274 if ((j > 0) && (j <= fpa->toTPA->y->nY)) { 275 localY->coeffMask[i][j-1] = fpa->toTPA->y->coeffMask[i][j]; 276 } 278 277 } 279 278 } … … 286 285 fpa->toTPA->y->coeff[0][0] = 0; 287 286 for (int i = 1; i <= fpa->toTPA->y->nX; i++) { 288 if (!fpa->toTPA->y->mask[i][0]) { 289 fpa->toTPA->y->coeff[i][0] = localX->coeff[i-1][0] / i; 290 } 287 if (fpa->toTPA->y->coeffMask[i][0] & PS_POLY_MASK_SET) { 288 continue; 289 } 290 fpa->toTPA->y->coeff[i][0] = localX->coeff[i-1][0] / i; 291 291 } 292 292 for (int j = 1; j <= fpa->toTPA->y->nY; j++) { 293 if (!fpa->toTPA->y->mask[0][j]) { 294 fpa->toTPA->y->coeff[0][j] = localY->coeff[0][j-1] / j; 295 } 293 if (fpa->toTPA->y->coeffMask[0][j] & PS_POLY_MASK_SET) { 294 continue; 295 } 296 fpa->toTPA->y->coeff[0][j] = localY->coeff[0][j-1] / j; 296 297 } 297 298 for (int i = 1; i <= fpa->toTPA->y->nX; i++) { 298 299 for (int j = 1; j <= fpa->toTPA->y->nY; j++) { 299 if ( !fpa->toTPA->y->mask[i][j]) {300 fpa->toTPA->y->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);300 if (fpa->toTPA->y->coeffMask[i][j] & PS_POLY_MASK_SET) { 301 continue; 301 302 } 303 fpa->toTPA->y->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); 302 304 } 303 305 } -
trunk/psModules/src/astrom/pmAstrometryUtils.c
r12696 r15254 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2007- 03-30 21:12:56$9 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-10-09 19:27:04 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 105 105 psPolynomial2D *yPy = psPolynomial2DCopy (NULL, yPx); 106 106 for (int j = 0; j <= input->x->nY; j++) { 107 output->x-> mask[i][j] = input->x->mask[i][j];108 output->y-> mask[i][j] = input->y->mask[i][j];109 output->x->coeff[i][j] = (output->x-> mask[i][j]) ? 0 : psPolynomial2DEval (xPy, Xo, Yo) / tgamma(i+1) / tgamma(j+1);110 output->y->coeff[i][j] = (output->y-> mask[i][j]) ? 0 : psPolynomial2DEval (yPy, Xo, Yo) / tgamma(i+1) / tgamma(j+1);107 output->x->coeffMask[i][j] = input->x->coeffMask[i][j]; 108 output->y->coeffMask[i][j] = input->y->coeffMask[i][j]; 109 output->x->coeff[i][j] = (output->x->coeffMask[i][j] & PS_POLY_MASK_SET) ? 0 : psPolynomial2DEval (xPy, Xo, Yo) / tgamma(i+1) / tgamma(j+1); 110 output->y->coeff[i][j] = (output->y->coeffMask[i][j] & PS_POLY_MASK_SET) ? 0 : psPolynomial2DEval (yPy, Xo, Yo) / tgamma(i+1) / tgamma(j+1); 111 111 112 112 // take the next derivative wrt y, catch output (is NULL on last pass) … … 146 146 for (int j = 0; j <= order; j++) { 147 147 if (i + j > order) { 148 transform->x-> mask [i][j] = 1;149 transform->y-> mask [i][j] = 1;148 transform->x->coeffMask [i][j] = PS_POLY_MASK_SET; 149 transform->y->coeffMask [i][j] = PS_POLY_MASK_SET; 150 150 } 151 151 } … … 153 153 transform->x->coeff[1][0] = 1; 154 154 transform->y->coeff[0][1] = 1; 155 transform->x-> mask[1][0] = 0;156 transform->y-> mask[0][1] = 0;155 transform->x->coeffMask[1][0] = PS_POLY_MASK_NONE; 156 transform->y->coeffMask[0][1] = PS_POLY_MASK_NONE; 157 157 158 158 return transform; … … 197 197 if (i + j > order) { 198 198 // high-order cross terms must be masked (eg, x^3 y^2) 199 status &= transform->x->mask[i][j];199 status &= (transform->x->coeffMask[i][j] & PS_POLY_MASK_SET); 200 200 } else { 201 status &= ! transform->x->mask[i][j];201 status &= !(transform->x->coeffMask[i][j] & PS_POLY_MASK_SET); 202 202 if ((i == 1) && (i + j == 1)) { 203 203 // linear, diagonal terms must be non-zero … … 216 216 if (i + j > order) { 217 217 // high-order cross terms must be masked (eg, x^3 y^2) 218 status &= transform->y->mask[i][j];218 status &= (transform->y->coeffMask[i][j] & PS_POLY_MASK_SET); 219 219 } else { 220 status &= ! transform->y->mask[i][j];220 status &= !(transform->y->coeffMask[i][j] & PS_POLY_MASK_SET); 221 221 if ((j == 1) && (i + j == 1)) { 222 222 // linear, diagonal terms must be 1.0 … … 249 249 for (int j = 0; j <= order; j++) { 250 250 if (i + j > order) { 251 distort->x-> mask [i][j][0][0] = 1;252 distort->y-> mask [i][j][0][0] = 1;251 distort->x->coeffMask [i][j][0][0] = PS_POLY_MASK_SET; 252 distort->y->coeffMask [i][j][0][0] = PS_POLY_MASK_SET; 253 253 } 254 254 } … … 306 306 if (i + j > order) { 307 307 // high-order cross terms must be masked (eg, x^3 y^2) 308 status &= distort->x->mask[i][j][0][0];308 status &= (distort->x->coeffMask[i][j][0][0] & PS_POLY_MASK_SET); 309 309 } else { 310 status &= ! distort->x->mask[i][j][0][0];310 status &= !(distort->x->coeffMask[i][j][0][0] & PS_POLY_MASK_SET); 311 311 if ((i == 1) && (i + j == 1)) { 312 312 // linear, diagonal terms must be 1.0 … … 325 325 if (i + j > order) { 326 326 // high-order cross terms must be masked (eg, x^3 y^2) 327 status &= distort->y->mask[i][j][0][0];327 status &= (distort->y->coeffMask[i][j][0][0] & PS_POLY_MASK_SET); 328 328 } else { 329 status &= ! distort->y->mask[i][j][0][0];329 status &= !(distort->y->coeffMask[i][j][0][0] & PS_POLY_MASK_SET); 330 330 if ((j == 1) && (i + j == 1)) { 331 331 // linear, diagonal terms must be 1.0 -
trunk/psModules/src/astrom/pmAstrometryWCS.c
r12838 r15254 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2007- 04-17 19:39:04 $9 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-10-09 19:27:04 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 298 298 continue; 299 299 if (i + j > fitOrder) { 300 wcs->trans->x-> mask[i][j] = 1;301 wcs->trans->y-> mask[i][j] = 1;300 wcs->trans->x->coeffMask[i][j] = PS_POLY_MASK_SET; 301 wcs->trans->y->coeffMask[i][j] = PS_POLY_MASK_SET; 302 302 continue; 303 303 }
Note:
See TracChangeset
for help on using the changeset viewer.
