IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 26, 2010, 4:43:50 PM (16 years ago)
Author:
eugene
Message:

updates to handle image coordinate failures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relastro.20100326/src/fitpoly.c

    r17419 r27488  
    103103
    104104/* convert the xsum,ysum,sum terms into vector,matrix and solve */
    105 void fit_eval (CoordFit *fit) {
     105int fit_eval (CoordFit *fit) {
    106106
    107107  int i, j, ix, iy, jx, jy;
     
    147147  }     
    148148
    149   dgaussjordan (matrix, vector, fit[0].Nelems, 2);
     149  status = dgaussjordan (matrix, vector, fit[0].Nelems, 2);
     150  if (!status) {
     151    return (FALSE);
     152  }
    150153
    151154  for (i = 0; i < fit[0].Nelems; i++) {
     
    166169  array_free (matrix, fit[0].Nelems);
    167170  array_free (vector, fit[0].Nelems);
     171  return (TRUE);
    168172}
    169173
     
    271275/* this should only apply to the polynomial, not the projection terms */
    272276/* compare with psastro supporting code */
    273 CoordFit *fit_apply_coords (CoordFit *fit, Coords *coords) {
     277int fit_apply_coords (CoordFit *fit, Coords *coords) {
    274278
    275279  double Xo, Yo, R1, R2;
     
    281285  // L = pc1_1*cd1*(x - cp1) + pc1_2*cd2*(y - cp2) + ...
    282286
    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  }
    284291  coords[0].crpix1 = Xo;
    285292  coords[0].crpix2 = Yo;
     
    329336  /* keep the order and type from initial values */
    330337 
    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.