Changeset 10603 for trunk/psModules/src/astrom/pmAstrometryDistortion.c
- Timestamp:
- Dec 9, 2006, 4:06:47 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryDistortion.c
r9730 r10603 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-1 0-24 22:55:04$9 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-12-10 02:06:47 $ 11 11 * 12 12 * Copyright 2006 Institute for Astronomy, University of Hawaii … … 181 181 // the order of the gradient fits need to be 1 less than the distortion term 182 182 // determine the gradient order(s) from the fpa->toTP structure 183 localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toT angentPlane->x->nX-1, fpa->toTangentPlane->x->nY);184 localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toT angentPlane->x->nX, fpa->toTangentPlane->x->nY-1);183 localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX-1, fpa->toTPA->x->nY); 184 localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX, fpa->toTPA->x->nY-1); 185 185 186 186 // set masks based on fpa->toTP 187 for (int i = 0; i < fpa->toT angentPlane->x->nX; i++) {188 for (int j = 0; j < fpa->toT angentPlane->x->nY; j++) {189 if (fpa->toT angentPlane->x->mask[i][j][0][0]) {187 for (int i = 0; i < fpa->toTPA->x->nX; i++) { 188 for (int j = 0; j < fpa->toTPA->x->nY; j++) { 189 if (fpa->toTPA->x->mask[i][j][0][0]) { 190 190 localX->mask[i-1][j] = 1; 191 191 localY->mask[i][j-1] = 1; … … 203 203 204 204 // update fpa->toTP distortion terms 205 fpa->toT angentPlane->x->coeff[0][0][0][0] = 0;206 for (int i = 1; i < fpa->toT angentPlane->x->nX; i++) {207 if (!fpa->toT angentPlane->x->mask[i][0][0][0]) {208 fpa->toT angentPlane->x->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;209 } 210 } 211 for (int j = 1; j < fpa->toT angentPlane->x->nY; j++) {212 if (!fpa->toT angentPlane->x->mask[0][j][0][0]) {213 fpa->toT angentPlane->x->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;214 } 215 } 216 for (int i = 1; i < fpa->toT angentPlane->x->nX; i++) {217 for (int j = 1; j < fpa->toT angentPlane->x->nY; j++) {218 if (!fpa->toT angentPlane->x->mask[i][j][0][0]) {219 fpa->toT angentPlane->x->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);205 fpa->toTPA->x->coeff[0][0][0][0] = 0; 206 for (int i = 1; i < fpa->toTPA->x->nX; i++) { 207 if (!fpa->toTPA->x->mask[i][0][0][0]) { 208 fpa->toTPA->x->coeff[i][0][0][0] = localX->coeff[i-1][0] / i; 209 } 210 } 211 for (int j = 1; j < fpa->toTPA->x->nY; j++) { 212 if (!fpa->toTPA->x->mask[0][j][0][0]) { 213 fpa->toTPA->x->coeff[0][j][0][0] = localY->coeff[0][j-1] / j; 214 } 215 } 216 for (int i = 1; i < fpa->toTPA->x->nX; i++) { 217 for (int j = 1; j < fpa->toTPA->x->nY; j++) { 218 if (!fpa->toTPA->x->mask[i][j][0][0]) { 219 fpa->toTPA->x->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); 220 220 } 221 221 } … … 226 226 // the order of the gradient fits need to be 1 less than the distortion term 227 227 // determine the gradient order(s) from the fpa->toTP structure 228 localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toT angentPlane->y->nX-1, fpa->toTangentPlane->y->nY);229 localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toT angentPlane->y->nX, fpa->toTangentPlane->y->nY-1);228 localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->y->nX-1, fpa->toTPA->y->nY); 229 localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->y->nX, fpa->toTPA->y->nY-1); 230 230 231 231 // set masks based on fpa->toTP 232 for (int i = 0; i < fpa->toT angentPlane->y->nX; i++) {233 for (int j = 0; j < fpa->toT angentPlane->y->nY; j++) {234 if (fpa->toT angentPlane->y->mask[i][j][0][0]) {232 for (int i = 0; i < fpa->toTPA->y->nX; i++) { 233 for (int j = 0; j < fpa->toTPA->y->nY; j++) { 234 if (fpa->toTPA->y->mask[i][j][0][0]) { 235 235 localX->mask[i-1][j] = 1; 236 236 localY->mask[i][j-1] = 1; … … 259 259 260 260 // update fpa->toTP distortion terms 261 fpa->toT angentPlane->y->coeff[0][0][0][0] = 0;262 for (int i = 1; i < fpa->toT angentPlane->y->nX; i++) {263 if (!fpa->toT angentPlane->y->mask[i][0][0][0]) {264 fpa->toT angentPlane->y->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;265 } 266 } 267 for (int j = 1; j < fpa->toT angentPlane->y->nY; j++) {268 if (!fpa->toT angentPlane->y->mask[0][j][0][0]) {269 fpa->toT angentPlane->y->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;270 } 271 } 272 for (int i = 1; i < fpa->toT angentPlane->y->nX; i++) {273 for (int j = 1; j < fpa->toT angentPlane->y->nY; j++) {274 if (!fpa->toT angentPlane->y->mask[i][j][0][0]) {275 fpa->toT angentPlane->y->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);261 fpa->toTPA->y->coeff[0][0][0][0] = 0; 262 for (int i = 1; i < fpa->toTPA->y->nX; i++) { 263 if (!fpa->toTPA->y->mask[i][0][0][0]) { 264 fpa->toTPA->y->coeff[i][0][0][0] = localX->coeff[i-1][0] / i; 265 } 266 } 267 for (int j = 1; j < fpa->toTPA->y->nY; j++) { 268 if (!fpa->toTPA->y->mask[0][j][0][0]) { 269 fpa->toTPA->y->coeff[0][j][0][0] = localY->coeff[0][j-1] / j; 270 } 271 } 272 for (int i = 1; i < fpa->toTPA->y->nX; i++) { 273 for (int j = 1; j < fpa->toTPA->y->nY; j++) { 274 if (!fpa->toTPA->y->mask[i][j][0][0]) { 275 fpa->toTPA->y->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j); 276 276 } 277 277 }
Note:
See TracChangeset
for help on using the changeset viewer.
