pyNAVIS.savers

Savers

class pyNAVIS.savers.Savers[source]

Methods:

save_AEDAT(spikes_file, path, settings[, ...])

Saves a SpikesFile into an AEDAT file.

save_CSV(spikes_file, path[, split, ...])

Saves a SpikesFile into a CSV file where each spike is represented in one line following the same patter: "address, timestamp".

save_TXT(spikes_file, path[, split, ...])

Saves a SpikesFile into two different TXT files, where addresses and timestamps are stored, respectively.

save_TXT_relativeTS(spikes_file, path[, ...])

Saves a SpikesFile into two different TXT files, where addresses and timestamps are stored, respectively.

save_as_any(spikes_file, path, output_format)

Saves a SpikesFile into any of the implemented Savers, depending on the output format selected.

static save_AEDAT(spikes_file, path, settings, verbose=False)[source]

Saves a SpikesFile into an AEDAT file.

Parameters:
  • spikes_file (SpikesFile) – File to save.

  • path (string) – Path where the output file will be saved, including name. Extension should not be specified.

  • settings (MainSettings) – Configuration parameters for the file to save.

  • verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.

Returns:

None.

static save_CSV(spikes_file, path, split=False, separator=', ', verbose=False)[source]

Saves a SpikesFile into a CSV file where each spike is represented in one line following the same patter: “address, timestamp”.

Parameters:
  • spikes_file (SpikesFile) – File to save.

  • path (string) – Path where the output file will be saved, including name. Extension should not be specified.

  • split (boolean, optional) – True for generating two files (addresses and timestamps), and False for generating one with all the information.

  • separator (string, optional) – which character to use as separator between addresses and timestamps when split = False

  • verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.

Returns:

None.

static save_TXT(spikes_file, path, split=True, separator=', ', verbose=False)[source]

Saves a SpikesFile into two different TXT files, where addresses and timestamps are stored, respectively.

Parameters:
  • spikes_file (SpikesFile) – File to save.

  • path (string) – Path where the output file will be saved, including name. Extension should not be specified.

  • split (boolean, optional) – True for generating two files (addresses and timestamps), and False for generating one with all the information.

  • separator (string, optional) – which character to use as separator between addresses and timestamps when split = False

  • verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.

Returns:

None.

static save_TXT_relativeTS(spikes_file, path, split=True, separator=', ', verbose=False)[source]

Saves a SpikesFile into two different TXT files, where addresses and timestamps are stored, respectively. Timestamps are relative to the previous spike.

Parameters:
  • spikes_file (SpikesFile) – File to save.

  • path (string) – Path where the output file will be saved, including name. Extension should not be specified.

  • split (boolean, optional) – True for generating two files (addresses and timestamps), and False for generating one with all the information.

  • separator (string, optional) – which character to use as separator between addresses and timestamps when split = False

  • verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.

Returns:

None.

static save_as_any(spikes_file, path, output_format, settings=None)[source]

Saves a SpikesFile into any of the implemented Savers, depending on the output format selected.

Parameters:
  • spikes_file (SpikesFile) – File to save.

  • path (string) – Path where the output file will be saved. Format should not be specified.

  • output_format (string) – Output format of the file. Currently supports ‘.aedat’, ‘.csv’, “.txt” and “.txt_rel”. See the Savers class for more information.

  • settings (MainSettings, optional) – Configuration parameters for the output file. Only needed when saving the output as an AEDAT file.

Returns:

None.

Raises:

SettingsError – if settings are not specified and output_format refers to AEDAT.