Changeset 32632 for trunk/Ohana/src/opihi/cmd.data
- Timestamp:
- Nov 8, 2011, 2:54:20 PM (15 years ago)
- Location:
- trunk/Ohana/src/opihi/cmd.data
- Files:
-
- 2 edited
-
read_vectors.c (modified) (5 diffs)
-
vstats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/read_vectors.c
r31667 r32632 23 23 int read_vectors (int argc, char **argv) { 24 24 25 int i, j, Nskip, Nvec, *col, done, status, IsCSV;25 int i, j, Nskip, Nvec, *col, done, status, IsCSV, VERBOSE; 26 26 int Nbytes, nbytes, Nstart, NELEM, N, nread; 27 27 char *colstr, *c0, *c1, *buffer, *extname; … … 51 51 remove_argument (N, &argc, argv); 52 52 IsCSV = TRUE; 53 } 54 55 VERBOSE = FALSE; 56 if ((N = get_argument (argc, argv, "-v"))) { 57 remove_argument (N, &argc, argv); 58 VERBOSE = TRUE; 53 59 } 54 60 … … 121 127 scan_line (f, buffer); 122 128 } 123 124 int Nfield = 0;125 int Nline = 0;126 129 127 130 Nstart = 0; … … 157 160 status = dparse (&value, col[i], c0); 158 161 } 159 vec[i][0].elements.Flt[N] = value;160 162 if (status) { 161 Nfield ++; 163 vec[i][0].elements.Flt[N] = value; 164 } else { 165 vec[i][0].elements.Flt[N] = NAN; 166 if (VERBOSE) { 167 if (IsCSV) { 168 gprint (GP_ERR, "suspect field: %d (%s) in %s\n", col[i], argv[2*i+2], c0); 169 } else { 170 gprint (GP_ERR, "suspect field: %d in %s\n", col[i], c0); 171 } 172 } 162 173 } 163 if (!status) vec[i][0].elements.Flt[N] = NAN; 164 } 165 if (status) N++; 166 } 167 Nline ++; 168 if (c1) { 169 // fprintf (stderr, "line %d, chars %ld, fields %d\n", Nline, (c1 - c0), Nfield); 170 } 171 Nfield = 0; 174 } 175 if (status) { 176 N++; 177 } else { 178 if (VERBOSE && FALSE) { 179 char temp[32]; 180 strncpy (temp, c0, 32); 181 temp[31] = 0; 182 gprint (GP_ERR, "skip line %s\n\n", temp); 183 } 184 } 185 } 172 186 c0 = c1 + 1; 173 187 if (N == NELEM) { … … 177 191 } 178 192 } 179 180 193 } 181 194 } -
trunk/Ohana/src/opihi/cmd.data/vstats.c
r30610 r32632 169 169 170 170 // we are going to do another pass: mark the entries to skip 171 pmin = m ax;172 pmax = m in;171 pmin = min; 172 pmax = max; 173 173 if (iter < Niter - 1) { 174 174 if (vec[0].type == OPIHI_FLT) { … … 208 208 skip: 209 209 FREE(mask); 210 if (mask) mask = NULL; 210 211 211 212 if (!Quiet) {
Note:
See TracChangeset
for help on using the changeset viewer.
