forked from clade/ThorlabsPM100
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
85 lines (59 loc) · 2.37 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from __future__ import print_function
from time import sleep
from numpy import array
from ThorlabsPM100 import ThorlabsPM100, USBTMC
inst = USBTMC()
power_meter = ThorlabsPM100(inst = inst)
power_meter.system.beeper.immediate()
print("Measurement type :", power_meter.getconfigure)
print("Current value :", power_meter.read)
print("Wavelength :", power_meter.sense.correction.wavelength)
print("Power range limit:", power_meter.sense.power.dc.range.upper)
print("Set range auto and wait 500ms ...")
sleep(.5)
power_meter.sense.power.dc.range.auto = "ON"
print("Power range limit:", power_meter.sense.power.dc.range.upper)
print("Set bandwidth to High")
power_meter.input.pdiode.filter.lpass.state = 0
print("Average per mesure :", power_meter.sense.average.count)
print("Set average to 1 ...")
power_meter.sense.average.count = 1
print("Perform 100 measurements ...")
mes = array([power_meter.read for _ in range(100)])
print("Average value :", mes.mean())
print("std deviation :", mes.std())
print("Set average to 10 ...")
power_meter.sense.average.count = 10
print("Perform 100 measurements ...")
mes = array([power_meter.read for _ in range(100)])
print("Average value :", mes.mean())
print("std deviation :", mes.std())
print("Set average to 100 ...")
power_meter.sense.average.count = 100
print("Perform 100 measurements ...")
mes = array([power_meter.read for _ in range(100)])
print("Average value :", mes.mean())
print("std deviation :", mes.std())
print("Set bandwidth to Low")
power_meter.input.pdiode.filter.lpass.state = 1
print("Set average to 1 ...")
power_meter.sense.average.count = 1
print("Perform 100 measurements ...")
mes = array([power_meter.read for _ in range(100)])
print("Average value :", mes.mean())
print("std deviation :", mes.std())
print("Set average to 10 ...")
power_meter.sense.average.count = 10
print("Perform 100 measurements ...")
mes = array([power_meter.read for _ in range(100)])
print("Average value :", mes.mean())
print("std deviation :", mes.std())
print("Set average to 100 ...")
power_meter.sense.average.count = 100
print("Perform 100 measurements ...")
mes = array([power_meter.read for _ in range(100)])
print("Average value :", mes.mean())
print("std deviation :", mes.std())
print("Set average to 1 ...")
power_meter.sense.average.count = 1
power_meter.system.beeper.immediate()