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

Location:
trunk/Ohana/src/opihi/cmd.astro
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/biassub.c

    r4689 r7917  
    2121
    2222  if (argc != 7) {
    23     fprintf (stderr, "USAGE: biassub <buffer> sx sy nx ny dir [-v N V]\n");
    24     fprintf (stderr, "  optional storage of vector and sequence in N and V\n");
     23    gprint (GP_ERR, "USAGE: biassub <buffer> sx sy nx ny dir [-v N V]\n");
     24    gprint (GP_ERR, "  optional storage of vector and sequence in N and V\n");
    2525    return (FALSE);
    2626  }
     
    3333  dir = atof (argv[6]);
    3434  if ((dir != 0) && (dir != 1)) {
    35     fprintf (stderr, " dir must be either 0 (x) or 1 (y)\n");
     35    gprint (GP_ERR, " dir must be either 0 (x) or 1 (y)\n");
    3636    return (FALSE);
    3737  }
     
    4545    nlong = nx;
    4646  }   
    47   fprintf (GetOutfile(), "start: %d %d  size: %d %d\n", sx, sy, nx, ny);
     47  gprint (GP_LOG, "start: %d %d  size: %d %d\n", sx, sy, nx, ny);
    4848
    4949    if ((sx < 0) || (sy < 0) ||
    5050      (sx+nx > buf[0].matrix.Naxis[0]) ||
    5151      (sy+ny > buf[0].matrix.Naxis[1])) {
    52     fprintf (stderr, "region out of range\n");
     52    gprint (GP_ERR, "region out of range\n");
    5353    return (FALSE);
    5454  }
  • trunk/Ohana/src/opihi/cmd.astro/cgrid.c

    r7080 r7917  
    2020
    2121  if (argc != 1) {
    22     fprintf (stderr, "USAGE: cgrid [style]\n");
     22    gprint (GP_ERR, "USAGE: cgrid [style]\n");
    2323    return (FALSE);
    2424  }
  • trunk/Ohana/src/opihi/cmd.astro/coords.c

    r3460 r7917  
    4343  if (!strcmp(&coords.ctype[4], "-WRP")) {
    4444    if (MOSAIC == NULL) {
    45       fprintf (stderr, "must supply mosaic for WRP coords\n");
     45      gprint (GP_ERR, "must supply mosaic for WRP coords\n");
    4646      return (FALSE);
    4747    }
     
    5353  if (mode == SKY) {
    5454    XY_to_RD (&R, &D, X, Y, &coords);
    55     fprintf (GetOutfile(), "%10.6f %10.6f\n", R, D);
     55    gprint (GP_LOG, "%10.6f %10.6f\n", R, D);
    5656    set_variable ("RA", R);
    5757    set_variable ("DEC", D);
     
    6161  if (mode == PIXEL) {
    6262    RD_to_XY (&X, &Y, R, D, &coords);
    63     fprintf (GetOutfile(), "%7.2f %7.2f\n", X, Y);
     63    gprint (GP_LOG, "%7.2f %7.2f\n", X, Y);
    6464    set_variable ("Xc", X);
    6565    set_variable ("Yc", Y);
     
    6969
    7070 syntax:
    71   fprintf (stderr, "USAGE: coords [buffer] (-c R D) / (-p X Y)\n");
    72   fprintf (stderr, "only one of -p or -c can be used\n");
     71  gprint (GP_ERR, "USAGE: coords [buffer] (-c R D) / (-p X Y)\n");
     72  gprint (GP_ERR, "only one of -p or -c can be used\n");
    7373 escape:
    7474  if (MOSAIC != NULL) free (MOSAIC);
  • trunk/Ohana/src/opihi/cmd.astro/cplot.c

    r7391 r7917  
    1111
    1212  if (argc != 3) {
    13     fprintf (stderr, "USAGE: cplot <ra> <dec> [style]\n");
     13    gprint (GP_ERR, "USAGE: cplot <ra> <dec> [style]\n");
    1414    return (FALSE);
    1515  }
     
    2424
    2525  if (xvec[0].Nelements != yvec[0].Nelements) {
    26     fprintf (stderr, "vectors are not the same length\n");
     26    gprint (GP_ERR, "vectors are not the same length\n");
    2727    return (FALSE);
    2828  }
  • trunk/Ohana/src/opihi/cmd.astro/csystem.c

    r2598 r7917  
    1313   
    1414  if (argc != 5) {
    15     fprintf (stderr, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n");
     15    gprint (GP_ERR, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n");
    1616    return (FALSE);
    1717  }
     
    2222    switch (argv[2][0]) {
    2323    case 'C':
    24       fprintf (stderr, "same coordinate system\n");
     24      gprint (GP_ERR, "same coordinate system\n");
    2525      return (TRUE);
    2626      break;
     
    5151      break;
    5252    case 'G':
    53       fprintf (stderr, "error: conversions between galactic and ecliptic not implemented\n");
     53      gprint (GP_ERR, "error: conversions between galactic and ecliptic not implemented\n");
    5454      return (FALSE);
    5555      phi = -62.6*RAD_DEG;
     
    7373      break;
    7474    case 'E':
    75       fprintf (stderr, "error: conversions between galactic and ecliptic not implemented\n");
     75      gprint (GP_ERR, "error: conversions between galactic and ecliptic not implemented\n");
    7676      return (FALSE);
    7777      gettimeofday (&now, (struct timezone *) NULL);
     
    9191
    9292  if (xvec[0].Nelements != yvec[0].Nelements) {
    93     fprintf (stderr, "vectors %s and %s not the same length\n", argv[3], argv[4]);
     93    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[3], argv[4]);
    9494    return (FALSE);
    9595  }
  • trunk/Ohana/src/opihi/cmd.astro/ctimes.c

    r2843 r7917  
    1616
    1717  if (argc != 3) {
    18     fprintf (stderr, "USAGE: ctimes [-ref (value) / -abs (date)] [-var name]\n");
     18    gprint (GP_ERR, "USAGE: ctimes [-ref (value) / -abs (date)] [-var name]\n");
    1919    return (FALSE);
    2020  }
     
    3535      free (Variable);
    3636    } else {
    37       fprintf (stderr, "time: %s\n", date);
     37      gprint (GP_ERR, "time: %s\n", date);
    3838    }
    3939
     
    4444
    4545    if (strcmp (argv[1], "-abs")) {
    46       fprintf (stderr, "syntax error\n");
     46      gprint (GP_ERR, "syntax error\n");
    4747      return (FALSE);
    4848    }
    4949
    5050    if (!str_to_time (argv[2], &time)) {
    51       fprintf (stderr, "syntax error\n");
     51      gprint (GP_ERR, "syntax error\n");
    5252      return (FALSE);
    5353    }
     
    6060      return (TRUE);
    6161    }
    62     fprintf (stderr, "time: %f\n", value);
     62    gprint (GP_ERR, "time: %f\n", value);
    6363    return (TRUE);
    6464  }
  • trunk/Ohana/src/opihi/cmd.astro/cval.c

    r2598 r7917  
    99
    1010  if (argc != 7) {
    11     fprintf (stderr, "USAGE: cval <buffer> x y dx dy sky\n");
     11    gprint (GP_ERR, "USAGE: cval <buffer> x y dx dy sky\n");
    1212    return (FALSE);
    1313  }
     
    2828      (sx+nx > buf[0].matrix.Naxis[0]) ||
    2929      (sy+ny > buf[0].matrix.Naxis[1])) {
    30     fprintf (stderr, "region out of range\n");
     30    gprint (GP_ERR, "region out of range\n");
    3131    return (FALSE);
    3232  }
     
    4545  }
    4646
    47   fprintf (stderr, "cval: %f  sn: %f\n", cval, sqrt(sn));
     47  gprint (GP_ERR, "cval: %f  sn: %f\n", cval, sqrt(sn));
    4848
    4949  return (TRUE);
  • trunk/Ohana/src/opihi/cmd.astro/czplot.c

    r7080 r7917  
    1212
    1313  if (argc != 6) {
    14     fprintf (stderr, "USAGE: czplot <x> <y> <z> min max\n");
     14    gprint (GP_ERR, "USAGE: czplot <x> <y> <z> min max\n");
    1515    return (FALSE);
    1616  }
     
    2828
    2929  if (xvec[0].Nelements != yvec[0].Nelements) {
    30     fprintf (stderr, "vectors %s and %s not the same length\n", argv[1], argv[2]);
     30    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[2]);
    3131    return (FALSE);
    3232  }
    3333  if (xvec[0].Nelements != zvec[0].Nelements) {
    34     fprintf (stderr, "vectors %s and %s not the same length\n", argv[1], argv[3]);
     34    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[3]);
    3535    return (FALSE);
    3636  }
  • trunk/Ohana/src/opihi/cmd.astro/drizzle.c

    r4689 r7917  
    2727
    2828  if (argc != 5) {
    29     fprintf (stderr, "USAGE: transform <from> <to> <weight> (Nlinear)\n");
    30     fprintf (stderr, "  output buffer must exist with target astrometry header\n");
    31     fprintf (stderr, "  Nlinear is the pixel scale for linear astrometric transformation\n");
     29    gprint (GP_ERR, "USAGE: transform <from> <to> <weight> (Nlinear)\n");
     30    gprint (GP_ERR, "  output buffer must exist with target astrometry header\n");
     31    gprint (GP_ERR, "  Nlinear is the pixel scale for linear astrometric transformation\n");
    3232    return (FALSE);
    3333  }
     
    4343  /* for the moment, disable WRP / DIS */
    4444  if (!strcmp(&coords_in.ctype[4], "-WRP") || !strcmp(&coords_out.ctype[4], "-WRP")) {
    45     fprintf (stderr, "WRP mode not implemented for astrom\n");
     45    gprint (GP_ERR, "WRP mode not implemented for astrom\n");
    4646    return (FALSE);
    4747  }
     
    5050  scale_out = sqrt(fabs(coords_out.cdelt1*coords_out.cdelt2*(coords_out.pc1_1*coords_out.pc2_2 - coords_out.pc1_2*coords_out.pc2_1)));
    5151 
    52   fprintf (stderr, "%f - %f\n", scale_in, scale_out);
     52  gprint (GP_ERR, "%f - %f\n", scale_in, scale_out);
    5353
    5454  if (scale_in > scale_out) {
  • trunk/Ohana/src/opihi/cmd.astro/fixwrap.c

    r6678 r7917  
    88
    99  if (argc != 3) {
    10     fprintf (stderr, "USAGE: fixwrap <in> (rowfix)\n");
     10    gprint (GP_ERR, "USAGE: fixwrap <in> (rowfix)\n");
    1111    return (FALSE);
    1212  }
  • trunk/Ohana/src/opihi/cmd.astro/flux.c

    r2843 r7917  
    1212
    1313  if (argc != 3) {
    14     fprintf (stderr, "USAGE: flux <buffer> (region)\n");
     14    gprint (GP_ERR, "USAGE: flux <buffer> (region)\n");
    1515    return (FALSE);
    1616  }
     
    2020  f = fopen (argv[2], "r");
    2121  if (f == (FILE *) NULL) {
    22     fprintf (stderr, "file %s not found\n", argv[2]);
     22    gprint (GP_ERR, "file %s not found\n", argv[2]);
    2323    return (FALSE);
    2424  }
     
    4646    bb[i] = hypot (bx[i], by[i]) * SIGN (bx[i]*by[i+1] - bx[i+1]*by[i]);
    4747  }
    48   fprintf (stderr, "%f %f %f %f\n", bb[0], bb[1], bb[2], bb[3]);
     48  gprint (GP_ERR, "%f %f %f %f\n", bb[0], bb[1], bb[2], bb[3]);
    4949
    5050  /* this only works for convex contours --
     
    7070  signal (SIGINT, oldsignal);
    7171
    72   fprintf (GetOutfile(), "flux: %f\n", flux);
     72  gprint (GP_LOG, "flux: %f\n", flux);
    7373  set_variable ("FLUX", flux);
    7474  return (TRUE);
  • trunk/Ohana/src/opihi/cmd.astro/gauss.c

    r5850 r7917  
    3333 
    3434  if ((argc != 2) && (argc != 3)) {
    35     fprintf (stderr, "USAGE: gauss Npix [Nspots] [-border N] [-sat cnts]\n");
     35    gprint (GP_ERR, "USAGE: gauss Npix [Nspots] [-border N] [-sat cnts]\n");
    3636    return (FALSE);
    3737  }
    3838 
    3939  if (Ximage < 1) {
    40     fprintf (stderr, "no active TV\n");
     40    gprint (GP_ERR, "no active TV\n");
    4141    return (FALSE);
    4242  }
  • trunk/Ohana/src/opihi/cmd.astro/getvel.c

    r7080 r7917  
    1313
    1414  if (argc != 5) {
    15     fprintf (stderr, "USAGE: rotcurve buf X Y curve.txt\n");
     15    gprint (GP_ERR, "USAGE: rotcurve buf X Y curve.txt\n");
    1616    return (FALSE);
    1717  }
     
    1919  f = fopen (argv[4], "r");
    2020  if (f == (FILE *) NULL) {
    21     fprintf (stderr, "can't find rotation curve data file %s\n", argv[4]);
     21    gprint (GP_ERR, "can't find rotation curve data file %s\n", argv[4]);
    2222    return (FALSE);
    2323  }
     
    4545  while (L >= 360) {L -= 360.0;}
    4646  while (L < 0.0)  {L += 360.0;}
    47   fprintf (stderr, "L: %f\n", L);
     47  gprint (GP_ERR, "L: %f\n", L);
    4848
    4949  cl = cos (L*RAD_DEG);
     
    5959  for (n = 0; (n < Ncurve) && (wr < W[n]); n++);
    6060  if ((n == 0) || (n == Ncurve)) {
    61     fprintf (stderr, "velocity out of reasonable range\n");
    62     fprintf (stderr, "%f %f %f %f\n", V, wr, W[0], W[Ncurve-1]);
     61    gprint (GP_ERR, "velocity out of reasonable range\n");
     62    gprint (GP_ERR, "%f %f %f %f\n", V, wr, W[0], W[Ncurve-1]);
    6363    return (TRUE);
    6464  }
     
    6666  fr = (Ro/r);
    6767  if (r < fabs(Rs)) { /* can't be on rotation curve */
    68     fprintf (stderr, "velocity out of reasonable range\n");
    69     fprintf (stderr, "%f %f %f %f %f %f %f\n", V, wr, W[0], W[Ncurve-1], r, fr, Rs);
     68    gprint (GP_ERR, "velocity out of reasonable range\n");
     69    gprint (GP_ERR, "%f %f %f %f %f %f %f\n", V, wr, W[0], W[Ncurve-1], r, fr, Rs);
    7070    return (TRUE);
    7171  }
     
    7575    d = Ro*cl + sqrt(r*r - Rs*Rs);
    7676 
    77   fprintf (stderr, "dist: %f, vel: %f\n", d, V);
     77  gprint (GP_ERR, "dist: %f, vel: %f\n", d, V);
    7878
    7979  return (TRUE);
  • trunk/Ohana/src/opihi/cmd.astro/imfit.c

    r4689 r7917  
    6565    qrgauss_setup (argv[N]);
    6666    if (fitfunc == NULL) {
    67       fprintf (stderr, "unknown function %s\n", argv[N]);
     67      gprint (GP_ERR, "unknown function %s\n", argv[N]);
    6868      return (FALSE);
    6969    }
     
    7272
    7373  if (argc != 6) {
    74     fprintf (stderr, "USAGE: imfit <buffer> sx sy nx ny\n");
     74    gprint (GP_ERR, "USAGE: imfit <buffer> sx sy nx ny\n");
    7575    return (FALSE);
    7676  }
     
    170170  if (VERBOSE) {
    171171    for (i = 0; i < Npar; i++) {
    172       fprintf (stderr, "%g ", par[i]);
     172      gprint (GP_ERR, "%g ", par[i]);
    173173    }
    174     fprintf (stderr, "\n");
     174    gprint (GP_ERR, "\n");
    175175  }
    176176
     
    186186
    187187range:
    188   fprintf (stderr, "region out of range\n");
     188  gprint (GP_ERR, "region out of range\n");
    189189  return (FALSE);
    190190}
  • trunk/Ohana/src/opihi/cmd.astro/imsub.c

    r3144 r7917  
    3030    qrgauss_setup (argv[N]);
    3131    if (fitfunc == NULL) {
    32       fprintf (stderr, "unknown function %s\n", argv[N]);
     32      gprint (GP_ERR, "unknown function %s\n", argv[N]);
    3333      return (FALSE);
    3434    }
     
    3737
    3838  if (argc != 6) {
    39     fprintf (stderr, "USAGE: imfit <buffer> sx sy nx ny\n");
     39    gprint (GP_ERR, "USAGE: imfit <buffer> sx sy nx ny\n");
    4040    return (FALSE);
    4141  }
     
    7474
    7575range:
    76   fprintf (stderr, "region out of range\n");
     76  gprint (GP_ERR, "region out of range\n");
    7777  return (FALSE);
    7878}
  • trunk/Ohana/src/opihi/cmd.astro/medianmap.c

    r7080 r7917  
    3131
    3232  if (argc != 5) {
    33     fprintf (stderr, "USAGE: medianmap (in) (out) Nx Ny [-range min max]\n");
    34     fprintf (stderr, "       Nx, Ny specify dimensions of output image\n");
    35     fprintf (stderr, "       min, max specify fractional range for sorted average\n");
     33    gprint (GP_ERR, "USAGE: medianmap (in) (out) Nx Ny [-range min max]\n");
     34    gprint (GP_ERR, "       Nx, Ny specify dimensions of output image\n");
     35    gprint (GP_ERR, "       min, max specify fractional range for sorted average\n");
    3636    return (FALSE);
    3737  }
  • trunk/Ohana/src/opihi/cmd.astro/mkgauss.c

    r2843 r7917  
    2121
    2222  if ((argc < 3) || (argc > 5)) {
    23     fprintf (stderr, "USAGE: mkgauss (buffer) (sigma) [[sy/sx] angle]\n");
     23    gprint (GP_ERR, "USAGE: mkgauss (buffer) (sigma) [[sy/sx] angle]\n");
    2424    return (FALSE);
    2525  }
  • trunk/Ohana/src/opihi/cmd.astro/multifit.c

    r2598 r7917  
    1111
    1212  if (argc != 2) {
    13     fprintf (stderr, "USAGE: multifit (Norder)\n");
     13    gprint (GP_ERR, "USAGE: multifit (Norder)\n");
    1414    return (FALSE);
    1515  }
     
    170170 
    171171 escape:
    172   fprintf (stderr, "syntax error\n");
     172  gprint (GP_ERR, "syntax error\n");
    173173  return (FALSE);
    174174 
  • trunk/Ohana/src/opihi/cmd.astro/objload.c

    r7680 r7917  
    2727
    2828  if (argc != 3) {
    29     fprintf (stderr, "USAGE: objload (overlay) <filename>\n");
     29    gprint (GP_ERR, "USAGE: objload (overlay) <filename>\n");
    3030    return (FALSE);
    3131  }
     
    3333  f = fopen (argv[2], "r");
    3434  if (f == (FILE *) NULL) {
    35     fprintf (stderr, "ERROR: can't find object file %s\n", argv[2]);
     35    gprint (GP_ERR, "ERROR: can't find object file %s\n", argv[2]);
    3636    return (FALSE);
    3737  }
     
    6969  free (line);
    7070
    71   fprintf (stderr, "loaded %d objects\n", Noverlay);
     71  gprint (GP_ERR, "loaded %d objects\n", Noverlay);
    7272  return (TRUE);
    7373}
  • trunk/Ohana/src/opihi/cmd.astro/outline.c

    r5846 r7917  
    1414
    1515  if (argc != 9) {
    16     fprintf (stderr, "USAGE: outline x y dx dy dxy Io (buffer) Npar\n");
     16    gprint (GP_ERR, "USAGE: outline x y dx dy dxy Io (buffer) Npar\n");
    1717    return (FALSE);
    1818  }
     
    4343
    4444  chisq = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
    45   fprintf (stderr, "chisq (1): %f\n", chisq);
     45  gprint (GP_ERR, "chisq (1): %f\n", chisq);
    4646 
    4747  for (j = 0; j < 15; j++) {
     
    6363          chisq = nchisq;
    6464        }
    65         fprintf (stderr, "frac: %f  %f %f   %f\n", frac, par[2], par[3], chisq);
     65        gprint (GP_ERR, "frac: %f  %f %f   %f\n", frac, par[2], par[3], chisq);
    6666      }
    6767    }
     
    112112        }       
    113113        /*
    114         fprintf (stderr, "try: %d  %f   ", i, chisq);
     114        gprint (GP_ERR, "try: %d  %f   ", i, chisq);
    115115        for (k = 0; k < 5; k++) {
    116           fprintf (stderr, "%f ", par[k]);
     116          gprint (GP_ERR, "%f ", par[k]);
    117117        }
    118         fprintf (stderr, "\n");
     118        gprint (GP_ERR, "\n");
    119119        */
    120120        ochisq = chisq;
     
    130130    }
    131131
    132     fprintf (stderr, "try: %d  %f   ", j, chisq);
     132    gprint (GP_ERR, "try: %d  %f   ", j, chisq);
    133133    for (i = 0; i < 5; i++) {
    134       fprintf (stderr, "%f ", par[i]);
    135     }
    136     fprintf (stderr, "\n          ");
     134      gprint (GP_ERR, "%f ", par[i]);
     135    }
     136    gprint (GP_ERR, "\n          ");
    137137    for (i = 0; i < 5; i++) {
    138       fprintf (stderr, "%f ", dpar[i]);
    139     }
    140     fprintf (stderr, "\n");
     138      gprint (GP_ERR, "%f ", dpar[i]);
     139    }
     140    gprint (GP_ERR, "\n");
    141141    dchi -= chisq;
    142142
  • trunk/Ohana/src/opihi/cmd.astro/outline2.c

    r5846 r7917  
    1818
    1919  if (argc != 9) {
    20     fprintf (stderr, "USAGE: outline x y dx dy dxy Io dIo (buffer)\n");
     20    gprint (GP_ERR, "USAGE: outline x y dx dy dxy Io dIo (buffer)\n");
    2121    return (FALSE);
    2222  }
     
    7878
    7979  if (Npts == 0) {
    80     fprintf (stderr, "no valid points in box, try again\n");
     80    gprint (GP_ERR, "no valid points in box, try again\n");
    8181    free (xs);
    8282    free (ys);
     
    8787  plot_outline ();
    8888  chisq = outline_chi (Io, in);
    89   fprintf (stderr, "starting chisq: %f for %d pts\n", chisq, Npts);
     89  gprint (GP_ERR, "starting chisq: %f for %d pts\n", chisq, Npts);
    9090
    9191# if (1)
     
    139139    }
    140140
    141     fprintf (stderr, "try: %d  %f   ", j, chisq);
     141    gprint (GP_ERR, "try: %d  %f   ", j, chisq);
    142142    for (i = 0; i < 5; i++) {
    143       fprintf (stderr, "%f ", par[i]);
    144     }
    145     fprintf (stderr, "\n          ");
     143      gprint (GP_ERR, "%f ", par[i]);
     144    }
     145    gprint (GP_ERR, "\n          ");
    146146    for (i = 0; i < 5; i++) {
    147       fprintf (stderr, "%f ", dpar[i]);
    148     }
    149     fprintf (stderr, "\n");
     147      gprint (GP_ERR, "%f ", dpar[i]);
     148    }
     149    gprint (GP_ERR, "\n");
    150150    dchi -= chisq;
    151151
  • trunk/Ohana/src/opihi/cmd.astro/polar.c

    r7080 r7917  
    1212
    1313  if (argc != 4) {
    14     fprintf (stderr, "USAGE: polar in out\n");
     14    gprint (GP_ERR, "USAGE: polar in out\n");
    1515    return (FALSE);
    1616  }
     
    2525  ny = mask[0].matrix.Naxis[1];
    2626  if ((Nx != nx) && (Ny != ny)) {
    27     fprintf (stderr, "output and mask must have same dimensions\n");
     27    gprint (GP_ERR, "output and mask must have same dimensions\n");
    2828    return (FALSE);
    2929  }
  • trunk/Ohana/src/opihi/cmd.astro/precess.c

    r2598 r7917  
    1515  in_epoch = out_epoch = 2000.0;
    1616  if (argc != 5) {
    17     fprintf (stderr, "USAGE:  precess (from) (to) RA DEC \n");
    18     fprintf (stderr, "   you may use B for B1950.0 or J for J2000.0\n");
     17    gprint (GP_ERR, "USAGE:  precess (from) (to) RA DEC \n");
     18    gprint (GP_ERR, "   you may use B for B1950.0 or J for J2000.0\n");
    1919    return (FALSE);
    2020  }
     
    5656  }
    5757
    58   fprintf (stderr, "converting from J%f to J%f\n", in_epoch, out_epoch);
     58  gprint (GP_ERR, "converting from J%f to J%f\n", in_epoch, out_epoch);
    5959
    6060  T = (out_epoch - in_epoch) / 100.0;
     
    7777    if (RA < 0)
    7878      RA += 360;
    79     fprintf (GetOutfile(), "%f %f -> %f %f\n", A, D, RA, DEC);
     79    gprint (GP_LOG, "%f %f -> %f %f\n", A, D, RA, DEC);
    8080    return (TRUE);
    8181  }   
     
    8686
    8787  if (xvec[0].Nelements != yvec[0].Nelements) {
    88     fprintf (stderr, "vectors %s and %s not the same length\n", argv[3], argv[4]);
     88    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[3], argv[4]);
    8989    return (FALSE);
    9090  }
  • trunk/Ohana/src/opihi/cmd.astro/profile.c

    r2598 r7917  
    1010
    1111  if (argc != 7) {
    12     fprintf (stderr, "USAGE: profile <buffer> <X vector> <Y vector> x y N\n");
     12    gprint (GP_ERR, "USAGE: profile <buffer> <X vector> <Y vector> x y N\n");
    1313    return (FALSE);
    1414  }
     
    4747
    4848range_error:
    49   fprintf (stderr, "region out of range\n");
     49  gprint (GP_ERR, "region out of range\n");
    5050  return (FALSE);
    5151}
  • trunk/Ohana/src/opihi/cmd.astro/region.c

    r5850 r7917  
    3333
    3434  if ((argc != 4) && (argc != 5)) {
    35     fprintf (stderr, "USAGE: region Ra Dec Radius [projection] [orientation]\n");
    36     fprintf (stderr, " current: %f %f (%f x %f) (%s)\n",
     35    gprint (GP_ERR, "USAGE: region Ra Dec Radius [projection] [orientation]\n");
     36    gprint (GP_ERR, " current: %f %f (%f x %f) (%s)\n",
    3737             graphmode.coords.crval1, graphmode.coords.crval2,
    3838             fabs(graphmode.xmax - graphmode.xmin),
  • trunk/Ohana/src/opihi/cmd.astro/rotcurve.c

    r7080 r7917  
    2121
    2222  if (argc != 5) {
    23     fprintf (stderr, "USAGE: rotcurve in out mask curve.txt\n");
     23    gprint (GP_ERR, "USAGE: rotcurve in out mask curve.txt\n");
    2424    return (FALSE);
    2525  }
     
    2727  f = fopen (argv[4], "r");
    2828  if (f == (FILE *) NULL) {
    29     fprintf (stderr, "can't find rotation curve data file %s\n", argv[4]);
     29    gprint (GP_ERR, "can't find rotation curve data file %s\n", argv[4]);
    3030    return (FALSE);
    3131  }
     
    4545  ny = mask[0].matrix.Naxis[1];
    4646  if ((Nx != nx) && (Ny != ny)) {
    47     fprintf (stderr, "output and mask must have same dimensions\n");
     47    gprint (GP_ERR, "output and mask must have same dimensions\n");
    4848    return (FALSE);
    4949  }
     
    7474  X = (L - Lo) / dL + Xo;
    7575  if ((X >= Nx) || (X < 0)) {
    76     fprintf (stderr, "X out of range\n");
     76    gprint (GP_ERR, "X out of range\n");
    7777    return (FALSE);
    7878  }
    79   fprintf (stderr, "L: %f (%d)\n", L, X);
     79  gprint (GP_ERR, "L: %f (%d)\n", L, X);
    8080
    8181  cl = cos (L*RAD_DEG);
  • trunk/Ohana/src/opihi/cmd.astro/scale.c

    r2598 r7917  
    66
    77  if (argc != 5) {
    8     fprintf (stderr, "USAGE: scale (buffer) (key) [-r/-w] (value)\n");
     8    gprint (GP_ERR, "USAGE: scale (buffer) (key) [-r/-w] (value)\n");
    99    return (FALSE);
    1010  } 
     
    1313
    1414  if (strcasecmp (argv[2], "bzero") && strcasecmp (argv[2], "bscale")) {
    15     fprintf (stderr, "use bzero or bscale only\n");
     15    gprint (GP_ERR, "use bzero or bscale only\n");
    1616    return (FALSE);
    1717  }
    1818   
    1919  if (strcmp (argv[3], "-r") && strcmp (argv[3], "-w")) {
    20     fprintf (stderr, "use -r or -w only\n");
     20    gprint (GP_ERR, "use -r or -w only\n");
    2121    return (FALSE);
    2222  }
  • trunk/Ohana/src/opihi/cmd.astro/sexigesimal.c

    r2843 r7917  
    1818
    1919  if ((argc != 3) && (argc != 2)) {
    20     fprintf (stderr, "USAGE: sexigesimal (from) [to]\n");
     20    gprint (GP_ERR, "USAGE: sexigesimal (from) [to]\n");
    2121    return (FALSE);
    2222  }
     
    2424  if (HMS) {
    2525    if (!dms_to_ddd (&value, argv[1])) {
    26       fprintf (stderr, "syntax error in input\n");
     26      gprint (GP_ERR, "syntax error in input\n");
    2727      return (FALSE);
    2828    }
     
    3030      set_variable (argv[2], value);
    3131    } else {
    32       fprintf (GetOutfile(), "%10.6f\n", value);
     32      gprint (GP_LOG, "%10.6f\n", value);
    3333    }
    3434    return (TRUE);
     
    3939      set_str_variable (argv[2], string);
    4040    } else {
    41       fprintf (GetOutfile(), "%s\n", string);
     41      gprint (GP_LOG, "%s\n", string);
    4242    }
    4343    return (TRUE);
  • trunk/Ohana/src/opihi/cmd.astro/spec.c

    r4689 r7917  
    3434 
    3535  if (argc != 7) {
    36     fprintf (stderr, "USAGE: spec buffer x y1 y2 X Y [-Nlong N] [-Ngap N] [-Nrow N]\n");
     36    gprint (GP_ERR, "USAGE: spec buffer x y1 y2 X Y [-Nlong N] [-Ngap N] [-Nrow N]\n");
    3737    return (FALSE);
    3838  }
    3939 
    4040  if ((Nrow < 1) || (Nlong < 2) || (Ngap < 1) || (Nlong - Ngap < 2)) {
    41     fprintf (stderr, "bad values for options\n");
     41    gprint (GP_ERR, "bad values for options\n");
    4242    return (FALSE);
    4343  }
     
    7979    }
    8080    X1 = SX / S;
    81     fprintf (stderr, "%4d %4d %5.1f ", j+y1, X1, sky);
     81    gprint (GP_ERR, "%4d %4d %5.1f ", j+y1, X1, sky);
    8282    /*    X1 = MAX (MIN (X1, Xo + 0.5+Ngap), Xo - 0.5+Ngap); */
    8383    V = (float *) (buf[0].matrix.buffer) + Nx*(y1 + j) + X1 - (int)(0.5*Nlong);
     
    105105    xvec[0].elements[j] = j + y1;
    106106    yvec[0].elements[j] = F / R;
    107     fprintf (stderr, " %5.1f %7.1f  %6.2f\n", sky, sky2, (F/R));
     107    gprint (GP_ERR, " %5.1f %7.1f  %6.2f\n", sky, sky2, (F/R));
    108108  }   
    109109
  • trunk/Ohana/src/opihi/cmd.astro/star.c

    r2843 r7917  
    2323 
    2424  if ((argc != 4) && (argc != 5)) {
    25     fprintf (stderr, "USAGE: star (buffer) x y [dx] [-border N] [-sat cnts]\n");
     25    gprint (GP_ERR, "USAGE: star (buffer) x y [dx] [-border N] [-sat cnts]\n");
    2626    return (FALSE);
    2727  }
  • trunk/Ohana/src/opihi/cmd.astro/testfit.c

    r2598 r7917  
    1111
    1212  if (argc != 4) {
    13     fprintf (stderr, "USAGE: imfit <x> <y> <dy>\n");
     13    gprint (GP_ERR, "USAGE: imfit <x> <y> <dy>\n");
    1414    return (FALSE);
    1515  }
     
    3737
    3838    chisq = mrqmin (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fgaussOD);
    39     fprintf (stderr, "chisq: %f, %f %f %f %f\n", chisq, par[0], par[1], par[2], par[3]);
     39    gprint (GP_ERR, "chisq: %f, %f %f %f %f\n", chisq, par[0], par[1], par[2], par[3]);
    4040
    4141  } 
     
    4444
    4545  for (i = 0; i < Npar; i++) {
    46     fprintf (stderr, "%d  %f  %f\n", i, par[i], covar[i][i]);
     46    gprint (GP_ERR, "%d  %f  %f\n", i, par[i], covar[i][i]);
    4747  }
    4848
     
    128128
    129129  if (argc != 6) {
    130     fprintf (stderr, "USAGE: imfit <buffer> sx sy nx ny\n");
     130    gprint (GP_ERR, "USAGE: imfit <buffer> sx sy nx ny\n");
    131131    return (FALSE);
    132132  }
     
    143143      (sx+nx > buffers[Nbuf].matrix.Naxis[0]) ||
    144144      (sy+ny > buffers[Nbuf].matrix.Naxis[1])) {
    145     fprintf (stderr, "region out of range\n");
     145    gprint (GP_ERR, "region out of range\n");
    146146    return (FALSE);
    147147  }
  • trunk/Ohana/src/opihi/cmd.astro/transform.c

    r3404 r7917  
    1414
    1515  if (argc != 3) {
    16     fprintf (stderr, "USAGE: transform <from> <to>\n");
     16    gprint (GP_ERR, "USAGE: transform <from> <to>\n");
    1717    return (FALSE);
    1818  }
     
    2626  /* for the moment, disable WRP / DIS */
    2727  if (!strcmp(&coords_in.ctype[4], "-WRP") || !strcmp(&coords_out.ctype[4], "-WRP")) {
    28     fprintf (stderr, "WRP mode not implemented for astrom\n");
     28    gprint (GP_ERR, "WRP mode not implemented for astrom\n");
    2929    return (FALSE);
    3030  }
     
    4646
    4747  for (j = 0; j < in[0].header.Naxis[1]; j++) {
    48     fprintf (stderr, ".");
     48    gprint (GP_ERR, ".");
    4949    for (i = 0; i < in[0].header.Naxis[0]; i++, Vin++) {
    5050      for (dx = 0.0 + 0.5*frac; dx < 1.0 - 0.5*frac; dx += frac) {
  • trunk/Ohana/src/opihi/cmd.astro/warp.c

    r7039 r7917  
    2727
    2828  if (argc != 5) {
    29     fprintf (stderr, "USAGE: transform <from> <to> <weight> (Nlinear)\n");
    30     fprintf (stderr, "  output buffer must exist with target astrometry header\n");
    31     fprintf (stderr, "  Nlinear is the pixel scale for linear astrometric transformation\n");
     29    gprint (GP_ERR, "USAGE: transform <from> <to> <weight> (Nlinear)\n");
     30    gprint (GP_ERR, "  output buffer must exist with target astrometry header\n");
     31    gprint (GP_ERR, "  Nlinear is the pixel scale for linear astrometric transformation\n");
    3232    return (FALSE);
    3333  }
     
    4343  /* for the moment, disable WRP / DIS */
    4444  if (!strcmp(&coords_in.ctype[4], "-WRP") || !strcmp(&coords_out.ctype[4], "-WRP")) {
    45     fprintf (stderr, "WRP mode not implemented for astrom\n");
     45    gprint (GP_ERR, "WRP mode not implemented for astrom\n");
    4646    return (FALSE);
    4747  }
     
    5050  scale_out = sqrt(fabs(coords_out.cdelt1*coords_out.cdelt2*(coords_out.pc1_1*coords_out.pc2_2 - coords_out.pc1_2*coords_out.pc2_1)));
    5151 
    52   fprintf (stderr, "%f - %f\n", scale_in, scale_out);
     52  gprint (GP_ERR, "%f - %f\n", scale_in, scale_out);
    5353
    5454  if (scale_in > scale_out) {
Note: See TracChangeset for help on using the changeset viewer.