Changeset 7080 for trunk/Ohana/src/opihi/cmd.astro
- Timestamp:
- May 5, 2006, 5:44:26 PM (20 years ago)
- Location:
- trunk/Ohana/src/opihi/cmd.astro
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/cgrid.c
r2598 r7080 16 16 int NorthPole, SouthPole, N, OnPic, LOnPic, status, NELEMENTS, First; 17 17 Graphdata graphmode; 18 int Ngraph; 19 20 Ngraph = 0; 21 if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE); 18 19 if (!style_args (&graphmode, &argc, argv, 0)) return FALSE; 22 20 23 21 if (argc != 1) { 24 fprintf (stderr, "USAGE: cgrid \n");22 fprintf (stderr, "USAGE: cgrid [style]\n"); 25 23 return (FALSE); 26 24 } 25 SetGraph (graphmode); 27 26 28 27 /* are we plotting one of the poles? */ -
trunk/Ohana/src/opihi/cmd.astro/cplot.c
r2598 r7080 3 3 int cplot (int argc, char **argv) { 4 4 5 int i, Npts , Ngraph;5 int i, Npts; 6 6 float *x, *y, *r, *d, Rmin, Rmax; 7 7 Vector Xvec, Yvec, *xvec, *yvec; 8 8 Graphdata graphmode; 9 9 10 if (!style_args (&graphmode, &argc, argv, 0)) return FALSE; 11 10 12 if (argc != 3) { 11 fprintf (stderr, "USAGE: cplot <ra> <dec> \n");13 fprintf (stderr, "USAGE: cplot <ra> <dec> [style]\n"); 12 14 return (FALSE); 13 15 } 14 15 Ngraph = 0; 16 if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE); 16 SetGraph (graphmode); 17 17 18 18 Rmin = graphmode.coords.crval1 - 182.0; … … 45 45 } 46 46 47 48 47 Npts = Xvec.Nelements; 49 48 graphmode.etype = 0; … … 56 55 57 56 return (TRUE); 58 59 57 } 60 58 -
trunk/Ohana/src/opihi/cmd.astro/czplot.c
r2843 r7080 3 3 int czplot (int argc, char **argv) { 4 4 5 int i, N , Npts, Ngraph;5 int i, Npts; 6 6 double min, range, Rmin, Rmax; 7 7 float *in, *out, *r, *d, *x, *y; … … 9 9 Graphdata graphmode; 10 10 11 Ngraph = -1; 12 if ((N = get_argument (argc, argv, "-n"))) { 13 remove_argument (N, &argc, argv); 14 Ngraph = atof (argv[N]); 15 remove_argument (N, &argc, argv); 16 } 17 if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE); 11 if (!style_args (&graphmode, &argc, argv, 0)) return FALSE; 18 12 19 13 if (argc != 6) { … … 21 15 return (FALSE); 22 16 } 17 SetGraph (graphmode); 23 18 24 19 min = atof(argv[4]); -
trunk/Ohana/src/opihi/cmd.astro/getvel.c
r4689 r7080 33 33 34 34 /* we expect the input image to have units of velocity, lattitude, and longitude */ 35 fits_scan (&buf[0].header, "CRVAL1", "%lf", 1, &Vo);36 fits_scan (&buf[0].header, "CDELT1", "%lf", 1, &dV);37 fits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &xo);38 fits_scan (&buf[0].header, "CRVAL2", "%lf", 1, &Bo);39 fits_scan (&buf[0].header, "CDELT2", "%lf", 1, &dB);40 fits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &yo);41 fits_scan (&buf[0].header, "CRVAL3", "%lf", 1, &L);35 gfits_scan (&buf[0].header, "CRVAL1", "%lf", 1, &Vo); 36 gfits_scan (&buf[0].header, "CDELT1", "%lf", 1, &dV); 37 gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &xo); 38 gfits_scan (&buf[0].header, "CRVAL2", "%lf", 1, &Bo); 39 gfits_scan (&buf[0].header, "CDELT2", "%lf", 1, &dB); 40 gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &yo); 41 gfits_scan (&buf[0].header, "CRVAL3", "%lf", 1, &L); 42 42 Vo *= 0.001; 43 43 dV *= 0.001; -
trunk/Ohana/src/opihi/cmd.astro/medianmap.c
r4689 r7080 47 47 /* duplicate the (in) buffer to the (out), with different size */ 48 48 /* this should probably be a function in misc */ 49 fits_free_matrix (&out[0].matrix);50 fits_free_header (&out[0].header);49 gfits_free_matrix (&out[0].matrix); 50 gfits_free_header (&out[0].header); 51 51 out[0].bitpix = in[0].bitpix; 52 52 out[0].unsign = in[0].unsign; 53 53 out[0].bscale = in[0].bscale; 54 54 out[0].bzero = in[0].bzero; 55 fits_copy_header (&in[0].header, &out[0].header);56 fits_modify (&out[0].header, "NAXIS1", "%d", 1, Nx);57 fits_modify (&out[0].header, "NAXIS2", "%d", 1, Ny);55 gfits_copy_header (&in[0].header, &out[0].header); 56 gfits_modify (&out[0].header, "NAXIS1", "%d", 1, Nx); 57 gfits_modify (&out[0].header, "NAXIS2", "%d", 1, Ny); 58 58 out[0].header.Naxis[0] = Nx; 59 59 out[0].header.Naxis[1] = Ny; 60 fits_create_matrix (&out[0].header, &out[0].matrix);60 gfits_create_matrix (&out[0].header, &out[0].matrix); 61 61 62 62 In = (float *) in[0].matrix.buffer; -
trunk/Ohana/src/opihi/cmd.astro/polar.c
r2598 r7080 32 32 33 33 /* we expect the output image to have units of longitude and distance */ 34 fits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Lo);35 fits_scan (&in[0].header, "CDELT1", "%lf", 1, &dL);36 fits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);37 fits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Do);38 fits_scan (&in[0].header, "CDELT2", "%lf", 1, &dD);39 fits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);34 gfits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Lo); 35 gfits_scan (&in[0].header, "CDELT1", "%lf", 1, &dL); 36 gfits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo); 37 gfits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Do); 38 gfits_scan (&in[0].header, "CDELT2", "%lf", 1, &dD); 39 gfits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo); 40 40 41 41 /* we expect the input image to have units of distance X and Y */ 42 fits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Mo);43 fits_scan (&out[0].header, "CDELT1", "%lf", 1, &dM);44 fits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);45 fits_scan (&out[0].header, "CRVAL2", "%lf", 1, &No);46 fits_scan (&out[0].header, "CDELT2", "%lf", 1, &dN);47 fits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);42 gfits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Mo); 43 gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dM); 44 gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo); 45 gfits_scan (&out[0].header, "CRVAL2", "%lf", 1, &No); 46 gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dN); 47 gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo); 48 48 49 49 Vin = (float *)in[0].matrix.buffer; -
trunk/Ohana/src/opihi/cmd.astro/rotcurve.c
r2843 r7080 52 52 53 53 /* we expect the input image to have units of velocity, lattitude, and longitude */ 54 fits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Vo);55 fits_scan (&in[0].header, "CDELT1", "%lf", 1, &dV);56 fits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);57 fits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Bo);58 fits_scan (&in[0].header, "CDELT2", "%lf", 1, &dB);59 fits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);60 fits_scan (&in[0].header, "CRVAL3", "%lf", 1, &L);54 gfits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Vo); 55 gfits_scan (&in[0].header, "CDELT1", "%lf", 1, &dV); 56 gfits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo); 57 gfits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Bo); 58 gfits_scan (&in[0].header, "CDELT2", "%lf", 1, &dB); 59 gfits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo); 60 gfits_scan (&in[0].header, "CRVAL3", "%lf", 1, &L); 61 61 Vo *= 0.001; 62 62 dV *= 0.001; 63 63 64 64 /* we expect the output image to have units of longitude and distance */ 65 fits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Lo);66 fits_scan (&out[0].header, "CDELT1", "%lf", 1, &dL);67 fits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);68 fits_scan (&out[0].header, "CRVAL2", "%lf", 1, &Do);69 fits_scan (&out[0].header, "CDELT2", "%lf", 1, &dD);70 fits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);65 gfits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Lo); 66 gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dL); 67 gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo); 68 gfits_scan (&out[0].header, "CRVAL2", "%lf", 1, &Do); 69 gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dD); 70 gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo); 71 71 72 72 while (L >= 360) {L -= 360.0;}
Note:
See TracChangeset
for help on using the changeset viewer.
