Disable Clustering¶
If it is not needed, you can disable clustering entirely. Clustering is generally the most performance intensive part of processing and if its not needed then you do not need to wait.
Luna Command¶
./tpx3dump process -i /Users/Ciaran/atlassian-bitbucket-pipelines-runner/temp/e71169e4-520a-5b30-a5ab-ee8a44eb5fac/build/docs/source/_static/example_data.tpx3 -o /Users/Ciaran/atlassian-bitbucket-pipelines-runner/temp/e71169e4-520a-5b30-a5ab-ee8a44eb5fac/build/docs/source/_static/example_data.h5 --disable-clustering --layout single
Python Script¶
1import os, sys
2import h5py # ensure you have `pip install h5py`
3import pandas as pd # ensure you have `pip install pandas`
4from typing import *
5import matplotlib.pyplot as plt
6import seaborn as sns
7import warnings
8
9warnings.filterwarnings("ignore") # suppress warnings from plotting libraries.
10
11sns.set_context(context="talk")
12
13# add some paths to PYTHONPATH
14for directory in ["..", "."]:
15 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), directory)))
16
17# on our system "EXAMPLE_DATA_HDF5" refers to the absolute path
18# to a hdf5 file generated by luna. Replace with your own!
19from env_vars_for_docs_examples import EXAMPLE_DATA_HDF5, PLOTS_DIRECTORY
20
21# re-use functions from previous example
22from ex2_read_data_time_units import TimeUnit, load_pixel_hits
23
24TOA_UNIT = TimeUnit.Nanoseconds
25
26# reusing the plot_toa function from example 11: raw only analysis
27from ex11_raw_only_analysis import plot_toa
28
29
30if __name__ == "__main__":
31 pixel_hits = load_pixel_hits(EXAMPLE_DATA_HDF5, TOA_UNIT)
32 print(pixel_hits.head().to_string())
33
34 fname_0_to_50 = os.path.join(PLOTS_DIRECTORY, f"ex12_toa_0-50.png")
35 fname_0_to_500 = os.path.join(PLOTS_DIRECTORY, f"ex12_toa_0-500.png")
36 fname_0_to_5000 = os.path.join(PLOTS_DIRECTORY, f"ex12_toa_0-5000.png")
37 fname_0_to_50000 = os.path.join(PLOTS_DIRECTORY, f"ex12_toa_0-50000.png")
38
39 plot_toa(pixel_hits, start=0, stop=50, fname=fname_0_to_50)
40 plot_toa(pixel_hits, start=0, stop=500, fname=fname_0_to_500)
41 plot_toa(pixel_hits, start=0, stop=5000, fname=fname_0_to_5000)
42 plot_toa(pixel_hits, start=0, stop=50000, fname=fname_0_to_50000)
Script Output¶
hdf5 datasets: ['ExposureTimeBoundaries', 'PixelHits']
toa cid tot dtoa x y tof
0 1.103455e+10 -1 200 -1 140 193 -1
1 1.103455e+10 -1 150 -1 143 193 -1
2 1.103459e+10 -1 1475 -1 68 92 -1
3 1.103459e+10 -1 850 -1 67 92 -1
4 1.103459e+10 -1 300 -1 68 91 -1
Plot saved to "/Users/Ciaran/atlassian-bitbucket-pipelines-runner/temp/e71169e4-520a-5b30-a5ab-ee8a44eb5fac/build/docs/source/_static/examples_output/plots/ex12_toa_0-50.png"
Plot saved to "/Users/Ciaran/atlassian-bitbucket-pipelines-runner/temp/e71169e4-520a-5b30-a5ab-ee8a44eb5fac/build/docs/source/_static/examples_output/plots/ex12_toa_0-500.png"
Plot saved to "/Users/Ciaran/atlassian-bitbucket-pipelines-runner/temp/e71169e4-520a-5b30-a5ab-ee8a44eb5fac/build/docs/source/_static/examples_output/plots/ex12_toa_0-5000.png"
Plot saved to "/Users/Ciaran/atlassian-bitbucket-pipelines-runner/temp/e71169e4-520a-5b30-a5ab-ee8a44eb5fac/build/docs/source/_static/examples_output/plots/ex12_toa_0-50000.png"