Script execution
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#Script imported from: PO2DV-NCS-HW_ps.xml
|
||||
from mathutils import estimate_peak_indexes, fit_gaussians, create_fit_point_list
|
||||
|
||||
#Pre-actions
|
||||
caput('PO2DV-NCS-VHQ1:Set-RampA', '10')
|
||||
@@ -20,7 +21,7 @@ ActualIA = Channel('PO2DV-NCS-VHQ1:Actual-IA', type = 'd')
|
||||
|
||||
#set voltage to 0
|
||||
print 'Ramping down power supply to 0V'
|
||||
SetVA.put(0.0, timeout=None)
|
||||
SetVA.put(0.1, timeout=None)
|
||||
|
||||
#wait up to 2 minutes for voltage to be ~0
|
||||
for setpoint1 in frange(0.0, 120.0, 1.0, True):
|
||||
@@ -57,6 +58,18 @@ SetVA.close()
|
||||
ActualVA.close()
|
||||
ActualIA.close()
|
||||
|
||||
readable = scan.getReadable(0)
|
||||
positions = scan.getPositions(0)
|
||||
|
||||
threshold = (min(readable) + max(readable))/2
|
||||
min_peak_distance = 5.0
|
||||
|
||||
peaks = estimate_peak_indexes(readable, positions, threshold, min_peak_distance)
|
||||
print "Peak indexes: " + str(peaks)
|
||||
print "Peak x: " + str(map(lambda x:positions[x], peaks))
|
||||
print "Peak y: " + str(map(lambda x:readable[x], peaks))
|
||||
|
||||
|
||||
scan.end()
|
||||
|
||||
#Post-actions
|
||||
|
||||
Reference in New Issue
Block a user