Reconstruction (reco)
Introduction
Module containing functions and classes to reconstruct data. This includes: * r0 to dl1 functions, including charge integration and application of the calibration, data volume reduction and other utils * dl1 to dl2 functions, including disp calculation and random forest training and application
Reference/API
lstchain.reco.disp Module
Functions
|
Compute the disp parameters |
|
Compute disp parameters. |
|
Compute the disp_norm parameters from Hillas parameters in the event position in the camera frame Return a DispContainer |
|
Calculates source position in camera coordinates(x,y) from the reconstructed disp. |
|
Compute disp_norm.dx and disp_norm.dy vector from disp_norm.norm, disp_norm.angle and disp_norm.sign |
|
Compute miss |
lstchain.reco.dl1_to_dl2 Module
Module with functions for Energy and disp_norm reconstruction and G/H separation. There are functions for raining random forest and for applying them to data. The RF can be saved into a file for later use.
Usage:
“import dl1_to_dl2”
Functions
|
Apply previously trained Random Forests to a set of data depending on a set of features. |
|
Uses MC data to train Random Forests for Energy and DISP reconstruction and G/H separation and returns the trained RFs. |
|
Get expected source position for source-dependent analysis . |
|
Get parameters dict for source-dependent analysis. |
|
Train a model for the regression of the disp_norm norm |
|
Train a model for the classification of the disp_norm sign |
|
Train a model (Random Forest Regressor) for the regression of the disp_norm vector coordinates dx,dy. |
|
Train a Random Forest Regressor for the regression of the energy TODO: introduce the possibility to use another model |
|
Trains two Random Forest regressors for Energy and disp_norm reconstruction respectively. |
|
Trains a Random Forest classifier for Gamma/Hadron separation. |
Update disp parameters using effective focal length |
lstchain.reco.r0_to_dl1 Module
This is a module for extracting data from simtelarray and observed files and calculate image parameters of the events: Hillas parameters, timing parameters. They can be stored in HDF5 file. The option of saving the full camera image is also available.
Functions
|
Reconstruct the disp parameters and source position from a DL1 parameters table and write the result in the file |
|
Return a DL1ParametersContainer of extracted features from a calibrated event. |
|
Prepare and performs the extraction of DL1 parameters using a likelihood based reconstruction method. |
|
Chain r0 to dl1 Save the extracted dl1 parameters in output_filename |
lstchain.reco.utils Module
Module with auxiliar functions:
Transform AltAz coordinates into Camera coordinates (This should be implemented already in ctapipe but I haven’t managed to find how to do it).
Calculate source position from disp_norm distance.
Calculate disp distance from source position.
Functions
|
Adds the time difference with the previous event to a real data dataframe. |
|
Transforms altitude (angle from the horizon upwards) to theta (angle from z-axis) for simtel array coordinate systems. |
|
apply src_r cut to filter out large off-axis MC events |
|
Transforms azimuth (angle from north towards east) to phi (angle from x-axis towards y-axis) for simtel array coordinate systems. |
|
Compute camera to Horizontal frame (Altitude-Azimuth system). |
|
Cartesian to polar transformation As a convention, angle is always included in [-pi/2:pi/2]. |
|
Make sure altitude is not larger than 90 deg (it happens in some MC files for zenith=0), to keep astropy happy |
|
Computes the angle between the shower major axis and polar angle of the shower centroid |
|
Compute event-wise weights. |
|
Computes a square of theta (angle from z-axis) from camera frame coordinates |
|
transform for the telescope list (to turn it into a telescope pattern) un-pack var-length list of tel_ids into fixed-width bit pattern by tel_index |
|
Extract source position from data |
|
Apply data filtering to a pandas dataframe or astropy Table. |
|
Calculate the effective observation time of a set of real data events from a sky observation. |
|
Return the position of the source in the camera frame. |
|
From a given geomagnetic declination and inclination angle along with telescope zenith and azimuth pointing to get the angle between the geomagnetic field and the shower axis, for a single telescope. |
|
Impute missing pointing values using linear_imputer and replace them inplace |
|
Replace missing values in y with values from a linear interpolation on their position in the array. |
|
Polar to cartesian transformation. |
|
Compute the source position in the camera frame |
|
Coordinate transform from sky coordinate to camera coordinates (x, y) in distance |
|
Compute the reconstructed source position in the sky |
|
Rotate 2D object around given axle |
|
Coordinate transform from aky position (alt, az) (in angles) to camera coordinates (x, y) in distance. |
|
Compute the coordinates of the vector (dx, dy) from the center of gravity to the source position |
|
Compute on what side of the center of gravity the source is in the camera. |
|
Select events in good time intervals (GTI) on the base of the GTI defined the catB calibration table (dl1_mon_tel_CatB_cal_key) |
lstchain.reco.volume_reducer Module
TEMPORARY module with functions to perform a volume reduction to LST data:
This is a temporary implementation of the ‘tailcut and dilation’ volume reduction method. The volume reduction produces reduced waveforms and write them in the DL0 container.
To date, the DL0 container is overwritten if the volume reduction is applied.
Usage
In the configuration file:
"volume_reducer":{
"algorithm": "zero_suppression_tailcut_dilation",
"parameters": { # add here the desired tailcut parameters. See function's help for default parameters.
}
}
Functions
|
Checks the volume reduction algorithm defined in the config file, and if not None, it applies to a calibrated event the volume reduction method. |
|
Checks in the configuration file if a volume reduction method has been set. |
|
Zero suppression and tailcut cleaning with dilation. |