<jupyter_start><jupyter_text>This is an example of how to use the sinusoid_fitting code.<jupyter_code>import sinusoid_fitting
reload(sinusoid_fitting)
import numpy as np<jupyter_output><empty_output><jupyter_text>Load Data (a sinusoidal signal)<jupyter_code>time, signal = np.loadtxt('../data/2015-05-21/ALL0001/F0001CH1.CSV', delimiter=',', 
                                usecols=[3, 4], unpack=True)<jupyter_output><empty_output><jupyter_text>Fit Data<jupyter_code>fit_parameters, fit_stds, covariance = sinusoid_fitting.fit_signal(time, signal)<jupyter_output><empty_output><jupyter_text>Fit Parameters<jupyter_code>print fit_parameters
fit_parameters['amplitude']<jupyter_output><empty_output><jupyter_text>Fit Uncertainty<jupyter_code>print fit_stds<jupyter_output>{'phase': 0.00082947952786513739, 'frequency': 3.2737319954604396, 'amplitude': 0.00019508874694828298, 'offset': 0.00013940592080727326}<jupyter_text>Save a plot into a dated output directory<jupyter_code>sinusoid_fitting.plot_signal_vs_fit(time, signal, fit_parameters, '1'.zfill(4))<jupyter_output><empty_output><jupyter_text>Display the plot<jupyter_code>from IPython.display import Image
Image(filename='../output/2015-06-16/0001.png')<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup