gfncalc - Correlation function calculator

It is a command line line tool for processing a large dataset of correlated photon "clicks" coming from two different counters. It outputs files with a calculated normalized second order correlation function.

News
Authors
Description
License
Download
How to use
Compiling


NEWS:

[2013-08-15] Latest version 1.3 now supports a "high-pass" time filtering algorithm. This is preliminary work attempting to isolate the signature of of a g(2)(t) with only one atom as a source.

[2013-01-11] Our paper using the new filtering algorithm of this software has been published in the New Journal of Physics: 10.1088/1367-2630/15/1/013017, for more info see publication list.

[2012-12-05] Another paper using this software has been published in Physical Review A: 10.1103/PhysRevA.86.053816, for more info see publication list.

[2012-05-15] Version 1.2 supports a filtering algorithm based on a predictable delay between trigger pulses and APD clicks.

[2012-03-02] The first paper that uses this software from our lab has been published in Physical Review A: 10.1103/PhysRevA.85.021804, for more info see publication list.

AUTHORS:

The code was originally based off work done by David G. Norris and Eric Cahoon. It was re-written and ported to C++ by Andres D. Cimmarusti. It is still only maintained by Andres D. Cimmarusti, but many of the features have come out of discussions with David G. Norris, Burkley Patterson and Luis A. Orozco.

DESCRIPTION:

As the title suggests, gfncalc calculates normalized correlation functions from photon arrival times. In physics, these functions are normally written as g(n)(t), hence the acronym. At present, it only computes the second order. There are plans to compute third order, but this has not been implemented yet (There are some commented parts of the code that show initial work towards this goal). Currently it also reads trigger pulses from another device to implement filtering. It features a simple command-line interface and it is cross-platform. Uses a configuration file (during first run it will create one -gfncalc.conf-) and remembers last parameters used. This program is fast at processing large datasets.

LICENSE:

This program is released under the terms of the GNU Public License v3 (GPLv3). For more information please see:

http://www.gnu.org/licenses/gpl-3.0.html

DOWNLOAD:

Source can be obtained from my github here.

HOW TO USE:

At present, the program can only handle input ascii text files which contain two columns of data. First column displaying the time and the second one showing the channel (or detector) on which the photon impinged.

The program requires several inputs to run successfully. It has a hardcoded detector resolution time of 164.61 picoseconds. This can be changed but it requires recompilation. The next parameter is the path of the data (an example is provided in the CLI). The channels of all the detectors and trigger pulses must be specified (APD C is set to zero, which disables it). Binning and window size are required, they are input in multiples of the detector resolution. Then there is the internal pulse delay. This is the time, in multiples of detector resolution time, that it takes for a triggering pulse to arrive after a click on channel APD A arrives. The delay tolerance allows for some margin of error for the internal pulse delay. Finally, there is the rising edge delay. This can be input in microseconds. If our trigger pulses have a preset delay in the device, then this is where we can tell the program about this. All the pulse parameters can have random values if one only wishes to calculate second-order correlations without the trigger pulses.

It is designed to accept input of the form dataX.asc. Where X can be any positive integer. In this way, it can be run for multiple datasets.

Its output is also a text file. As a header, it displays the dataset number, total number of photon "clicks" on each channel (or detector - APD) as well number of trigger pulses and rates. The rest of the output is organized in four columns. First one is time in microseconds. Second is the number of photons in the time-bin. Third is the normalized second order correlation amplitude and finally the error on this amplitude, which is basically propagated from the poissonian error in the number of photons.

To run the program on a Unix-based system, open a terminal and then type:

./gfncalc

In Windows, in a command prompt, simply type

gfncalc.exe

COMPILING:

It is written in plain C++ using only the standard libraries. We have only thoroughly tested g++ (The GNU C++ compiler) as compiler, on a GNU/Linux 64 bits machine. With g++ and minGW we cross-compile the program to run on Windows (We did do an old test with MS Visual Studio 2010 for an older version of the code and it compiled without a problem). We have not tested Mac OSX, but given g++ is easily available for this platform, it should be easy to produce an executable for it.

FOR GNU/LINUX (AND POTENTIALLY MACOSX):

In our GNU/Linux machine, to compile we simply do:

g++ -Wall gfncalc.cxx read_inputs.cxx -o gfncalc

(Only if the read_inputs.cxx and read_inputs.h files are located in the same directory)

or more generally

g++ -Wall -I/path-to-header-file gfncalc.cxx /path-to-file/read_inputs.cxx -o gfncalc

This binary has been tested on Debian GNU/Linux systems version 5/6/7 and CentOS 5. However, it should work on any Unix-based OS.

FOR WINDOWS (USING GNU/LINUX TO COMPILE):

To cross-compile using the GNU/Linux machine to obtain a working Windows 32-bit executable we do this (g++-minGW 4.6.3):

i686-w64-mingw32-g++ -Wall -static -I/path-to-header-file gfncalc.cxx /path-to-file/read_inputs.cxx -o gfncalc.exe

The executable has been tested and works well in Windows XP/Vista/7. However, performance of the program is inferior to the GNU/Linux binary (even when it was compiled with MS Visual Studio).