<jupyter_start><jupyter_text>[![Notebook Tutorial](__code/__all/notebook_tutorial.png)](https://neutronimaging.pages.ornl.gov/tutorial/notebooks/bragg_edge_peak_fitting)  Select Your IPTS<jupyter_code>from __code import system
from __code.bragg_edge.bragg_edge_peak_fitting_evaluation import BraggEdge, Interface

system.System.select_working_dir(facility='SNS', instrument='VENUS')
from __code.__all import custom_style
custom_style.style()

from plotly.offline import plot, init_notebook_mode, iplot
init_notebook_mode()<jupyter_output><empty_output><jupyter_text>Prepare UI engine<jupyter_code>%gui qt<jupyter_output><empty_output><jupyter_text>Select Normalized Data Input FolderData and time spectra files will be loaded<jupyter_code>o_bragg = BraggEdge(working_dir=system.System.get_working_dir())
o_bragg.select_working_folder()<jupyter_output><empty_output><jupyter_text>Select Open Beam Data Input folder<jupyter_code>o_bragg.select_ob_folder()<jupyter_output><empty_output><jupyter_text>Select sample region and peak to fit  Select how many random files to use to select region to fit<jupyter_code>o_bragg.how_many_data_to_use_to_select_sample_roi()<jupyter_output><empty_output><jupyter_text>fit ui<jupyter_code>o_interface = Interface(o_bragg=o_bragg, spectra_file=o_bragg.spectra_file)
o_interface.show()<jupyter_output><empty_output><jupyter_text>DEBUGGING<jupyter_code>from __code import system
from __code.bragg_edge.peak_fitting_evaluation.bragg_edge_peak_fitting import BraggEdge, Interface
%gui qt
import os

# small data set
# data_path = "/Volumes/G-DRIVE/IPTS/VENUS/shared/testing_normalized/"
# spectra_file = os.path.join(data_path, "Image019_Spectra.txt")

# full data set
#data_path = "/Volumes/G-DRIVE/IPTS/SNAP/Si_normalized/Si_powder_1_Angs_20C_corrected_normalized"
#spectra_file = os.path.join(data_path, "normalized_Spectra.txt")
data_path = "/Volumes/G-DRIVE/IPTS/IPTS-26171-testing_ibeatles/10_InconelPowder_1.5Hrs_Corrected_normalized/"
spectra_file = "/Volumes/G-DRIVE/IPTS/IPTS-26171-testing_ibeatles/10_InconelPowder_1.5Hrs_Corrected_normalized/20210910_Run_52256_InconelPowder_0008_0646026_Spectra.txt"

import glob
list_data = glob.glob(data_path + "*.tif")
assert os.path.exists(spectra_file)

o_bragg = BraggEdge(working_dir=data_path)
o_bragg.load_data(data_path)
o_interface = Interface(o_bragg=o_bragg,
                        working_dir=data_path,
                        spectra_file=spectra_file)
o_interface.show()<jupyter_output><empty_output><jupyter_text>DEBUGGING using import straight<jupyter_code>from __code import system
from __code.bragg_edge.peak_fitting_evaluation.bragg_edge_peak_fitting import BraggEdge, Interface
%gui qt
data_path = "/Volumes/G-Drive/IPTS/SNAP/Si_normalized/Si_powder_1_Angs_20C_corrected_normalized"
o_interface = Interface(working_dir=data_path)
o_interface.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup