def TAS_RUN(): result = run_template(template, config) ''' print 'in TAS' for key, value in result.iteritems(): for i in range(len(value['output'])): if not type(value['output'][i])==type({}): value['output'][i] = value['output'][i].get_plottable() print result ''' return result
dict(source=[6, 'output'], target=[1, 'input']), ] config = [d['config'] for d in modules] template = Template(name='test ospec', description='example ospec diagram', modules=modules, wires=wires, instrument=ANDR.id, ) # template and instrument tests # print json.dumps(instrument_to_wireit_language(ANDR), sort_keys=True, indent=2) # print json.dumps(template_to_wireit_diagram(template)) # need name! # sys.exit() result = run_template(template, config) # plot_result = [convert_to_plottable(value['output']) if 'output' in value else {} for key, value in result.items()] print "WRITING TO FILE" for index,plottable in enumerate(result): with open('new_data' + str(index) + '.txt', 'w') as f: for format in plottable.get('output',[]): f.write(format + "\n") print "DONE" sys.exit() # pprint(result) #raw_input("Done looking at formatted output? ") #output of the qxqz: result[7]['output'][0] #data = result[6]['output'][0] #print "\n" * 10, _plot_format(data), "\n" * 10 #intensity = [numpy.amin(data[0], axis=0)[0], numpy.amax(data[0], axis=0)[0]]