Recorder module¶
Main module¶
Software made for recording velocity form a Femto-Gramophone in a triggered manner. Can be used in conjunction with two-photon microscoppes by Femtonics Inc.
-
class
Recorder.Recorder.
Reader
(gram, frequency)[source]¶ A worker that can continnously send commands to the Gramophone with a given frequency.
Parameters: - name (str) – The name of this reader. Can be used for identification to stop a specific reader.
- read_func (function) – The read function that should be called.
- frequency (float) – The frequency at which the function should be called in Hz.
-
class
Recorder.Recorder.
VelLogModel
(log, parent=None)[source]¶ QT modell for velocity logs. Used to make an interface between the GUI’s table view and the Velocity log object
-
columnCount
(parent)[source]¶ Return the number of columns to be displayed. One column for each header.
-
-
class
Recorder.Recorder.
aboutWindow
(*args, **kwargs)[source]¶ The window shown if the user clicks the About option in the Help menu. Displays basic info about the software.
-
class
Recorder.Recorder.
licenseWindow
(*args, **kwargs)[source]¶ The window shown if the user clicks the License option in the Help menu. Displays the open source license the software is distributed under.
-
class
Recorder.Recorder.
pyGramWindow
(devmode, log_file, *args, **kwargs)[source]¶ The main window of the Gramophone reader.
-
closeEvent
(event)[source]¶ The built in close event of QMainWindow. User is trying to close the program. Ignore the passed event if you want to stop the user from doing so.
-
delete_warning
(count)[source]¶ Displays a message box to ask for confirmation. Call it if the user is trying to delete velocity records.
-
gramophone_error
(error_message)[source]¶ Slot for the errorOccurred signal of the Gramophone. Displays a message box with the warning, disconnects if necessary.
-
log_changed
()[source]¶ Calll this function when the velocity log is modified and it should be saved.
-
make_dummy
()[source]¶ Function only available for developers. Creates a dummy record in the current velocity log with randomized data.
-
new_window
()[source]¶ Opens a new instance of the Gramophone recorder. New windows can be used for simultanious recording of an other Gramophone device.
-
quit
()[source]¶ Close all windows and disconnrect form the Gramohone. Call this right before exiting.
-
record_warning
()[source]¶ Displays a warning if the recording is in progress. Call it if the user tries to exit.
-
reset_gram_timer
()[source]¶ Function only available for developers. Sends a Reset internal clock command to the Gramophone.
-
reset_graph
()[source]¶ Resets the live velocity plot to its starting state ie. erases the plot if there is already something on it.
-
save
()[source]¶ Saves the currently used log file. Returns True if the file is saved or False if saving was cancelled
-
save_warning
()[source]¶ Displays a warning if there are unsaved changes to the log file. Call it if the user tries to exit.
-
select_file
(mode='save', filename=None)[source]¶ Displays a file selection dialog for velocity log files. Mode can be ‘save’ or ‘open’.
-
selected_rows
¶ A property that holds a list of the selected rows of the current velocity log.
-
set_autosave
(val)[source]¶ Turns automatic saving on (True) or off (False)
Parameters: val (bool) – The sate to set
-
update_conn_state
()[source]¶ Updates the GUI depending on wheter the software is currently connected to a Gramophone.
-
update_graph
(velocity)[source]¶ Slot for the vel_signal of the Gramophone. Shifts the graph to the right and appends with the value received.
-
update_rec_state
(in_state_1, in_state_2)[source]¶ Slot for the rec_signal of the Grmaophone. Updates the state of recording and the GUI.
-
update_table_size
()[source]¶ Update all except last the row’s width to fit content in the list of velocity recordings.
-
Logging module¶
Module for logging Velocity data form the Gramophone into HDF5 files.
-
class
logger.
DummyRecord
[source]¶ A record with random data insted of recorded velocity. Can be used for testing purposes.
-
class
logger.
FileRecord
(file_group)[source]¶ A velocity record that is saved in a HDF5 file.
-
comment
¶ Returns the record’s comment form file
-
device_serial
¶ Returns the record’s device id form file
-
finish_time
¶ Returns the finish time form file
-
mean_vel
¶ Returns the record’s mean velocity form file
-
rec_id
¶ Returns the record’s ID form file
-
sampling_freq
¶ Returns the record’s mean velocity form file
-
software_version
¶ Returns the record’s device id form file
-
start_time
¶ Returns the start time form file
-
times
¶ Returns the time data form file
-
velocities
¶ Returns the velocity data form file
-
-
class
logger.
MemoryRecord
(rec_id, sampling_freq, device_serial)[source]¶ A velocity record that is in memory ie. not saved yet.
-
append
(gtime, vel, rec)[source]¶ Appends this record with the given time and velocity if the recording state is 1.
-
-
class
logger.
Record
[source]¶ Abstract class for velocity records.
-
date_hr
¶ A property that holds the starting date in a human readable format defined by the data_format class variable.
-
finish_time_hr
¶ A property that holds the finishing time in a human readable format defined by the time_format class variable.
-
length
¶ A property that holds the length of this recording in seconds.
-
length_hr
¶ A property that holds the length of the recording in a human readable format defined by the length_format class variable.
-
mean_vel
¶ A property that holds the mean of the recorded velocities.
-
save
(log_file)[source]¶ Saves this record into a file and returns a FileRecord that can replace it.
Parameters: log_file (h5py.File) – An opened HDF5 file
-
start_time_hr
¶ A property that holds the starting time in a human readable format defined by the time_format class variable.
-
unique_id
¶ A property that stores a unique id based on the start time of this record. Used for naming folders in the HDF5 file.
-