icecube.frame_object_diff.segments module

Tray segments for compression.

icecube.frame_object_diff.segments.compress(tray, name, base_filename, base_path='', base_frames={}, inline_compression=True, frame_callback=None, If=<function <lambda>>)

A general compressor for GCD frames.

Parameters:
  • base_filename – The base GCD filename.

  • base_path – (optional) Will be used as a path to base_filename but not stored in the diff objects.

  • base_frames – (optional) Pre-existing copy of GCD frames in a dictionary.

  • inline_compression – (optional) Directly modify the frame stream (default True).

  • frame_callback – (optional) Function callback which receives the compressed frames.

  • If – (optional) Callable to decide whether to run on the frame.

If neither inline_compression or frame_callback is enabled, compressed objects will be added into the frame stream without deleting anything else.

icecube.frame_object_diff.segments.get_frames(tray, base_filename)

Use the file stager to get base GCD frames.

icecube.frame_object_diff.segments.inline_compress(tray, name, If=<function <lambda>>)

An inline compressor for GCD frames in the same file.

Parameters:

If – (optional) Callable to decide whether to run on the frame.

icecube.frame_object_diff.segments.inline_uncompress(tray, name, If=<function <lambda>>)

An inline uncompressor for GCD frames. The reverse of inline_compress.

Parameters:

If – (optional) Callable to decide whether to run on the frame.

icecube.frame_object_diff.segments.uncompress(tray, name, base_filename=None, base_path='', base_frames={}, keep_compressed=False, frame_callback=None, If=<function <lambda>>)

A general uncompressor for GCD frames. The reverse of compress.

Parameters:
  • base_filename – (optional) The base GCD filename (default to stored filename).

  • base_path – (optional) Will be used as a path to the input filename if set.

  • base_frames – (optional) Pre-existing copy of GCD frames in a dictionary.

  • keep_compressed – (optional) Keep the compressed objects (default False).

  • frame_callback – (optional) Function callback which receives the uncompressed frames.

  • If – (optional) Callable to decide whether to run on the frame.

If frame_callback is enabled, uncompressed objects will not be written to the frame stream, instead they will be sent to the callback. This also enables keep_compressed, since we don’t want to leave the frames empty.