# this function is a wrapper so that myOBE can access the model def my_model_function(sets, pars, cons): # unpack the experimental settings x = sets[0] # unpack model parameters x0 = pars[0] A = pars[1] B = pars[2] # unpack model constants d = cons[0] return lorentz_peak(x, x0, A, B, d) """Connect it to myOBE""" myOBE.model_function = my_model_function """ Settings and Parameters and Constants (oh My!) """ # define the measurement setting space # 50 values between 1.5 and 4.5 (GHz) xvals = np.linspace(1.5, 4.5, 200) # tell it to the BOE # sets, pars, cons are all expected to be tuples myOBE.sets = (xvals, ) # define the parameter space where the peak could be found # resonance values x0 (like NV frequency) around 3 GHz x0min = 2 x0max = 4 x0vals = np.linspace(x0min, x0max, 201)
# a straight line return m * x + b def mxplsub_wrapper(sets, pars, cons): # unpack the experimental settings x = sets[0] # unpack model parameters m = pars[0] b = pars[1] # unpack model constants # N/A return mxplusb(x, m, b) myOBE.model_function = mxplsub_wrapper # settings, parameters and constants # define the measurement setting space # 101 possible x values xsettings = np.linspace(0, 1, 201) # sent it to myOBE packaged as a tuple myOBE.sets = (xsettings, ) # define the parameter space mvals = np.linspace(-1, 1, 501) bvals = np.linspace(-1, 1, 501) # package as a tuple and send myOBE.pars = (mvals, bvals)