<jupyter_start><jupyter_text>SETUP<jupyter_code>context = zmq.Context()
print "Connecting to server..."
socket = context.socket(zmq.REQ)
socket.connect ("tcp://localhost:%s" % port)

print "Sending request ", "ubuntu_cuda70","..."
socket.send ("ubuntu_cuda70")

message = socket.recv_json()
pprint(message)

optical_path = {}
for kk, vv in message.iteritems():
    print kk, ' is ', vv
    socket.send_string (vv)
    message = socket.recv_json()
    pprint(message)
    if kk=="Source":
        optical_path[vv] = ceo.JSource(message)
    elif kk=="GMT_MX":
        optical_path[vv] = ceo.JGMT_MX(message)
    elif kk=="Imaging":
         optical_path[vv] = ceo.JImaging(message)

optical_path["star"].reset()
optical_path["GMT"].propagate(optical_path["star"])
optical_path["imager"].propagate(optical_path["star"])
plt.imshow(optical_path["star"].phase.host(),interpolation='None')
plt.imshow(optical_path["imager"].frame.host())<jupyter_output><empty_output><jupyter_text>DATA SERVER<jupyter_code>data_port = "5557"
data_context = zmq.Context()
data_socket = data_context.socket(zmq.REP)
data_socket.bind("tcp://*:%s" % data_port)
message = data_socket.recv()
print "Received request: ", message

data_socket.send ("euler angles")
msg = data_socket.recv()
ea  = np.array( msgpack.unpackb(msg,use_list=False) )
print ea
optical_path["GMT"].M1.motion_CS.euler_angles[:] = ea
optical_path["GMT"].M1.motion_CS.update()

optical_path["star"].reset()
optical_path["GMT"].propagate(optical_path["star"])
optical_path["imager"].propagate(optical_path["star"])

data = optical_path["star"].phase.host()
msg = msgpack.packb(data.tolist())
data_socket.send(msg)<jupyter_output>Received request:  wavefront
[[  0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  0.00000000e+00   4.84813681e-06   0.00000000e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00]]
{'fraction_non_alphanumeric': 0.16803081367356765, 'fraction_numerical': 0.11603273952816562, 'mean_word_length': 5.473520249221184, 'pattern_counts': {'":': 3, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 20, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '263013', 'license': 'Zlib', 'n_tokens_mistral': 989, 'n_tokens_neox': 793, 'n_words': 110, 'path': 'sandbox/ENV/Client.ipynb', 'repo_name': 'uah-cao1/CEO', 'size': '2077'}