Package: gamma-simulator
Gamma_simulatorThis is a gamma pulse simulator jointly developed byShamoon College of Engineering(SCE)in Israel andShanghai Advanced Research Institutein China.Here we will give a brief introduction to our software, including the what and why. For more specific implementation steps of the software, please refer to ourpaper. Of course,if you are a pure user, please jump directly toUseto see how to use it.For any questions about the software, you can leave a message or send an email to me, I will reply as soon as possilbleIntroductionWhat is Gamma Simulator?Gamma simulator is a gamma pulse simulator with parameter customization function, you can specify the type of radioactive source and pulse count rate and other characteristics, generate pulse signals that meet the corresponding characteristicsWhy do we creat it?The original intention of the gamma simulator was to introduce deep learning into energy spectroscopy in the later stage. The use of deep learning to process pulse signals requires that the collected pulse signals have corresponding labels, which is impossible in commercial energy spectrometer. Therefore, we used the simulator to label the pulse signals while generating them, so as to facilitate the reference of deep learning methods. At the same time, simulators can greatly reduce the manpower, material and financial resources of the signal collection process, and can be used to preliminarily test signal processing methodsSoftware structureMacrostructureImplementation structureParameter descriptionSetting Parameters:Parameter nameParameter descriptionverboseWhether to output detailed informationverbose_plotsWhether images need to be outputsourceThe simulated radioactive sourcesignal_lenLength of time to simulate sampling(s)fsAnalog sampling ratelambda_valueAnalog pulse count rate(cps)dict_typeShape type model of the simulated pulsedict_shape_paramsdict shape paramsnoise_unitUnit of noisenoiseThe magnitude of noise in the given unitdict_sizeShape dictionary size due to jitterseedThe simulated random number seedShape parameters:Parameter nameParameter descriptiont_riserise time of the shapet_fallfall time of the shapeshape_lenlength of the shape in samplesshape_len_seclength of the shape in secondsEvents parameters:Parameter nameParameter descriptionn_eventsnumber of events in the signaltimesarrival times of the eventsenergiesenergy values for each eventlambda_measuredactual event rateshape_param1, shape_param2shape parameters for each eventSignal parameters:Parameter nameParameter descriptionsignal_lenlength of the signal in samplessignal_len_seclength of the signal in secondsduty_cycleduty cycle of the signalpile_up_statnumber of the pile-ups in the generated signalmeasured_snrmeasured SNR of the generated signal (dB)UseInstallMake sure you have the following libraries in your environmentnumpyscipymatplotliburllibYou can use the following command to install the libariespipinstallnumpyscipymatplotliburllibImportfromgamma_simulatorimportgamma_simulatorRunStep 1.Creat an instancesimulator=gamma_simulator()Step 2.Define parameterssimulator=gamma_simulator(verbose=True,verbose_plots={'shapes':True,'signal':True},source={'name':'Co-60','weights':1},signal_len=1,# "analog" signal of 1 second that are 1e7 samplesfs=10e5,lambda_value=1e4,dict_type='gamma',dict_shape_params={'mean1':1.1,'std1':0.001,'mean2':1e5,'std2':1e3},noise_unit='std',noise=1e-3,dict_size=10,seed=42)Step 3.Creat the signalsignal=simulator.generate_signal()NoticeShape parameterIf you are not familiar with shape parameters, use the following combination of parameters{dict_type='gamma',dict_shape_params={'mean1':1.1,'std1':0.001,'mean2':1e5,'std2':1e3}or{dict_type='double_exponential',dict_shape_params={'mean1':1e-7,'std1':1e-9,'mean2':1e-5,'std2':1e-7}Plot settingOur simulator supports drawing a variety of graphs, including energy, shape, signal and spectrum.Energy：Ideal energy spectrum of the drawn signal source (simulator built-in database)Shape：Draws a dictionary set of all possible signal shapesSignal：When the length of the resulting signal is less than 2000, the generated signal is drawn, and when the length is greater than 2000, the first 2000 sampling points are drawnThe default option is not to draw, if you need to draw, you need to change the specified value in the parameter definition to Trueverbose_plots={'energy':True, 'shapes': True, 'signal': True}Examplesfromgamma_simulatorimportgamma_simulatorsimulator=gamma_simulator(verbose=True,verbose_plots={'shapes':True,'signal':True},source={'name':'Co-60','weights':1},signal_len=1,# "analog" signal of 1 second that are 1e7 samplesfs=10e6,lambda_value=1e4,dict_type='double_exponential',dict_shape_params={'mean1':1e-7,# continuous-time parameters measured in seconds'std1':1e-9,'mean2':1e-5,'std2':1e-7},noise_unit='std',noise=1e-3,dict_size=10,seed=42)signal=simulator.generate_signal()fromgamma_simulatorimportgamma_simulatorsimulator=gamma_simulator(verbose=True,verbose_plots={'energy':True,'signal':True},source={'name':['Co-60','I-125'],'weights':[1,2]},signal_len=1,# "analog" signal of 1 second that are 1e7 samplesfs=10e6,lambda_value=1e4,dict_type='gamma',dict_shape_params={'mean1':1.1,# continuous-time parameters measured in seconds'std1':0.001,'mean2':1e5,'std2':1e3},noise_unit='std',noise=1e-3,dict_size=10,seed=42)signal=simulator.generate_signal()version1.0.1 upload to pypi1.0.2 add license and install_requires