Changeset 27488 for branches/eam_branches/relastro.20100326/src/fitpoly.c
- Timestamp:
- Mar 26, 2010, 4:43:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relastro.20100326/src/fitpoly.c
r17419 r27488 103 103 104 104 /* convert the xsum,ysum,sum terms into vector,matrix and solve */ 105 voidfit_eval (CoordFit *fit) {105 int fit_eval (CoordFit *fit) { 106 106 107 107 int i, j, ix, iy, jx, jy; … … 147 147 } 148 148 149 dgaussjordan (matrix, vector, fit[0].Nelems, 2); 149 status = dgaussjordan (matrix, vector, fit[0].Nelems, 2); 150 if (!status) { 151 return (FALSE); 152 } 150 153 151 154 for (i = 0; i < fit[0].Nelems; i++) { … … 166 169 array_free (matrix, fit[0].Nelems); 167 170 array_free (vector, fit[0].Nelems); 171 return (TRUE); 168 172 } 169 173 … … 271 275 /* this should only apply to the polynomial, not the projection terms */ 272 276 /* compare with psastro supporting code */ 273 CoordFit *fit_apply_coords (CoordFit *fit, Coords *coords) {277 int fit_apply_coords (CoordFit *fit, Coords *coords) { 274 278 275 279 double Xo, Yo, R1, R2; … … 281 285 // L = pc1_1*cd1*(x - cp1) + pc1_2*cd2*(y - cp2) + ... 282 286 283 CoordsGetCenter (fit, 0.001, &Xo, &Yo); 287 if (!CoordsGetCenter (fit, 0.001, &Xo, &Yo)) { 288 fprintf (stderr, "failed to modify model\n"); 289 return (FALSE); 290 } 284 291 coords[0].crpix1 = Xo; 285 292 coords[0].crpix2 = Yo; … … 329 336 /* keep the order and type from initial values */ 330 337 331 // XXX if desired in the future, return modfit (and free above) 332 return (NULL); 333 } 334 338 return (TRUE); 339 } 340
Note:
See TracChangeset
for help on using the changeset viewer.
