Overview#
hexsample is a Python package for the simulation and analysis of solid-state
hybrid detectors with hexagonal pixel sampling, providing the necessary
facilities to simulate, reconstruct and display data.
Command-line interface#
Once you have installed the package, the command-line interface provides access to all the facilities at the most basic level.
$ hexsample --help
This is hexsample version 0.13.3.
Copyright (C) 2023--2026, the hexsample team.
hexsample comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain
conditions. See the LICENSE file for details.
Visit https://github.com/lucabaldini/hexsample for more information.
usage: hexsample [-h] {simulate,reconstruct,display,quicklook} ...
positional arguments:
{simulate,reconstruct,display,quicklook}
sub-command help
simulate run a simulation
reconstruct run the event reconstruction
display run the single-event display
quicklook run a quick-look analysis of a recon file
options:
-h, --help show this help message and exit
(You can also try hexsample <subcommand> --help to get help on specific
sub-commands.)
Tasks and pipelines#
At a slightly different level, the package is organized around the number of
high-level tasks packaged in the tasks module. These include:
simulate(): simulate detector data from a source;reconstruct(): reconstruct detector data;display(): event display;quicklook(): quick-look analysis.
(You might have noticed that these tasks correspond to the sub-commands of the command-line interface.)
Each task is then wrapped, with an identical name, in the
pipeline module.
The main difference between the two is that all the functions in the
tasks module come with a precise, documented signature, while
the corresponding functions in the pipeline module are
entirely driven by keyword arguments. The basic rule is: if you are building
a simulation and/or analysis pipeline programmatically, always use the
functions in the tasks module; this will prevents typos in the
name of the arguments running undetected. The functions in the
pipeline module, on the other hand, are designed to filter
the keyword arguments and will happily ignore any unknown argument; they are
really only meant to be used by the command-line interface, since the validation
there happens at the argparse level.