IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2006, 10:58:49 PM (20 years ago)
Author:
eugene
Message:

major updates to use gprint for buffered / threaded printing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/fit.c

    r4689 r7917  
    4242
    4343  if (argc != 4) {
    44     fprintf (stderr, "USAGE: fit x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n");
     44    gprint (GP_ERR, "USAGE: fit x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n");
    4545    return (FALSE);
    4646  }
     
    5050
    5151  if (xvec[0].Nelements != yvec[0].Nelements) {
    52     fprintf (stderr, "vectors must have same length\n");
     52    gprint (GP_ERR, "vectors must have same length\n");
    5353    return (FALSE);
    5454  }
    5555  if (Weight && xvec[0].Nelements != dyvec[0].Nelements) {
    56     fprintf (stderr, "vectors must have same length\n");
     56    gprint (GP_ERR, "vectors must have same length\n");
    5757    return (FALSE);
    5858  }
     
    166166     
    167167  /* print & save basic fit parameters */
    168   if (!Quiet) fprintf (stderr, "y = ");
     168  if (!Quiet) gprint (GP_ERR, "y = ");
    169169  for (i = 0; i < nterm; i++) {
    170170    sprintf (name, "C%d", i);
    171171    set_variable (name, b[i][0]);
    172     if (!Quiet) fprintf (stderr, "%f x^%d ", b[i][0], i);
     172    if (!Quiet) gprint (GP_ERR, "%f x^%d ", b[i][0], i);
    173173  }
    174174  sprintf (name, "Cn");
     
    176176 
    177177  /* print & save basic fit parameters */
    178   if (!Quiet) fprintf (stderr, "\n");
    179   if (!Quiet) fprintf (stderr, "    ");
     178  if (!Quiet) gprint (GP_ERR, "\n");
     179  if (!Quiet) gprint (GP_ERR, "    ");
    180180  for (i = 0; i < nterm; i++) {
    181181    sprintf (name, "dC%d", i);
    182182    set_variable (name, sqrt(c[i][i]));
    183     if (!Quiet) fprintf (stderr, "%f     ", sqrt(c[i][i]));
    184   }
    185   if (!Quiet) fprintf (stderr, "\n");
     183    if (!Quiet) gprint (GP_ERR, "%f     ", sqrt(c[i][i]));
     184  }
     185  if (!Quiet) gprint (GP_ERR, "\n");
    186186
    187187  set_variable ("dC", sigma);
Note: See TracChangeset for help on using the changeset viewer.