– Streaming telescope data

Code for parsing streaming telescope data. For now we only support AARTFAAC data version 1. We implemented an emulator for this stream in testutil.stream_emu., image_queue)[source]

Handles the connection, waits until a windows is returned and puts it in the queue.

Daemon thread, will loop forever.

Parameters:, port, image_queue)[source]

Tries to connect to a specific host and port, if succesfull will call connection_handler() with the connection.

  • host (str) – host to connect to
  • port (int) – port to connect to
  • image_queue (Queue.Queue) – Will be used for putting the images in[source]
Parameters:hdulist ( – fits header to extract timestamp from
Returns:extracted timestamp
Return type:datetime.datetime, bytes_)[source]

Read an amount of bytes from the socket

  • socket (socket.socket) – socket to use for reading
  • bytes (int) – amount of bytes to read

raw bytes from socket

Return type:

str, grouped_queue)[source]

Will monitor image_queue for images and group them by timestamp. When an image with an successive timestamp is received the group is put on the grouped queue.

  • image_queue (Queue) – the incoming image queue
  • grouped_queue (Queue) – the outgoing grouped image queue[source]

read raw aarfaac protocol window

Parameters:socket (socket.socket) – socket to read from
Returns:fits_bytes, image_bytes, image_bytes)[source]

reconstruct a fits object from serialised fits header and data.

  • fits_bytes (str) – a string with serialized fits bytes
  • image_bytes (str) – a string with serialized image data

the fits object

Return type:, ports)[source]

Connects to all hosts on port in ports. Returns a generator yielding sets of images with the same timestamp.

  • hosts (tuple) – list of hosts to connect to
  • ports (tuple) – list of ports to connect to