diff options
author | jaseg <git@jaseg.net> | 2018-05-18 11:02:17 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2018-05-18 11:02:17 +0200 |
commit | 4c8cf48c913f763bdb216d88c505958e9eb17a76 (patch) | |
tree | b82e566e4384c1c22d98e16a1fa41982db5718e0 /firmware/measure_spectrum.py | |
parent | bedc614e20b87b783c8420132afc8fd8e478c4bd (diff) | |
download | olsndot-4c8cf48c913f763bdb216d88c505958e9eb17a76.tar.gz olsndot-4c8cf48c913f763bdb216d88c505958e9eb17a76.tar.bz2 olsndot-4c8cf48c913f763bdb216d88c505958e9eb17a76.zip |
Add one more RGB spectrum run
Diffstat (limited to 'firmware/measure_spectrum.py')
-rw-r--r-- | firmware/measure_spectrum.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/firmware/measure_spectrum.py b/firmware/measure_spectrum.py index 47df7b3..70f4e9b 100644 --- a/firmware/measure_spectrum.py +++ b/firmware/measure_spectrum.py @@ -77,19 +77,13 @@ if __name__ == '__main__': bp = BPState(args.port) - run_name = args.run_name - if not str.isnumeric(args.run_name[-1]): - names = [ n[len(run_name):] for n, in db.execute( - 'SELECT name FROM runs WHERE name LIKE ?||"%"', (run_name,)).fetchall() ] - names.append('0') # in case we get no results - run_name += str(1+max(int(n) if str.isnumeric(n) else 0 for n in names)) with db: cur = db.cursor() cur.execute('INSERT INTO runs(name, comment, color, gain, timestamp) VALUES (?, ?, ?, ?, ?)', - (run_name, args.comment, args.color, args.gain*1e6, time.time())) + (args.run_name, args.comment, args.color, args.gain*1e6, time.time())) capture_id = cur.lastrowid - print('Starting run {} "{}" at {:%y-%m-%d %H:%M:%S:%f}'.format(capture_id, run_name, datetime.now())) + print('Starting capture {} "{}" at {:%y-%m-%d %H:%M:%S:%f}'.format(capture_id, args.run_name, datetime.now())) print('[measurement id] " " [step number] " " [reading (V)]') bp.stepper_direction('down') @@ -98,7 +92,7 @@ if __name__ == '__main__': bp.stepper_direction('up') for step in range(0, args.steps+args.skip, args.skip): # Run one skip past end to capture both interval boundaries - for led_val in [0, 1]: + for led_val in [1]: # This can be used for self-calibration. try: bp.led(led_val) time.sleep(args.wait) |