|
7 | 7 | if(__name__ == "__main__"): |
8 | 8 |
|
9 | 9 | sn = snAPI() |
| 10 | + sn.setLogLevel(LogLevel.Config, True) |
10 | 11 | sn.getDevice() |
| 12 | + sn.initDevice(MeasMode.T3) |
11 | 13 |
|
12 | 14 | # alternatively read data from file |
13 | 15 | sn.setLogLevel(LogLevel.DataFile, True) |
14 | | - sn.initDevice(MeasMode.T2) |
| 16 | + #sn.getFileDevice(r"\mnt\d\Data\PicoQuant\CW_Shelved.ptu") # T2 File |
| 17 | + #sn.getFileDevice(r"D:\Data\PicoQuant\CW_Shelved.ptu") # T2 File |
15 | 18 |
|
16 | 19 | # enable this to get info about loading config |
17 | 20 | sn.setLogLevel(logLevel=LogLevel.Config, onOff=True) |
18 | | - sn.loadIniConfig("config\MH.ini") |
| 21 | + #sn.loadIniConfig(r"config\MH.ini") |
19 | 22 |
|
20 | 23 | numChans = sn.deviceConfig["NumChans"] |
21 | 24 | triggerMode = TrigMode.Edge if sn.deviceConfig["SyncTrigMode"] == "Edge" else TrigMode.CFD |
|
36 | 39 | sn.device.setInputEdgeTrig(-1, -50, 0) |
37 | 40 |
|
38 | 41 | # configure timetrace |
39 | | - sn.timeTrace.setNumBins(10000) |
40 | | - sn.timeTrace.setHistorySize(10) |
| 42 | + sn.timeTrace.setNumBins(1000) |
| 43 | + sn.timeTrace.setHistorySize(1) |
41 | 44 |
|
42 | 45 | # you can set a custom file name or path |
43 | | - sn.setPTUFilePath("C:\Data\PicoQuant\MyFileName.ptu") |
| 46 | + sn.setPTUFilePath("MyFileName.ptu") |
44 | 47 |
|
45 | 48 | # measure 10s |
46 | | - sn.timeTrace.measure(10000, waitFinished=False, savePTU=True) |
| 49 | + sn.timeTrace.measure(1000, waitFinished=False, savePTU=True) |
47 | 50 |
|
48 | 51 | while True: |
49 | 52 | finished = sn.timeTrace.isFinished() |
50 | | - counts, times = sn.timeTrace.getData() |
| 53 | + counts, times = sn.timeTrace.getData(normalized=True) |
51 | 54 | plt.clf() |
52 | 55 | plt.plot(times, counts[0], linewidth=2.0, label='sync') |
53 | 56 | for c in range(1, 1+sn.deviceConfig["NumChans"]): |
54 | 57 | plt.plot(times, counts[c], linewidth=2.0, label=f'chan{c}') |
55 | 58 |
|
56 | 59 | plt.xlabel('Time [s]') |
57 | 60 | plt.ylabel('Counts[Cts/s]') |
| 61 | + plt.yscale('log', base=10, nonpositive='clip') |
58 | 62 | plt.legend() |
59 | 63 | plt.title("TimeTrace") |
60 | 64 | plt.pause(0.1) |
|
0 commit comments