load_session(filename)

Load an OSCAR session file (.001)

Parameters:
  • filename (str) –

    full path of the file including filename

Returns:
  • OSCARSession

    An OSCARSession instance containing data from file

read_channel_data(buffer, position, data_data, channel_num)

Read data of one channel of an OSCAR session file.

Parameters:
  • buffer (bytes) –

    buffer containing the session data

  • position (int) –

    position of the channel to read

  • data_data (OSCARSessionData) –

    OSCARSessionData structure already filled with other metadata

  • channel_num (int) –

    id of channel to read

Returns:
  • tuple[int, OSCARSessionChannel]

    New position after the channel data and the OSCARSessionChannel data structure

read_channel_metadata(buffer, position)

Read metadata of a channel in an OSCAR session file.

Parameters:
  • buffer (bytes) –

    buffer containing the session data

  • position (int) –

    position of the current channel metadata

Returns:
  • tuple[int, OSCARSessionChannel]

    New position after current channel metadata in buffer and an OSCARSessionChannel data structure

read_event_metadata(buffer, position)

Read one event metadata of an OSCAR session file.

Parameters:
  • buffer (bytes) –

    buffer containing the session data

  • position (int) –

    position of the current event metadata

Returns:
  • tuple[int, OSCARSessionEvent]

    New position after current event metadata in buffer and an OSCARSessionEvent data structure

read_session(buffer, position)

Read a session of an OSCAR session file. Only support version >= 10 at the moment.

Parameters:
  • buffer (bytes) –

    buffer containing the session

  • position (int) –

    position of the session in the buffer

Returns:
  • tuple[int, OSCARSession]

    New position after session in buffer and an OSCARSession data structure

read_session_data(buffer, position)

Read the session data of an OSCAR session file.

Parameters:
  • buffer (bytes) –

    buffer containing the session data

  • position (int) –

    position of the session data in the buffer

Returns:
  • tuple[int, OSCARSessionData]

    New position after session data in buffer and an OSCARSessionData data structure

read_session_header(buffer, position)

Read the header of an OSCAR session file. Only support version >= 10 at the moment.

Parameters:
  • buffer (bytes) –

    Buffer containing the header data

  • position (int) –

    Position of the header in the buffer

Returns:
  • tuple[int, OSCARSessionHeader]

    New position after header data in buffer and an OSCARSessionHeader data structure