Changeset 31536
- Timestamp:
- May 12, 2011, 9:43:31 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110505/Ohana/src/opihi/cmd.astro/czplot.c
r20936 r31536 3 3 int czplot (int argc, char **argv) { 4 4 5 int i, kapa ;5 int i, kapa, Npts, status; 6 6 double min, range, Rmin, Rmax; 7 7 opihi_flt *out, *r, *d, *x, *y; … … 18 18 min = atof(argv[4]); 19 19 range = atof(argv[5]) - min; 20 Rmin = graphmode.coords.crval1 - 18 0.0;21 Rmax = graphmode.coords.crval1 + 18 0.0;20 Rmin = graphmode.coords.crval1 - 182.0; 21 Rmax = graphmode.coords.crval1 + 182.0; 22 22 23 23 /* find vectors */ … … 46 46 x = Xvec.elements.Flt; 47 47 y = Yvec.elements.Flt; 48 for (i = 0; i < Zvec.Nelements; i++, r++, d++, x++, y++) { 48 out = Zvec.elements.Flt; 49 50 Npts = 0; 51 for (i = 0; i < xvec[0].Nelements; i++, r++, d++) { 49 52 *r = ohana_normalize_angle (*r); 50 RD_to_XY (x, y, *r, *d, &graphmode.coords); 53 while (*r < Rmin) *r += 360.0; 54 while (*r > Rmax) *r -= 360.0; 55 56 status = RD_to_XY (x, y, *r, *d, &graphmode.coords); 57 if (!status) continue; 58 59 if (zvec->type == OPIHI_FLT) { 60 opihi_flt *in = zvec[0].elements.Flt; 61 *out = MIN (1.0, MAX (0.01, (in[i] - min) / range)); 62 } else { 63 opihi_int *in = zvec[0].elements.Int; 64 *out = MIN (1.0, MAX (0.01, (in[i] - min) / range)); 65 } 66 x++; 67 y++; 68 out++; 69 Npts++; 51 70 } 52 53 out = Zvec.elements.Flt; 54 if (zvec->type == OPIHI_FLT) { 55 opihi_flt *in = zvec[0].elements.Flt; 56 for (i = 0; i < Zvec.Nelements; i++, in++, out++) { 57 *out = MIN (1.0, MAX (0.01, (*in - min) / range)); 58 } 59 } else { 60 opihi_int *in = zvec[0].elements.Int; 61 for (i = 0; i < Zvec.Nelements; i++, in++, out++) { 62 *out = MIN (1.0, MAX (0.01, (*in - min) / range)); 63 } 64 } 71 Xvec.Nelements = Npts; 72 Yvec.Nelements = Npts; 73 Zvec.Nelements = Npts; 65 74 66 75 graphmode.style = 2;
Note:
See TracChangeset
for help on using the changeset viewer.
