Yaml Interface¶
Refer to the Luna schema for detailed definitions and constraints. You can also provide this schema to your text editor (like JetBrains IDE’s) to get autocomplete and as-you-type validations.
Once you have a yaml configuration you can pass it to tpx3dump
or tpx4dump
with the yaml
mode.
./tpx3dump yaml <full/path/to/configuration.yaml
Luna Schema
timepixSchemaVersion (string): The version of the schema this configuration complies with. Currently the only version is 1.0.0.
datasets (array): A collection of datasets.
dataset
id (string): A unique identifier for the dataset, incorporating an abbreviation for the application type.
application (string): The application type of the dataset. Possible values: ‘MSI’, ‘VMI’, ‘INT’, ‘NEU’, ‘PIV’, ‘COS’, ‘TEM’, ‘OTH’.
detectorType (string): Detector type. Possible values: ‘Tpx3’, ‘Tpx4’.
inputFormat (string): The input format for Tpx4 detector type, constant across all configurations. Possible values: ‘ASI’, ‘NIKHEF’.
data (array): Configure input data paths for this analysis.
data
id (string): The id for a data set. Should be unique.
name (string): The name of a dataset.
path (string): The path of the file or directory, relative to TimepixDataRoot root.
analysis (array): Analysis configurations referencing the ‘Analysis Configuration’ definition.
Analysis Configuration
This object defines the configuration for analysis.
Properties
id (string): A unique identifier for the analysis configuration.
outputFile (string): Path for the output file.
layout (string): Either ‘single’ or ‘quad’. Default: ‘single’.
epsSpace (integer): Space gap for the centroiding algorithm in unit of pixels. Default: 1.
epsTime (string): Time gap for the centroiding algorithm with units (e.g., ‘500ns’). Valid units: s, ms, us, ns, ps, fs. Default: ‘100ns’.
disableClustering (boolean): Disable clustering functionality which is on by default. Default: false.
ctotCut (integer): The value of the cut used when computing the timewalk correction look up table. Must be increments of 25ns. Default: 1500.
timewalkFile (string): A path to a hdf5 file from a previous run of tpx3dump which contains the timewalk correction matrix.
timeBinInterval (string): The interval in units of time used to segment data for further processing after reading and unpacking. Default: ‘all’.
numTimeBins (integer): Number of time bins to use. Default: 5.
logLevel (string): Logging level [possible values: off, trace, debug, info, warn, error]. Default: ‘info’.
rawOnly (boolean): Flag to indicate processing data from binary to raw data only, no sorting or clustering. Default: false.
nPhases (integer): The value of the number of phases for the phase locked loop (PLL) used for acquisition. Default: 16.
inputFormat (string): (tpx4dump only) The input format for Tpx4 detector type. Possible values: ‘ASI’, ‘NIKHEF’.
maxDelay (number): (tpx4dump only). The maximum delay difference between arrival of the heartbeat and the hits, expressed as a portion of wraparound period. Must be less than 1.0. Default is 1/4 of the wraparound period.
discardPixelData (boolean): When true (default false), the PixelData is not output to hdf5.
tofTdcReference (string): The TDC to use as a reference when calculating the time of flight (ToF). Possible values: [‘TDC1Rising’, ‘TDC1Falling’, ‘TDC2Rising’, ‘TDC2Falling’, ‘’]. If not set (‘’), the ToF is ignored. Default: ‘’;
Example yaml configurations¶
Note
The environment variable $(ASI_TEST_SUITE)
is used in these examples. This syntax allows you
to define arbitrary environment variables and use them in paths.
Process tpx3 data from raw binary to real valued data¶
timepixSchemaVersion: "1.0.0"
datasets:
- id: "ds1"
description: "Example of how to run tpx3dump with yaml configuration file."
detectorType: Tpx3
data:
- path: "$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500.tpx3"
analysis:
- id: "analysis1"
outputFile: ""$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500.h5"
epsT: "150ns"
Discard PixelHit data¶
timepixSchemaVersion: "1.0.0"
datasets:
- id: "ds1"
description: "Tpx4 configuration using the yaml interface"
detectorType: Tpx4
data:
- path: "$(ASI_TEST_SUITE)/M4I_TEM_additional_data/fDoS_000000.tpx4"
analysis:
- id: "analysis1"
outputFile: "$(ASI_TEST_SUITE)/M4I_TEM_additional_data/fDoS_000000.h5"
epsTime: "100ns"
inputFormat: "asi"
discardPixelHits: true
Multiple Configurations¶
timepixSchemaVersion: "1.0.0"
datasets:
- id: "ds1"
description: "Example of how to run tpx3dump, one dataset with multiple analysis configurations."
detectorType: Tpx3
data:
- path: "$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500.tpx3"
analysis:
- id: "analysis1"
outputFile: ""$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500_analysis1.h5"
epsSpace: 1
epsTime: "100ns"
timeBinInterval: "1s"
numTimeBins: 5
rawOnly: false
logLevel: "info"
- id: "analysis2"
outputFile: ""$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500_analysis2.h5"
epsSpace: 1
epsTime: "100ns"
timeBinInterval: "1s"
numTimeBins: 5
rawOnly: false
logLevel: "info"
Yaml Anchors¶
common-analysis-config: &common
epsSpace: 1
timeBinInterval: "1s"
numTimeBins: 5
rawOnly: false
logLevel: "info"
timepixSchemaVersion: "1.0.0"
datasets:
- id: "ds1"
description: "Example of how you can use yaml anchors to reuse configurations."
detectorType: Tpx3
data:
- path: "$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500.tpx3"
analysis:
- id: "analysis1"
outputFile: ""$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500_analysis1.h5"
epsTime: "100ns"
<<: *common
- id: "analysis2"
outputFile: ""$(ASI_TEST_SUITE)/Tpx3/00_MSI/00_peptide_mix/500_analysis2.h5"
epsTime: "300ns"
<<: *common
Tpx4 Yaml¶
timepixSchemaVersion: "1.0.0"
datasets:
- id: "ds1"
description: "Tpx4 configuration using the yaml interface"
detectorType: Tpx4
data:
- path: "$(ASI_TEST_SUITE)/M4I_TEM_additional_data/fDoS_000000.tpx4"
analysis:
- id: "analysis1"
outputFile: "$(ASI_TEST_SUITE)/M4I_TEM_additional_data/fDoS_000000.h5"
epsTime: "100ns"
inputFormat: "asi"