Permalink
Browse files

heatmap: up/downconverters

  • Loading branch information...
keenerd committed Aug 4, 2014
1 parent 92a8da6 commit 7e94d7d00efc5cf9389df504464bd3831f2479d3
Showing with 8 additions and 6 deletions.
  1. +8 −6 heatmap/heatmap.py
View
@@ -7,11 +7,9 @@
# todo:
# matplotlib powered --interactive
# longer than 24 hours stuff
# arbitrary freq marker spacing
# pksato's timestamps
# ppm
# converter shift
# blue-less marker grid
# fast summary thing
# time-based slicing
@@ -22,6 +20,8 @@
help='Input CSV file. (may be a .csv.gz)')
parser.add_argument('output_path', metavar='OUTPUT', type=str,
help='Output image. (various extensions supported)')
parser.add_argument('--offset', dest='offset_freq', default=0,
help='Shift the entire frequency range, for up/down converters.')
slicegroup = parser.add_argument_group('Slicing',
'Efficiently render a portion of the data. (optional)')
slicegroup.add_argument('--low', dest='low_freq', default=None,
@@ -98,6 +98,8 @@ def gzip_wrap(path):
args.low_freq = freq_parse(args.low_freq)
if args.high_freq is not None:
args.high_freq = freq_parse(args.high_freq)
if args.offset_freq is not None:
args.offset_freq = freq_parse(args.offset_freq)
print("loading")
@@ -125,8 +127,8 @@ def parse_time(t):
#line = [line[0], line[1]] + [float(s) for s in line[2:] if s]
line = [s for s in line if s]
low = int(line[2])
high = int(line[3])
low = int(line[2]) + args.offset_freq
high = int(line[3]) + args.offset_freq
step = float(line[4])
if args.low_freq is not None and high < args.low_freq:
continue
@@ -188,8 +190,8 @@ def rgb3(z):
if t not in times:
continue # happens with live files
y = times.index(t)
low = int(line[2])
high = int(line[3])
low = int(line[2]) + args.offset_freq
high = int(line[3]) + args.offset_freq
step = float(line[4])
columns = list(frange(low, high, step))
start_col, stop_col = slice_columns(columns, args.low_freq, args.high_freq)

0 comments on commit 7e94d7d

Please sign in to comment.