sidpy.sid.translator.Translator

class sidpy.sid.translator.Translator(*args, **kwargs)[source]

Bases: object

Abstract class that defines the most basic functionality of a data format translator. A translator converts experimental data from binary / proprietary data formats to a single standardized HDF5 data file

Return type:

Translator object

Methods

is_valid_file

Checks whether the provided file can be read by this translator.

translate

Abstract method.

static is_valid_file(file_path, *args, **kwargs)[source]

Checks whether the provided file can be read by this translator.

This basic function compares the file extension against the “extension” keyword argument. If the extension matches, this function returns True

Parameters:

file_path (str) – Path to raw data file

Returns:

file_path – Path to the file that needs to be provided to translate() if the provided file was indeed a valid file Else, None

Return type:

str

abstract translate(*args, **kwargs)[source]

Abstract method.