validation module¶
Note
This project is under active development.
- validation.get_abs_data(arr)[source]
Get the absolute values from the arrays.
- Parameters
arr (float) – the data in the arrays from the spectrograms.
- Returns
Return an array with absolute values.
- Return type
float.
- validation.get_all_instruments(database, sql_query)[source]
Get the all instruments data from the Database.
- Parameters
database – a database ‘Validation’.
sql_query – Sql query from the database.
- Returns index
index of the cursor frm database.
- Returns cursor
the cursor frm database.
- validation.get_max_data(data1, data2)[source]
Get the maximum value from the both data1 and data2.
- Parameters
data1 (float) – the data from spectrogram using the function ‘Constbacksub + elimwrongchannels’
data2 (float) – the data from spectrogram using the function ‘subtract_bg_sliding_window’
- Returns
Return the maximum values from data1, data2
- Return type
float.
- validation.get_min_data(data1, data2)[source]
Get the minimum value from the both data1 and data2.
- Parameters
data1 (float) – the data from spectrogram using the function ‘Constbacksub + elimwrongchannels’
data2 (float) – the data from spectrogram using the function ‘subtract_bg_sliding_window’
- Returns
Return the minimum values from data1, data2
- Return type
float.
- validation.get_pdf_file()[source]
Save the spectrograms into the pdf file.
- Returns
return A pdf file containing the Plotted Spectrograms with four columns
- Returns
pdf file.
- validation.move_axes(fig, ax_source, ax_target)[source]
Move the axes to create the new Figure.
- validation.plot_spec(rows)[source]
Get the plots in four columns.
- Parameters
rows – the rows from the database.
- Returns
return four columns (Original Data, ‘Constbacksub + elimwrongchannels’ , subtract_bg_sliding_window, Histograms).
- Return type
Matplotlip figure.
- Exception
The buffer is too small for the requested array!
- validation.signal_to_noise(arr)[source]
Calculate the signal-to-noise ratio of the input data.
- Parameters
arr (array_like) – an array_like object contain the data.
- Returns
The signal-to-noise ratio of arr, here defined as the mean divided by the standard deviation.
- Return type
float
- validation.update_all_values()[source]
Calculate the std and snr, then update them into the table in Database.
- Exception
The buffer is too small for the requested array!