-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add White Rabbit support (synchronize clocks between different Harps over fiber optics) - add hardware triggered measurements support - remove unfoldT3Format - add getAbsTime for Unfold measurement class in T3 mode - auto detect library - getDeviceIDs() detects all supported devics Python: - add Demo_TimeTrace_Coincidence.py - add Demo_WR_Configure_Master.py - add Demo_WR_Configure_Slave.py - add Demo_WR_TimeTrace_Master.py - add Demo_WR_TimeTrace_Slave.py - add Demo_HW_Start.py - add Demo_HW_StartGated.py - add Demo_HW_StartStop.py Docu: - add Control Connector
- Loading branch information
Showing
50 changed files
with
3,247 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from snAPI.Main import * | ||
|
||
if(__name__ == "__main__"): | ||
|
||
start = 0 | ||
length = 10 | ||
|
||
sn = snAPI() | ||
sn.getDevice() | ||
|
||
# offline processing: | ||
# sn.getFileDevice(r"E:\Data\PicoQuant\G2_T3_sameTTs.ptu") | ||
sn.initDevice(MeasMode.T2) | ||
|
||
# set the trigger level | ||
sn.loadIniConfig("config\MH.ini") | ||
|
||
#list of channels to build the coincidence from | ||
chans= [1,2] | ||
ciIndex = sn.manipulators.coincidence(chans, 1000, mode = CoincidenceMode.CountOnce, | ||
time = CoincidenceTime.Last, | ||
keepChannels=True) #set keepChannels to false to get the coincidences only | ||
# ciIndex is the 'channel number' where the coincidences are stored | ||
sn.logPrint(f"coincidence index: {ciIndex}") | ||
|
||
# block measurement for continuous (acqTime = 0 is until stop) measurement | ||
sn.unfold.startBlock(acqTime=1000, size=1024*1024*1024, savePTU=False) | ||
|
||
while(True): | ||
times, channels = sn.unfold.getBlock() | ||
|
||
if(len(times) > 9): | ||
sn.logPrint("new data block:") | ||
sn.logPrint(" channel | time tag") | ||
sn.logPrint("--------------------") | ||
|
||
# only print the first 10 time tags per block out | ||
# for performance reasons | ||
# but it here should all data be stored to disc | ||
for i in range(10): | ||
sn.logPrint(f"{channels[i]:9} | {times[i]:8}") | ||
|
||
|
||
# filter the time tags of coincidences | ||
ciTimes = sn.unfold.getTimesByChannel(ciIndex) | ||
sn.logPrint("new coincidence block:") | ||
sn.logPrint("time tag") | ||
sn.logPrint("--------") | ||
if len(ciTimes) > 9: | ||
for i in range(10): | ||
sn.logPrint(f"{ciTimes[i]:8}") | ||
|
||
|
||
if sn.unfold.finished.contents: | ||
break | ||
|
||
# if otherBreakCondition: | ||
sn.unfold.stopMeasure | ||
|
||
sn.logPrint("end") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from snAPI.Main import * | ||
import matplotlib | ||
matplotlib.use('TkAgg',force=True) | ||
from matplotlib import pyplot as plt | ||
print("Switched to:",matplotlib.get_backend()) | ||
|
||
|
||
if(__name__ == "__main__"): | ||
|
||
sn = snAPI() | ||
sn.getDevice() | ||
sn.initDevice(MeasMode.T2) | ||
|
||
# a trigger signal on C1 starts the measurement | ||
sn.device.setMeasControl(MeasControl.C1StartCtcStop) | ||
sn.loadIniConfig("config\MH.ini") | ||
|
||
# configure timetrace | ||
sn.timeTrace.setNumBins(10000) | ||
sn.timeTrace.setHistorySize(10) | ||
# prepare measurement for triggered start (stop after 10s) | ||
sn.timeTrace.measure(10000, waitFinished=False, savePTU=False) | ||
|
||
plt.figure(f'Figure: {sn.deviceConfig["Model"]}') | ||
while True: | ||
finished = sn.timeTrace.isFinished() | ||
counts, times = sn.timeTrace.getData() | ||
plt.clf() | ||
plt.plot(times, counts[0], linewidth=2.0, label='sync') | ||
for c in range(1, 1+sn.deviceConfig["NumChans"]): | ||
plt.plot(times, counts[c], linewidth=2.0, label=f'chan{c}') | ||
|
||
plt.xlabel('Time [s]') | ||
plt.ylabel('Counts[Cts/s]') | ||
plt.legend() | ||
plt.title(f'TimeTrace Master {sn.deviceConfig["ID"]}') | ||
plt.pause(0.1) | ||
|
||
if finished: | ||
break | ||
|
||
plt.show(block=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from snAPI.Main import * | ||
import matplotlib | ||
matplotlib.use('TkAgg',force=True) | ||
from matplotlib import pyplot as plt | ||
print("Switched to:",matplotlib.get_backend()) | ||
|
||
|
||
if(__name__ == "__main__"): | ||
|
||
sn = snAPI() | ||
sn.getDevice() | ||
sn.initDevice(MeasMode.T2) | ||
|
||
# a trigger signal on C1 starts and holds the measurement | ||
# a low to high slope starts the measurement until the signal on the control connector Pin C1 | ||
# is getting low again. | ||
sn.device.setMeasControl(MeasControl.C1Gated, 1, 0) | ||
sn.loadIniConfig("config\MH.ini") | ||
|
||
# configure timetrace | ||
sn.timeTrace.setNumBins(10000) | ||
sn.timeTrace.setHistorySize(10) | ||
# prepare measurement for triggered start (stop after 10s) | ||
sn.timeTrace.measure(10000, waitFinished=False, savePTU=False) | ||
|
||
plt.figure(f'Figure: {sn.deviceConfig["Model"]}') | ||
while True: | ||
finished = sn.timeTrace.isFinished() | ||
counts, times = sn.timeTrace.getData() | ||
plt.clf() | ||
plt.plot(times, counts[0], linewidth=2.0, label='sync') | ||
for c in range(1, 1+sn.deviceConfig["NumChans"]): | ||
plt.plot(times, counts[c], linewidth=2.0, label=f'chan{c}') | ||
|
||
plt.xlabel('Time [s]') | ||
plt.ylabel('Counts[Cts/s]') | ||
plt.legend() | ||
plt.title(f'TimeTrace Master {sn.deviceConfig["ID"]}') | ||
plt.pause(0.1) | ||
|
||
if finished: | ||
break | ||
|
||
plt.show(block=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from snAPI.Main import * | ||
import matplotlib | ||
matplotlib.use('TkAgg',force=True) | ||
from matplotlib import pyplot as plt | ||
print("Switched to:",matplotlib.get_backend()) | ||
|
||
if(__name__ == "__main__"): | ||
|
||
sn = snAPI() | ||
sn.getDevice() | ||
sn.initDevice(MeasMode.T2) | ||
|
||
# a trigger signal on C1 starts and one on C2 stops the measurement | ||
sn.device.setMeasControl(MeasControl.C1StartC2Stop) | ||
sn.loadIniConfig("config\MH.ini") | ||
|
||
# configure timetrace | ||
sn.timeTrace.setNumBins(10000) | ||
sn.timeTrace.setHistorySize(10) | ||
# prepare measurement for triggered start and stop | ||
sn.timeTrace.measure(waitFinished=False, savePTU=False) | ||
|
||
plt.figure(f'Figure: {sn.deviceConfig["Model"]}') | ||
while True: | ||
finished = sn.timeTrace.isFinished() | ||
counts, times = sn.timeTrace.getData() | ||
plt.clf() | ||
plt.plot(times, counts[0], linewidth=2.0, label='sync') | ||
for c in range(1, 1+sn.deviceConfig["NumChans"]): | ||
plt.plot(times, counts[c], linewidth=2.0, label=f'chan{c}') | ||
|
||
plt.xlabel('Time [s]') | ||
plt.ylabel('Counts[Cts/s]') | ||
plt.legend() | ||
plt.title(f'TimeTrace Master {sn.deviceConfig["ID"]}') | ||
plt.pause(0.1) | ||
|
||
if finished: | ||
break | ||
|
||
plt.show(block=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.