pyhiperta.hillas
Hillas (and some additional) parameters computation from integrated waveforms.
Functions:
| Name | Description |
|---|---|
hillas |
Compute hillas parameters (ellipse position, orientation, skewness, kurtosis) from shower images. |
hillas
Compute hillas parameters (ellipse position, orientation, skewness, kurtosis) from shower images.
The Hillas parametrization consists in estimating the ellipse formed by a gamma-ray shower over the background noise in the telescope integrated and cleaned images (R1 data level).
The ellipse parameters are found by performing a principal component analysis (PCA) of the images pixels weighted by their charge. The ellipse center is defined as the image center of gravity ; the ellipse axis and angle with respect to the x-axis are given by the PCA eigenvectors ; the ellipse length and width are defined as twice the standard deviation along the ellipse axis. In addition, the skewness and kurtosis of the image are computed along the major axis of the ellipse.
This method works with a single image, of with a batch of images. The implementation first computes the 1st and 2nd order image moments to build the covariance matrix (PCA is computed via the covariance matrix). The ellipse parameters are deduced from the covariance matrix and finally the skewness and kurtosis are computed as 3rd and 4rd along the ellipse major axis.
This function also returns the longitudinal coordinate of the pixels along the ellipsis greater axis since it is usefull for timing parameters computation.
Notes
A gamma-ray shower is radially symmetric in the direction of arrival, therefore the distribution along the small ellipse axis should be gaussian and the skewness and kurtosis are not computed along this axis.
An ellipse with given orientation and skewness is equivalent to another ellipse with orientation + pi and opposite skewness (psi + pi, -skewness). This method consistently returns the orientation in the ]-pi/2, pi/2[ range and corresponding skewness.
The skewness and kurtosis are computed using the 3rd and 4th moments, which are biased estimators.
Hillas, A. (1985). Cerenkov Light Images of EAS Produced by Primary Gamma Rays and by Nuclei. In 19th International Cosmic Ray Conference (ICRC19), Volume 3 (pp. 445).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform
|
ndarray
|
1D shower image(s). If a single image is provided the shape must be (N_pixels,). If a batch of images is provided, the shape should be (N_batch, N_pixels). |
required |
position
|
ndarray
|
Image pixel position in (x, y) coordinates. The shape must be (2, N_pixels): position[0,:] is the x coordinate, and position[1, :] the y coordinate, of the image pixels. |
required |
nan_threshold
|
float
|
Threshold to set some computed values to NaN instead of leaving them with problematic values. Images with intensity smaller than the threshold will have all output set to NaN. Images with lengths smaller than the threshold will have length, skewness and kurtosis set to NaN. |
0.0001
|
Returns:
| Name | Type | Description |
|---|---|---|
hillas_parameters |
ndarray
|
Image(s) hillas parameters. This is a 1D array with shape (10,) if a single image was provided, or a 2D array with shape (N_batch, 10) if a batch of images was provided. The parameters are ordered like so: hillas_parameters[..., 0]: intensity hillas_parameters[..., 1]: center of gravity x coordinate hillas_parameters[..., 2]: center of gravity y coordinate hillas_parameters[..., 3]: center of gravity radial coordinate radius (r) hillas_parameters[..., 4]: center of gravity radial coordinate angle (phi) hillas_parameters[..., 5]: ellipse length hillas_parameters[..., 6]: ellipse width hillas_parameters[..., 7]: ellipse angle with respect to x-axis (psi) in ]-pi/2, pi/2[ hillas_parameters[..., 8]: ellipse skewness hillas_parameters[..., 9]: ellipse kurtosis |
longitudinal_coordinates |
ndarray
|
Coordinates of the pixels along the long axis of the ellipsis. |
Source code in src/pyhiperta/hillas.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |