Skip to content

Commit 0a561ff

Browse files
committed
add linux support
1 parent 9ac765f commit 0a561ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+176
-59
lines changed

demos/Demo_CorrelationFCS.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
sn = snAPI()
1111
sn.getDeviceIDs()
12-
sn.getFileDevice(r"D:\Data\PicoQuant\OpenCLTest\Atto655+Cy5_diff_FCS+FLCS_Conv.ptu")
13-
#sn.getDevice()
14-
sn.initDevice(MeasMode.T2)
12+
#sn.getFileDevice(r"\mnt\d\Data\PicoQuant\OpenCLTest\Atto655+Cy5_diff_FCS+FLCS_Conv.ptu")
13+
sn.getDevice()
14+
sn.initDevice(MeasMode.T3)
1515

1616
# set the configuration for your device type
1717
sn.loadIniConfig(r"config\MH.ini")
@@ -21,7 +21,7 @@
2121

2222
# 2. set windowSize and startTime
2323
sn.correlation.setFFCSParameters(1, 2, 1e6, 1e12, 100)
24-
sn.correlation.measure(2000,savePTU=False)
24+
sn.correlation.measure(2000,savePTU=False, waitFinished=True)
2525

2626
while True:
2727
finished = sn.correlation.isFinished()

demos/Demo_CorrelationG2.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
sn = snAPI()
1111
sn.getDeviceIDs()
1212
sn.getDevice()
13-
sn.getFileDevice(r"D:\Data\PicoQuant\CW_Shelved.ptu") # T2 File
14-
#sn.initDevice(MeasMode.T2)
13+
#sn.getFileDevice(r"D:\Data\PicoQuant\CW_Shelved.ptu") # T2 File
14+
#sn.getFileDevice(r"\mnt\d\Data\PicoQuant\CW_Shelved.ptu") # T2 File
15+
16+
sn.initDevice(MeasMode.T2)
1517

1618
# set the configuration for your device type
1719
sn.loadIniConfig("config\MH.ini")
1820

1921
# 1. shift the signals to max correlation max at tau = 0
20-
#sn.device.setInputChannelOffset(1, 1588)
22+
sn.device.setInputChannelOffset(1, 1588)
2123

2224
# only process data from 70s to end of file
2325
sn.manipulators.subStream(70)

demos/Demo_HistogramRefresh.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222

2323
# change histogram parameter in T2 mode
2424
sn.histogram.setRefChannel(0)
25-
sn.histogram.setBinWidth(250)
25+
sn.histogram.setBinWidth(100)
2626
sn.histogram.setNumBins(10000)
27-
sn.histogram.measure(acqTime=10000, waitFinished=True, savePTU=False)
27+
sn.histogram.measure(acqTime=10000, waitFinished=False, savePTU=True)
2828

2929
while True:
3030
finished = sn.histogram.isFinished()
3131
data, bins = sn.histogram.getData()
3232

3333
# 1s refresh time
34-
plt.pause(1)
34+
plt.pause(.1)
3535
plt.clf()
3636
plt.plot(bins, data[0], linewidth=2.0, label='sync')
3737
for c in range(1, 1+sn.deviceConfig["NumChans"]):

demos/Demo_HistogramSimple.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
sn.loadIniConfig("config\MH.ini")
2020

2121
sn.histogram.setRefChannel(0)
22-
sn.histogram.setBinWidth(5)
23-
sn.histogram.setNumBins(100000)
22+
sn.histogram.setBinWidth(100)
23+
sn.histogram.setNumBins(1000)
2424
# start histogram measurement
25-
sn.histogram.measure(acqTime=1000,savePTU=True)
25+
sn.histogram.measure(acqTime=1000, waitFinished=True, savePTU=True)
2626

2727
# get the data
2828
data, bins = sn.histogram.getData()
@@ -34,7 +34,8 @@
3434
for c in range(1, 1+sn.deviceConfig["NumChans"]):
3535
plt.plot(bins, data[c], linewidth=2.0, label=f'chan{c}')
3636
plt.xlabel('Time [ps]')
37-
plt.ylabel('Counts')
37+
plt.ylabel('Counts', )
38+
plt.yscale('log', base=10, nonpositive='clip')
3839
plt.legend()
3940
plt.title("Counts / Time")
4041
plt.pause(0.01)

demos/Demo_TimeTrace.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
if(__name__ == "__main__"):
88

99
sn = snAPI()
10+
sn.setLogLevel(LogLevel.Config, True)
1011
sn.getDevice()
12+
sn.initDevice(MeasMode.T3)
1113

1214
# alternatively read data from file
1315
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
1518

1619
# enable this to get info about loading config
1720
sn.setLogLevel(logLevel=LogLevel.Config, onOff=True)
18-
sn.loadIniConfig("config\MH.ini")
21+
#sn.loadIniConfig(r"config\MH.ini")
1922

2023
numChans = sn.deviceConfig["NumChans"]
2124
triggerMode = TrigMode.Edge if sn.deviceConfig["SyncTrigMode"] == "Edge" else TrigMode.CFD
@@ -36,25 +39,26 @@
3639
sn.device.setInputEdgeTrig(-1, -50, 0)
3740

3841
# configure timetrace
39-
sn.timeTrace.setNumBins(10000)
40-
sn.timeTrace.setHistorySize(10)
42+
sn.timeTrace.setNumBins(1000)
43+
sn.timeTrace.setHistorySize(1)
4144

4245
# you can set a custom file name or path
43-
sn.setPTUFilePath("C:\Data\PicoQuant\MyFileName.ptu")
46+
sn.setPTUFilePath("MyFileName.ptu")
4447

4548
# measure 10s
46-
sn.timeTrace.measure(10000, waitFinished=False, savePTU=True)
49+
sn.timeTrace.measure(1000, waitFinished=False, savePTU=True)
4750

4851
while True:
4952
finished = sn.timeTrace.isFinished()
50-
counts, times = sn.timeTrace.getData()
53+
counts, times = sn.timeTrace.getData(normalized=True)
5154
plt.clf()
5255
plt.plot(times, counts[0], linewidth=2.0, label='sync')
5356
for c in range(1, 1+sn.deviceConfig["NumChans"]):
5457
plt.plot(times, counts[c], linewidth=2.0, label=f'chan{c}')
5558

5659
plt.xlabel('Time [s]')
5760
plt.ylabel('Counts[Cts/s]')
61+
plt.yscale('log', base=10, nonpositive='clip')
5862
plt.legend()
5963
plt.title("TimeTrace")
6064
plt.pause(0.1)
-2.72 MB
Binary file not shown.

dist/snapi-1.1.0.tar.gz

-2.72 MB
Binary file not shown.

doc_source/install.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ Dependencies
6767

6868
3. Once the installation is complete, verify that the package is installed by running the command `import snAPI` in a Python interpreter. If no error message is shown, the installation was successful.
6969

70+
On Linux
71+
--------
72+
73+
1. Go to the linux sub directory
74+
75+
2. Execute commands
76+
77+
::
78+
79+
chmod +x install.sh
80+
sudo ./install.sh
81+
7082
Additional Features
7183
-------------------
7284

docs/_sources/install.rst.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ Dependencies
6767

6868
3. Once the installation is complete, verify that the package is installed by running the command `import snAPI` in a Python interpreter. If no error message is shown, the installation was successful.
6969

70+
On Linux
71+
--------
72+
73+
1. Go to the linux sub directory
74+
75+
2. Execute commands
76+
77+
::
78+
79+
chmod +x install.sh
80+
sudo ./install.sh
81+
7082
Additional Features
7183
-------------------
7284

docs/genindex.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,13 @@ <h2 id="I">I</h2>
716716
<li><a href="snAPI.Utils.html#snAPI.Utils.Color.IPur">IPur (snAPI.Utils.Color attribute)</a>
717717
</li>
718718
<li><a href="snAPI.Utils.html#snAPI.Utils.Color.IRed">IRed (snAPI.Utils.Color attribute)</a>
719+
</li>
720+
<li><a href="snAPI.Main.html#snAPI.Main.snAPI.is_linux">is_linux (snAPI.Main.snAPI attribute)</a>
719721
</li>
720722
</ul></td>
721723
<td style="width: 33%; vertical-align: top;"><ul>
724+
<li><a href="snAPI.Main.html#snAPI.Main.snAPI.is_win">is_win (snAPI.Main.snAPI attribute)</a>
725+
</li>
722726
<li><a href="snAPI.Main.html#snAPI.Main.Correlation.isFinished">isFinished() (snAPI.Main.Correlation method)</a>
723727

724728
<ul>

0 commit comments

Comments
 (0)