- Timestamp:
- Jan 12, 2015, 12:29:24 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-pv3-20140717-merge/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/relastro/src/fitpoly.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pv3-20140717-merge/Ohana
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-pv3-20140717-merge/Ohana/src/relastro/src/fitpoly.c
r33652 r37822 78 78 } 79 79 80 int array_print (double **matrix, int Nx, int Ny) { 81 82 int i, j; 83 for (i = 0; i < Nx; i++) { 84 for (j = 0; j < Ny; j++) { 85 fprintf (stderr, "%10.3e ", matrix[i][j]); 86 } 87 fprintf (stderr, "\n"); 88 } 89 return TRUE; 90 } 91 92 int fit_print (CoordFit *fit) { 93 94 fprintf (stderr, "Npts: %d, Norder: %d, Nterms: %d, Nsums: %d, Nelems: %d\n", 95 fit[0].Npts, fit[0].Norder, fit[0].Nterms, fit[0].Nsums, fit[0].Nelems); 96 97 fprintf (stderr, "sums: \n"); 98 array_print (fit[0].sum, fit[0].Nsums, fit[0].Nsums); 99 100 fprintf (stderr, "xsums: \n"); 101 array_print (fit[0].xsum, fit[0].Nterms, fit[0].Nterms); 102 103 fprintf (stderr, "ysums: \n"); 104 array_print (fit[0].ysum, fit[0].Nterms, fit[0].Nterms); 105 106 fprintf (stderr, "xfits: \n"); 107 array_print (fit[0].xfit, fit[0].Nterms, fit[0].Nterms); 108 109 fprintf (stderr, "yfits: \n"); 110 array_print (fit[0].yfit, fit[0].Nterms, fit[0].Nterms); 111 112 return TRUE; 113 } 114 80 115 // XXX use implicit masks as below or explicit masks (with function to set?) 81 116 // XXX eg, add a global mask to this file and … … 134 169 for (j = 0; j < fit[0].Nelems; j++) { 135 170 matrix[i][j] = 0.0; 171 matrix[j][i] = 0.0; 136 172 } 137 173 vector[i][0] = 0.0; … … 148 184 } 149 185 150 if (!dgaussjordan (matrix, vector, fit[0].Nelems, 2)) {186 if (!dgaussjordan_pivot (matrix, vector, fit[0].Nelems, 2, 1e-16)) { 151 187 array_free (matrix, fit[0].Nelems); 152 188 array_free (vector, fit[0].Nelems); … … 277 313 /* this should only apply to the polynomial, not the projection terms */ 278 314 /* compare with psastro supporting code */ 315 // this code will work for linear (Npolyterm == 0 or 1) and linear + map fits 279 316 int fit_apply_coords (CoordFit *fit, Coords *coords, int keepRef) { 280 317 … … 352 389 /* keep the order and type from initial values */ 353 390 391 if (isnan(coords[0].crval1)) { 392 return FALSE; 393 } 394 if (isnan(coords[0].crval2)) { 395 return FALSE; 396 } 397 if (isnan(coords[0].crpix1)) { 398 return FALSE; 399 } 400 if (isnan(coords[0].crpix2)) { 401 return FALSE; 402 } 403 354 404 return (TRUE); 355 405 }
Note:
See TracChangeset
for help on using the changeset viewer.
