pFlux.set_power_mode(1)  # Linear mode in mV
# f1+f2
pFlux.set_freq(f1+f2)
pFlux.sweep_par='power'  # Power sweep

dim_1 = pFlux
dim_1.defval = 0.03 #pFlux
dim_3 = vBias
dim_3.defval = 0.0
dim_2 = vMag
dim_2.defval = 0.0
dim_1.UD = False
recordD12 = True  # activates /deactivates all D1 D2 data storage
D12 = CorrProc(D1, D2, pFlux, sgen, lags, BW, lsamples, corrAvg)
D12.doHist2d = False  # Plot 2d Histograms ??
D12._takeBG = True

def sweep_dim_1(obj, value):
    ramp(obj, obj.sweep_par, value, obj.sstep, obj.stime)


def sweep_dim_2(obj, value):
    ramp(obj, obj.sweep_par, value, obj.sstep, obj.stime)


def sweep_dim_3(obj, value):
    ramp(obj, obj.sweep_par, value, obj.sstep, obj.stime)


# This describes how data is saved
DS = DataStoreSP(folder, filen_0, dim_1, dim_2, dim_3, 'Vx1k')
pFlux.set_power_mode(1)  # Linear mode in mV
# f1+f2
pFlux.set_freq(f1+f2)
pFlux.sweep_par='power'  # Power sweep

dim_3 = pFlux
dim_3.defval = 0.03 #pFlux
dim_1 = vBias
dim_1.defval = 0.0
dim_2 = vMag
dim_2.defval = 0.0
dim_1.UD = False
recordD12 = True  # activates /deactivates all D1 D2 data storage
D12 = CorrProc(D1, D2, pFlux, sgen, lags, BW, lsamples, corrAvg)
D12.doHist2d = False  # Plot 2d Histograms ??
D12._takeBG = False

def sweep_dim_1(obj, value):
    ramp(obj, obj.sweep_par, value, obj.sstep, obj.stime)


def sweep_dim_2(obj, value):
    ramp(obj, obj.sweep_par, value, obj.sstep, obj.stime)


def sweep_dim_3(obj, value):
    ramp(obj, obj.sweep_par, value, obj.sstep, obj.stime)


# This describes how data is saved
DS = DataStoreSP(folder, filen_0, dim_1, dim_2, dim_3, 'Vx1k')