-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade pip * Upload linux wheels * Upload non master to testpypi * Add windows wheel * windows wheel * windows wheel * Windows wheel * Skip existing wheels * Use prebuild docker img for windows * Windows wheels * skip win32 and pypy * FFTW dir in windows build * Compiler flags for HDF5 and fftw * Use fftw only with ICS * Add swig * Mask hdf5 dependency * Mask hdf5 * Fix if close * Hdf5 issue * Static boost linking * Windows boost linking * win boost * remove boost system * static boost * boost exception issue * Use vcpkg on win * Static boost builds * avoid boost * Fix typo * auto link * linking * Build photon hdf by default * Remove openmp dependency * remove boost::filesystem and locale depency * remove boost:locale * Enable language * remove vcpkg * only boost header * remove pip swig cmake boost * add cmake * Use cmake findpython * switch findpzthon3 for findpython * Set DPython_ROOT_DIR in setup.py * Add swig * remove cmake swig * remove cmake submodule * move cmake files from submodule to folder * remove cmake submodule * Add pocketfft * Reduce boost dependency * Remove unused import * Move other peoples code to external * Move other peoples code to external * Move to external * Refactoring * refactor * Add itlib * Restore * Add aglib * Add aglib * Add optimization wrapper * Add optimization wrapper * Add msstl * use itlib flat_set * Cleanup * Cleanup * bump version * separate external include files * cleanup * Add documentation * win issue * Use BUILD_PYTHON_DOCS * Win issue * win build issue * Move external thirdparty code to highlight other projects code external third party code is moved to thirdparty folder. * Remove boost dependency * Static linking of boost remove uneeded boost dependency and link (just in case) boost statically * switch fftw for pocketfftw * switch fftw for pocketfftw * fftw -> pocketfft * Fix typos * remove boost fftw * update license info * remote fftw * cleanup namespace * Add windows wheel Dockerfile * Add wheel:win build * Remove unused config * fix indentation * Fix typo * use cmd.exe for wheel:win * use cmd for whee:win * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Simplify test * fix skip on linux * fix wheel:win pypi upload * Add pwsh to docker * Update .gitlab-ci.yml file * fix * xx * ff * hfd * Update file .gitlab-ci.yml * Update file pocketfft_hdronly.h * Add example writing CLSM data * Windows * new c++ on osx * Dynamic hdf5 lib * fix call * wheel build * add header setter * doc fixes * add windows wheel * docs * docs * add osx:wheel * macos wheel * osx fixes * macos wheel * use modern c++ on osx * wheel osx fix * doc fix * Fix badges and license * Removed TODO * doc fixes * DOC FIX * Also upload development docs * doc build fix * Docs buil * docs building * fix doc * fix doc * Redirect RTD page to docs * Support more py versions * docs deposit * pin boost * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Compile wheel for py311 * Set min macos version * Update .gitlab-ci.yml * Update .gitlab-ci.yml * Specify mmacosx version * Update .gitlab-ci.yml * Cleanup * Cleanup * Add read clsm settings method * Add mask flip * Fix typo * Add option for mask * Change default masking. * Bump version * Pypi 2fa requires tokens * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Replace old np.float types * Replace old np.float types * Fix TTTRMask issue need to flip * Improved documentation * Separate doc from doc-tttrlib env * Fix typo * Fix typo * Fix bixtex issue * Fix doxygen issue * Bump version * Improve docstrings * Additional sphinx modules * Fix typo * Fix typo * Fix issue of deprecated std * Remove missing sphinx-extension * Fix windows build * Fix doc deploy * Fix doc deploy * Fix doc deploy * Fix doc deploy * Fix Pda histogram_function * fix wrong path * CI gitlab github sync * Fix doc issues * Add stubs for doc * Add stubs for doc * Fix wrong path * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml file * Update .gitlab-ci.yml * Update pyproject.toml * Add github action * Remove gitlab webide config * Remove gitlab webide config * Remove github action demo * Add Zeiss Confocor3 reader * Fix set_header issue Assigning a raw pointer when using set_header can cause a double free. Use copy constructor instead. * Add x, y attribute to Correlator.py * Also run Correlator when accessing axis * Add Confocor3 support * Add Confocor3 support * Cleanup * Cleanup * Fix wrong link * Remove old interface * Remove work in progress file * Fix plot Remove old interface Adjust plot range * Fix plot Remove old interface Adjust plot range * Fix typo * Fix file path * Fix plot Increase number of photons for MLE and measure time. * Bump version * Build on all platforms * Update plot * Update recipe Use libboost-devel instead of boost-cpp Use matplotlib-base instead of matplotlib -> no qt5 dependency * Ignore .cache dir * No gpg check on yum * Fix header issue * Build issues on Windows * Do not use git in conda builds * Fix MY_INSTALL_PREFIX * Conda windows build issues * Remove tools submodule * Add tools submodule --------- Co-authored-by: tpeulen <[email protected]> Co-authored-by: Thomas-Otavio Peulen <[email protected]> Co-authored-by: Administrator <[email protected]>
- Loading branch information
1 parent
8b30997
commit 5a7dc40
Showing
27 changed files
with
362 additions
and
151 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ dist/ | |
doc/auto_examples | ||
tmp/ | ||
.vscode | ||
.cache | ||
.vs | ||
.ipynb_checkpoints | ||
cmake-build-*/ | ||
|
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
git submodule update --recursive --init --remote | ||
mkdir b2 && cd b2 | ||
|
||
if [[ "${target_platform}" == osx-* ]]; then | ||
|
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
File renamed without changes.
121 changes: 121 additions & 0 deletions
121
examples/correlation/plot_confocor3_two_ch_correlation.py
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,121 @@ | ||
""" | ||
======================================= | ||
Confocor3 two channel cross-correlation | ||
======================================= | ||
The raw FCS data format of the Zeiss Confocor3 is relatively simple. | ||
Zeiss Confocor3 raw files store time-difference between photons. | ||
A relatively small header is followed by a set of 32-bit integers that | ||
contain the time difference to the previous registered photon. Photons | ||
registered by different channels are stored in separate files. | ||
In this example two raw files of a Confocor3 are read and merged into | ||
a single photon stream. Next, the merged photon stream is used to compute | ||
the cross-correlation between the two channels. | ||
""" | ||
import pathlib | ||
import numpy as np | ||
|
||
import pylab as plt | ||
import tttrlib | ||
|
||
#%% | ||
# Reading data | ||
# ------------ | ||
# The photon data registered by different detectors are saved in separate files. | ||
# Read the data of all channels that should be correlated into separate containers. | ||
fns = [str(p) for p in pathlib.Path('../../tttr-data/cz/fcs').glob('5a6ce6a348a08e3da9f7c0ab4ee0ce94_R1_P1_K1_Ch*.raw')] | ||
tttr_data = [tttrlib.TTTR(fn, 'CZ-RAW') for fn in fns] | ||
|
||
#%% | ||
# We combine the data in different files into a single TTTR container using the header | ||
# of first file as template. | ||
header = tttr_data[0].header | ||
channels = [t.routing_channels[0] for t in tttr_data] | ||
print("Used channels:", channels) | ||
|
||
#%% | ||
# You can check the count rates of the channels using the macro time resolution contained | ||
# in the header | ||
macro_time_resolution = header.macro_time_resolution | ||
count_rates = [len(t) / (t.macro_times[-1] * macro_time_resolution) for t in tttr_data] | ||
print("Count rates:", count_rates) | ||
|
||
#%% | ||
# Now we merge the data of the two detectors in a single container. The | ||
# marco times need to be sorted first. | ||
macro_times = np.concatenate([t.macro_times for t in tttr_data]) | ||
routing_channels = np.concatenate([t.routing_channels for t in tttr_data]) | ||
sorted_indices = np.argsort(macro_times) | ||
|
||
#%% | ||
# Using the sorted macro times we sort the routing channel numbers | ||
# and the macro times. | ||
routing_channels = routing_channels[sorted_indices] | ||
macro_times = macro_times[sorted_indices] | ||
|
||
#%% | ||
# Note: no micro time and no event type in the raw Confocor3 format. | ||
# Thus, we use ones for the micro time and the event type. | ||
micro_times = np.ones_like(macro_times, dtype=np.uint16) | ||
event_types = np.ones_like(macro_times, dtype=np.int8) | ||
|
||
#%% | ||
# Using the merged marcro times and channel numbers, we create a new | ||
# TTTR container. | ||
tttr_merged = tttrlib.TTTR() | ||
tttr_merged.set_header(header) | ||
tttr_merged.append_events( | ||
macro_times=macro_times, | ||
micro_times=micro_times, | ||
routing_channels=routing_channels, | ||
event_types=event_types | ||
) | ||
|
||
#%% | ||
# The container can be used for standard analysis, e.g., correlations. | ||
settings = { | ||
"n_bins": 9, # n_bins and n_casc defines the settings of the multi-tau | ||
"n_casc": 19, # correlation algorithm | ||
} | ||
|
||
# Create correlator | ||
# Caution: x-axis in units of macro time counter | ||
# tttrlib.Correlator is unaware of the calibration in the TTTR object | ||
correlator = tttrlib.Correlator( | ||
channels=([1], [2]), | ||
tttr=tttr_merged, | ||
**settings | ||
) | ||
plt.semilogx( | ||
correlator.x_axis, | ||
correlator.correlation, | ||
label="Corr(1,2)" | ||
) | ||
|
||
correlator = tttrlib.Correlator( | ||
channels=([1], [1]), | ||
tttr=tttr_merged, | ||
**settings | ||
) | ||
plt.semilogx( | ||
correlator.x_axis, | ||
correlator.correlation, | ||
label="Corr(1,1)" | ||
) | ||
|
||
correlator = tttrlib.Correlator( | ||
channels=([2], [2]), | ||
tttr=tttr_merged, | ||
**settings | ||
) | ||
plt.semilogx( | ||
correlator.x_axis, | ||
correlator.correlation, | ||
label="Corr(2,2)" | ||
) | ||
|
||
plt.ylim(1.032, 1.050) | ||
plt.show() | ||
|
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
Empty file.
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.