- Timestamp:
- Oct 9, 2008, 2:39:01 PM (18 years ago)
- Location:
- branches/cnb_branch_20080830/psastro/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psastroModelFitBoresite.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branch_20080830/psastro/src
- Property svn:ignore
-
old new 15 15 psastroModel 16 16 gpcModel 17 psastroModelFit
-
- Property svn:ignore
-
branches/cnb_branch_20080830/psastro/src/psastroModelFitBoresite.c
r15891 r20033 2 2 3 3 // we now have a set of observed L,M values. fit these to the boresite model 4 psVector *psastroModelFitBoresite (psVector *Xo, psVector *Yo, psVector *Po ) {4 psVector *psastroModelFitBoresite (psVector *Xo, psVector *Yo, psVector *Po, char *outroot) { 5 5 6 6 assert (Xo->n > 2); … … 60 60 params->data.F32[PAR_T0] = 0.0; 61 61 62 psMinimization *myMin = psMinimizationAlloc ( 15, 0.001);62 psMinimization *myMin = psMinimizationAlloc (25, 0.001); 63 63 psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32); 64 64 … … 74 74 psMinimizeLMChi2(myMin, covar, params, constraint, x, y, NULL, psastroModelBoresite); 75 75 76 fprintf (stderr, "fitted values:\n"); 77 fprintf (stderr, "Xo: %f\n", params->data.F32[PAR_X0]); 78 fprintf (stderr, "Yo: %f\n", params->data.F32[PAR_Y0]); 79 fprintf (stderr, "RX: %f\n", params->data.F32[PAR_RX]); 80 fprintf (stderr, "RY: %f\n", params->data.F32[PAR_RY]); 81 fprintf (stderr, "P0: %f\n", params->data.F32[PAR_P0]); 82 fprintf (stderr, "T0: %f\n", params->data.F32[PAR_T0]); 76 char filename[256]; 77 snprintf (filename, 256, "%s.pars", outroot); 78 FILE *outfile = fopen (filename, "w"); 79 if (!outfile) { 80 psAbort("cannot open %s for output", filename); 81 } 82 83 fprintf (outfile, "# fitted values:\n"); 84 fprintf (outfile, "Xo: %f\n", params->data.F32[PAR_X0]); 85 fprintf (outfile, "Yo: %f\n", params->data.F32[PAR_Y0]); 86 fprintf (outfile, "RX: %f\n", params->data.F32[PAR_RX]); 87 fprintf (outfile, "RY: %f\n", params->data.F32[PAR_RY]); 88 fprintf (outfile, "P0: %f\n", params->data.F32[PAR_P0]); 89 fprintf (outfile, "T0: %f\n", params->data.F32[PAR_T0]); 90 fclose (outfile); 83 91 84 92 return params;
Note:
See TracChangeset
for help on using the changeset viewer.
