|
7 | 7 |
|
8 | 8 | # todo: |
9 | 9 | # matplotlib powered --interactive |
10 | | -# longer than 24 hours stuff |
11 | 10 | # arbitrary freq marker spacing |
12 | 11 | # pksato's timestamps |
13 | 12 | # ppm |
14 | | -# converter shift |
15 | 13 | # blue-less marker grid |
16 | 14 | # fast summary thing |
17 | 15 | # time-based slicing |
|
22 | 20 | help='Input CSV file. (may be a .csv.gz)') |
23 | 21 | parser.add_argument('output_path', metavar='OUTPUT', type=str, |
24 | 22 | help='Output image. (various extensions supported)') |
| 23 | +parser.add_argument('--offset', dest='offset_freq', default=0, |
| 24 | + help='Shift the entire frequency range, for up/down converters.') |
25 | 25 | slicegroup = parser.add_argument_group('Slicing', |
26 | 26 | 'Efficiently render a portion of the data. (optional)') |
27 | 27 | slicegroup.add_argument('--low', dest='low_freq', default=None, |
@@ -98,6 +98,8 @@ def gzip_wrap(path): |
98 | 98 | args.low_freq = freq_parse(args.low_freq) |
99 | 99 | if args.high_freq is not None: |
100 | 100 | args.high_freq = freq_parse(args.high_freq) |
| 101 | +if args.offset_freq is not None: |
| 102 | + args.offset_freq = freq_parse(args.offset_freq) |
101 | 103 |
|
102 | 104 | print("loading") |
103 | 105 |
|
@@ -125,8 +127,8 @@ def parse_time(t): |
125 | 127 | #line = [line[0], line[1]] + [float(s) for s in line[2:] if s] |
126 | 128 | line = [s for s in line if s] |
127 | 129 |
|
128 | | - low = int(line[2]) |
129 | | - high = int(line[3]) |
| 130 | + low = int(line[2]) + args.offset_freq |
| 131 | + high = int(line[3]) + args.offset_freq |
130 | 132 | step = float(line[4]) |
131 | 133 | if args.low_freq is not None and high < args.low_freq: |
132 | 134 | continue |
@@ -188,8 +190,8 @@ def rgb3(z): |
188 | 190 | if t not in times: |
189 | 191 | continue # happens with live files |
190 | 192 | y = times.index(t) |
191 | | - low = int(line[2]) |
192 | | - high = int(line[3]) |
| 193 | + low = int(line[2]) + args.offset_freq |
| 194 | + high = int(line[3]) + args.offset_freq |
193 | 195 | step = float(line[4]) |
194 | 196 | columns = list(frange(low, high, step)) |
195 | 197 | start_col, stop_col = slice_columns(columns, args.low_freq, args.high_freq) |
|
0 commit comments