forked from julia-mueller/bioprinter
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexecutor.py
More file actions
36 lines (28 loc) · 1.02 KB
/
Copy pathexecutor.py
File metadata and controls
36 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
# 05.03.2019 Julia Müller
# revised by Anna Jäkel
"""
The Program can be started by typing in the shell:
"python executor.py parameter.yaml".
I made a small change to test!
"""
import numpy as np
import generator as g
import yaml
import sys
import constants
if __name__ == "__main__":
"""
This function produces the outputfile that can be read by the gel-printer.
In addition the volume is calculated which is needed for the print.
"""
if len(sys.argv) < 2:
print(constants.error_message)
else:
filehandle = open(sys.argv[1], "r")
params = yaml.safe_load(filehandle)
params['parameterfile'] = sys.argv[1]
params['liquidparameters'] = [params['flowspeed'], params['nozzle_temp'], params['bed_temp']]
outputfile = g.generate_gcode_file_get_volume(params)
volume = list(np.around(np.array(params['volume_gel']),2))
print(constants.finish_message.format(outputfile, volume))