Changeset 7917 for trunk/Ohana/src/opihi/cmd.astro
- Timestamp:
- Jul 16, 2006, 10:58:49 PM (20 years ago)
- Location:
- trunk/Ohana/src/opihi/cmd.astro
- Files:
-
- 33 edited
-
biassub.c (modified) (3 diffs)
-
cgrid.c (modified) (1 diff)
-
coords.c (modified) (4 diffs)
-
cplot.c (modified) (2 diffs)
-
csystem.c (modified) (5 diffs)
-
ctimes.c (modified) (4 diffs)
-
cval.c (modified) (3 diffs)
-
czplot.c (modified) (2 diffs)
-
drizzle.c (modified) (3 diffs)
-
fixwrap.c (modified) (1 diff)
-
flux.c (modified) (4 diffs)
-
gauss.c (modified) (1 diff)
-
getvel.c (modified) (6 diffs)
-
imfit.c (modified) (4 diffs)
-
imsub.c (modified) (3 diffs)
-
medianmap.c (modified) (1 diff)
-
mkgauss.c (modified) (1 diff)
-
multifit.c (modified) (2 diffs)
-
objload.c (modified) (3 diffs)
-
outline.c (modified) (5 diffs)
-
outline2.c (modified) (4 diffs)
-
polar.c (modified) (2 diffs)
-
precess.c (modified) (4 diffs)
-
profile.c (modified) (2 diffs)
-
region.c (modified) (1 diff)
-
rotcurve.c (modified) (4 diffs)
-
scale.c (modified) (2 diffs)
-
sexigesimal.c (modified) (4 diffs)
-
spec.c (modified) (3 diffs)
-
star.c (modified) (1 diff)
-
testfit.c (modified) (5 diffs)
-
transform.c (modified) (3 diffs)
-
warp.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/biassub.c
r4689 r7917 21 21 22 22 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"); 25 25 return (FALSE); 26 26 } … … 33 33 dir = atof (argv[6]); 34 34 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"); 36 36 return (FALSE); 37 37 } … … 45 45 nlong = nx; 46 46 } 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); 48 48 49 49 if ((sx < 0) || (sy < 0) || 50 50 (sx+nx > buf[0].matrix.Naxis[0]) || 51 51 (sy+ny > buf[0].matrix.Naxis[1])) { 52 fprintf (stderr, "region out of range\n");52 gprint (GP_ERR, "region out of range\n"); 53 53 return (FALSE); 54 54 } -
trunk/Ohana/src/opihi/cmd.astro/cgrid.c
r7080 r7917 20 20 21 21 if (argc != 1) { 22 fprintf (stderr, "USAGE: cgrid [style]\n");22 gprint (GP_ERR, "USAGE: cgrid [style]\n"); 23 23 return (FALSE); 24 24 } -
trunk/Ohana/src/opihi/cmd.astro/coords.c
r3460 r7917 43 43 if (!strcmp(&coords.ctype[4], "-WRP")) { 44 44 if (MOSAIC == NULL) { 45 fprintf (stderr, "must supply mosaic for WRP coords\n");45 gprint (GP_ERR, "must supply mosaic for WRP coords\n"); 46 46 return (FALSE); 47 47 } … … 53 53 if (mode == SKY) { 54 54 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); 56 56 set_variable ("RA", R); 57 57 set_variable ("DEC", D); … … 61 61 if (mode == PIXEL) { 62 62 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); 64 64 set_variable ("Xc", X); 65 65 set_variable ("Yc", Y); … … 69 69 70 70 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"); 73 73 escape: 74 74 if (MOSAIC != NULL) free (MOSAIC); -
trunk/Ohana/src/opihi/cmd.astro/cplot.c
r7391 r7917 11 11 12 12 if (argc != 3) { 13 fprintf (stderr, "USAGE: cplot <ra> <dec> [style]\n");13 gprint (GP_ERR, "USAGE: cplot <ra> <dec> [style]\n"); 14 14 return (FALSE); 15 15 } … … 24 24 25 25 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"); 27 27 return (FALSE); 28 28 } -
trunk/Ohana/src/opihi/cmd.astro/csystem.c
r2598 r7917 13 13 14 14 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"); 16 16 return (FALSE); 17 17 } … … 22 22 switch (argv[2][0]) { 23 23 case 'C': 24 fprintf (stderr, "same coordinate system\n");24 gprint (GP_ERR, "same coordinate system\n"); 25 25 return (TRUE); 26 26 break; … … 51 51 break; 52 52 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"); 54 54 return (FALSE); 55 55 phi = -62.6*RAD_DEG; … … 73 73 break; 74 74 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"); 76 76 return (FALSE); 77 77 gettimeofday (&now, (struct timezone *) NULL); … … 91 91 92 92 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]); 94 94 return (FALSE); 95 95 } -
trunk/Ohana/src/opihi/cmd.astro/ctimes.c
r2843 r7917 16 16 17 17 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"); 19 19 return (FALSE); 20 20 } … … 35 35 free (Variable); 36 36 } else { 37 fprintf (stderr, "time: %s\n", date);37 gprint (GP_ERR, "time: %s\n", date); 38 38 } 39 39 … … 44 44 45 45 if (strcmp (argv[1], "-abs")) { 46 fprintf (stderr, "syntax error\n");46 gprint (GP_ERR, "syntax error\n"); 47 47 return (FALSE); 48 48 } 49 49 50 50 if (!str_to_time (argv[2], &time)) { 51 fprintf (stderr, "syntax error\n");51 gprint (GP_ERR, "syntax error\n"); 52 52 return (FALSE); 53 53 } … … 60 60 return (TRUE); 61 61 } 62 fprintf (stderr, "time: %f\n", value);62 gprint (GP_ERR, "time: %f\n", value); 63 63 return (TRUE); 64 64 } -
trunk/Ohana/src/opihi/cmd.astro/cval.c
r2598 r7917 9 9 10 10 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"); 12 12 return (FALSE); 13 13 } … … 28 28 (sx+nx > buf[0].matrix.Naxis[0]) || 29 29 (sy+ny > buf[0].matrix.Naxis[1])) { 30 fprintf (stderr, "region out of range\n");30 gprint (GP_ERR, "region out of range\n"); 31 31 return (FALSE); 32 32 } … … 45 45 } 46 46 47 fprintf (stderr, "cval: %f sn: %f\n", cval, sqrt(sn));47 gprint (GP_ERR, "cval: %f sn: %f\n", cval, sqrt(sn)); 48 48 49 49 return (TRUE); -
trunk/Ohana/src/opihi/cmd.astro/czplot.c
r7080 r7917 12 12 13 13 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"); 15 15 return (FALSE); 16 16 } … … 28 28 29 29 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]); 31 31 return (FALSE); 32 32 } 33 33 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]); 35 35 return (FALSE); 36 36 } -
trunk/Ohana/src/opihi/cmd.astro/drizzle.c
r4689 r7917 27 27 28 28 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"); 32 32 return (FALSE); 33 33 } … … 43 43 /* for the moment, disable WRP / DIS */ 44 44 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"); 46 46 return (FALSE); 47 47 } … … 50 50 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))); 51 51 52 fprintf (stderr, "%f - %f\n", scale_in, scale_out);52 gprint (GP_ERR, "%f - %f\n", scale_in, scale_out); 53 53 54 54 if (scale_in > scale_out) { -
trunk/Ohana/src/opihi/cmd.astro/fixwrap.c
r6678 r7917 8 8 9 9 if (argc != 3) { 10 fprintf (stderr, "USAGE: fixwrap <in> (rowfix)\n");10 gprint (GP_ERR, "USAGE: fixwrap <in> (rowfix)\n"); 11 11 return (FALSE); 12 12 } -
trunk/Ohana/src/opihi/cmd.astro/flux.c
r2843 r7917 12 12 13 13 if (argc != 3) { 14 fprintf (stderr, "USAGE: flux <buffer> (region)\n");14 gprint (GP_ERR, "USAGE: flux <buffer> (region)\n"); 15 15 return (FALSE); 16 16 } … … 20 20 f = fopen (argv[2], "r"); 21 21 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]); 23 23 return (FALSE); 24 24 } … … 46 46 bb[i] = hypot (bx[i], by[i]) * SIGN (bx[i]*by[i+1] - bx[i+1]*by[i]); 47 47 } 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]); 49 49 50 50 /* this only works for convex contours -- … … 70 70 signal (SIGINT, oldsignal); 71 71 72 fprintf (GetOutfile(), "flux: %f\n", flux);72 gprint (GP_LOG, "flux: %f\n", flux); 73 73 set_variable ("FLUX", flux); 74 74 return (TRUE); -
trunk/Ohana/src/opihi/cmd.astro/gauss.c
r5850 r7917 33 33 34 34 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"); 36 36 return (FALSE); 37 37 } 38 38 39 39 if (Ximage < 1) { 40 fprintf (stderr, "no active TV\n");40 gprint (GP_ERR, "no active TV\n"); 41 41 return (FALSE); 42 42 } -
trunk/Ohana/src/opihi/cmd.astro/getvel.c
r7080 r7917 13 13 14 14 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"); 16 16 return (FALSE); 17 17 } … … 19 19 f = fopen (argv[4], "r"); 20 20 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]); 22 22 return (FALSE); 23 23 } … … 45 45 while (L >= 360) {L -= 360.0;} 46 46 while (L < 0.0) {L += 360.0;} 47 fprintf (stderr, "L: %f\n", L);47 gprint (GP_ERR, "L: %f\n", L); 48 48 49 49 cl = cos (L*RAD_DEG); … … 59 59 for (n = 0; (n < Ncurve) && (wr < W[n]); n++); 60 60 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]); 63 63 return (TRUE); 64 64 } … … 66 66 fr = (Ro/r); 67 67 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); 70 70 return (TRUE); 71 71 } … … 75 75 d = Ro*cl + sqrt(r*r - Rs*Rs); 76 76 77 fprintf (stderr, "dist: %f, vel: %f\n", d, V);77 gprint (GP_ERR, "dist: %f, vel: %f\n", d, V); 78 78 79 79 return (TRUE); -
trunk/Ohana/src/opihi/cmd.astro/imfit.c
r4689 r7917 65 65 qrgauss_setup (argv[N]); 66 66 if (fitfunc == NULL) { 67 fprintf (stderr, "unknown function %s\n", argv[N]);67 gprint (GP_ERR, "unknown function %s\n", argv[N]); 68 68 return (FALSE); 69 69 } … … 72 72 73 73 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"); 75 75 return (FALSE); 76 76 } … … 170 170 if (VERBOSE) { 171 171 for (i = 0; i < Npar; i++) { 172 fprintf (stderr, "%g ", par[i]);172 gprint (GP_ERR, "%g ", par[i]); 173 173 } 174 fprintf (stderr, "\n");174 gprint (GP_ERR, "\n"); 175 175 } 176 176 … … 186 186 187 187 range: 188 fprintf (stderr, "region out of range\n");188 gprint (GP_ERR, "region out of range\n"); 189 189 return (FALSE); 190 190 } -
trunk/Ohana/src/opihi/cmd.astro/imsub.c
r3144 r7917 30 30 qrgauss_setup (argv[N]); 31 31 if (fitfunc == NULL) { 32 fprintf (stderr, "unknown function %s\n", argv[N]);32 gprint (GP_ERR, "unknown function %s\n", argv[N]); 33 33 return (FALSE); 34 34 } … … 37 37 38 38 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"); 40 40 return (FALSE); 41 41 } … … 74 74 75 75 range: 76 fprintf (stderr, "region out of range\n");76 gprint (GP_ERR, "region out of range\n"); 77 77 return (FALSE); 78 78 } -
trunk/Ohana/src/opihi/cmd.astro/medianmap.c
r7080 r7917 31 31 32 32 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"); 36 36 return (FALSE); 37 37 } -
trunk/Ohana/src/opihi/cmd.astro/mkgauss.c
r2843 r7917 21 21 22 22 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"); 24 24 return (FALSE); 25 25 } -
trunk/Ohana/src/opihi/cmd.astro/multifit.c
r2598 r7917 11 11 12 12 if (argc != 2) { 13 fprintf (stderr, "USAGE: multifit (Norder)\n");13 gprint (GP_ERR, "USAGE: multifit (Norder)\n"); 14 14 return (FALSE); 15 15 } … … 170 170 171 171 escape: 172 fprintf (stderr, "syntax error\n");172 gprint (GP_ERR, "syntax error\n"); 173 173 return (FALSE); 174 174 -
trunk/Ohana/src/opihi/cmd.astro/objload.c
r7680 r7917 27 27 28 28 if (argc != 3) { 29 fprintf (stderr, "USAGE: objload (overlay) <filename>\n");29 gprint (GP_ERR, "USAGE: objload (overlay) <filename>\n"); 30 30 return (FALSE); 31 31 } … … 33 33 f = fopen (argv[2], "r"); 34 34 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]); 36 36 return (FALSE); 37 37 } … … 69 69 free (line); 70 70 71 fprintf (stderr, "loaded %d objects\n", Noverlay);71 gprint (GP_ERR, "loaded %d objects\n", Noverlay); 72 72 return (TRUE); 73 73 } -
trunk/Ohana/src/opihi/cmd.astro/outline.c
r5846 r7917 14 14 15 15 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"); 17 17 return (FALSE); 18 18 } … … 43 43 44 44 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); 46 46 47 47 for (j = 0; j < 15; j++) { … … 63 63 chisq = nchisq; 64 64 } 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); 66 66 } 67 67 } … … 112 112 } 113 113 /* 114 fprintf (stderr, "try: %d %f ", i, chisq);114 gprint (GP_ERR, "try: %d %f ", i, chisq); 115 115 for (k = 0; k < 5; k++) { 116 fprintf (stderr, "%f ", par[k]);116 gprint (GP_ERR, "%f ", par[k]); 117 117 } 118 fprintf (stderr, "\n");118 gprint (GP_ERR, "\n"); 119 119 */ 120 120 ochisq = chisq; … … 130 130 } 131 131 132 fprintf (stderr, "try: %d %f ", j, chisq);132 gprint (GP_ERR, "try: %d %f ", j, chisq); 133 133 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 "); 137 137 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"); 141 141 dchi -= chisq; 142 142 -
trunk/Ohana/src/opihi/cmd.astro/outline2.c
r5846 r7917 18 18 19 19 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"); 21 21 return (FALSE); 22 22 } … … 78 78 79 79 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"); 81 81 free (xs); 82 82 free (ys); … … 87 87 plot_outline (); 88 88 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); 90 90 91 91 # if (1) … … 139 139 } 140 140 141 fprintf (stderr, "try: %d %f ", j, chisq);141 gprint (GP_ERR, "try: %d %f ", j, chisq); 142 142 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 "); 146 146 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"); 150 150 dchi -= chisq; 151 151 -
trunk/Ohana/src/opihi/cmd.astro/polar.c
r7080 r7917 12 12 13 13 if (argc != 4) { 14 fprintf (stderr, "USAGE: polar in out\n");14 gprint (GP_ERR, "USAGE: polar in out\n"); 15 15 return (FALSE); 16 16 } … … 25 25 ny = mask[0].matrix.Naxis[1]; 26 26 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"); 28 28 return (FALSE); 29 29 } -
trunk/Ohana/src/opihi/cmd.astro/precess.c
r2598 r7917 15 15 in_epoch = out_epoch = 2000.0; 16 16 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"); 19 19 return (FALSE); 20 20 } … … 56 56 } 57 57 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); 59 59 60 60 T = (out_epoch - in_epoch) / 100.0; … … 77 77 if (RA < 0) 78 78 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); 80 80 return (TRUE); 81 81 } … … 86 86 87 87 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]); 89 89 return (FALSE); 90 90 } -
trunk/Ohana/src/opihi/cmd.astro/profile.c
r2598 r7917 10 10 11 11 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"); 13 13 return (FALSE); 14 14 } … … 47 47 48 48 range_error: 49 fprintf (stderr, "region out of range\n");49 gprint (GP_ERR, "region out of range\n"); 50 50 return (FALSE); 51 51 } -
trunk/Ohana/src/opihi/cmd.astro/region.c
r5850 r7917 33 33 34 34 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", 37 37 graphmode.coords.crval1, graphmode.coords.crval2, 38 38 fabs(graphmode.xmax - graphmode.xmin), -
trunk/Ohana/src/opihi/cmd.astro/rotcurve.c
r7080 r7917 21 21 22 22 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"); 24 24 return (FALSE); 25 25 } … … 27 27 f = fopen (argv[4], "r"); 28 28 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]); 30 30 return (FALSE); 31 31 } … … 45 45 ny = mask[0].matrix.Naxis[1]; 46 46 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"); 48 48 return (FALSE); 49 49 } … … 74 74 X = (L - Lo) / dL + Xo; 75 75 if ((X >= Nx) || (X < 0)) { 76 fprintf (stderr, "X out of range\n");76 gprint (GP_ERR, "X out of range\n"); 77 77 return (FALSE); 78 78 } 79 fprintf (stderr, "L: %f (%d)\n", L, X);79 gprint (GP_ERR, "L: %f (%d)\n", L, X); 80 80 81 81 cl = cos (L*RAD_DEG); -
trunk/Ohana/src/opihi/cmd.astro/scale.c
r2598 r7917 6 6 7 7 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"); 9 9 return (FALSE); 10 10 } … … 13 13 14 14 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"); 16 16 return (FALSE); 17 17 } 18 18 19 19 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"); 21 21 return (FALSE); 22 22 } -
trunk/Ohana/src/opihi/cmd.astro/sexigesimal.c
r2843 r7917 18 18 19 19 if ((argc != 3) && (argc != 2)) { 20 fprintf (stderr, "USAGE: sexigesimal (from) [to]\n");20 gprint (GP_ERR, "USAGE: sexigesimal (from) [to]\n"); 21 21 return (FALSE); 22 22 } … … 24 24 if (HMS) { 25 25 if (!dms_to_ddd (&value, argv[1])) { 26 fprintf (stderr, "syntax error in input\n");26 gprint (GP_ERR, "syntax error in input\n"); 27 27 return (FALSE); 28 28 } … … 30 30 set_variable (argv[2], value); 31 31 } else { 32 fprintf (GetOutfile(), "%10.6f\n", value);32 gprint (GP_LOG, "%10.6f\n", value); 33 33 } 34 34 return (TRUE); … … 39 39 set_str_variable (argv[2], string); 40 40 } else { 41 fprintf (GetOutfile(), "%s\n", string);41 gprint (GP_LOG, "%s\n", string); 42 42 } 43 43 return (TRUE); -
trunk/Ohana/src/opihi/cmd.astro/spec.c
r4689 r7917 34 34 35 35 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"); 37 37 return (FALSE); 38 38 } 39 39 40 40 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"); 42 42 return (FALSE); 43 43 } … … 79 79 } 80 80 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); 82 82 /* X1 = MAX (MIN (X1, Xo + 0.5+Ngap), Xo - 0.5+Ngap); */ 83 83 V = (float *) (buf[0].matrix.buffer) + Nx*(y1 + j) + X1 - (int)(0.5*Nlong); … … 105 105 xvec[0].elements[j] = j + y1; 106 106 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)); 108 108 } 109 109 -
trunk/Ohana/src/opihi/cmd.astro/star.c
r2843 r7917 23 23 24 24 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"); 26 26 return (FALSE); 27 27 } -
trunk/Ohana/src/opihi/cmd.astro/testfit.c
r2598 r7917 11 11 12 12 if (argc != 4) { 13 fprintf (stderr, "USAGE: imfit <x> <y> <dy>\n");13 gprint (GP_ERR, "USAGE: imfit <x> <y> <dy>\n"); 14 14 return (FALSE); 15 15 } … … 37 37 38 38 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]); 40 40 41 41 } … … 44 44 45 45 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]); 47 47 } 48 48 … … 128 128 129 129 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"); 131 131 return (FALSE); 132 132 } … … 143 143 (sx+nx > buffers[Nbuf].matrix.Naxis[0]) || 144 144 (sy+ny > buffers[Nbuf].matrix.Naxis[1])) { 145 fprintf (stderr, "region out of range\n");145 gprint (GP_ERR, "region out of range\n"); 146 146 return (FALSE); 147 147 } -
trunk/Ohana/src/opihi/cmd.astro/transform.c
r3404 r7917 14 14 15 15 if (argc != 3) { 16 fprintf (stderr, "USAGE: transform <from> <to>\n");16 gprint (GP_ERR, "USAGE: transform <from> <to>\n"); 17 17 return (FALSE); 18 18 } … … 26 26 /* for the moment, disable WRP / DIS */ 27 27 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"); 29 29 return (FALSE); 30 30 } … … 46 46 47 47 for (j = 0; j < in[0].header.Naxis[1]; j++) { 48 fprintf (stderr, ".");48 gprint (GP_ERR, "."); 49 49 for (i = 0; i < in[0].header.Naxis[0]; i++, Vin++) { 50 50 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 27 27 28 28 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"); 32 32 return (FALSE); 33 33 } … … 43 43 /* for the moment, disable WRP / DIS */ 44 44 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"); 46 46 return (FALSE); 47 47 } … … 50 50 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))); 51 51 52 fprintf (stderr, "%f - %f\n", scale_in, scale_out);52 gprint (GP_ERR, "%f - %f\n", scale_in, scale_out); 53 53 54 54 if (scale_in > scale_out) {
Note:
See TracChangeset
for help on using the changeset viewer.
