Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ImPACT code to work again #2305

Merged
merged 144 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
793179e
ImPACT updates to better match CTA standards
ParsonsRD Feb 15, 2021
57b0446
ImPACT updates to better match CTA standards
ParsonsRD Feb 15, 2021
7ce4efe
Pedestals now behave like an array rather than float
ParsonsRD Feb 15, 2021
359c81d
Updates to work with the newest CTA behaviours. Also improved testing…
ParsonsRD Feb 15, 2021
fbf810f
Updated to allow interpolation of templates in zenith and azimuth
ParsonsRD Feb 16, 2021
7895ed5
Moved some unrealted functions to the utilities file
ParsonsRD Feb 16, 2021
c68c80f
Fixed spe in likelihood to be array like
ParsonsRD Feb 16, 2021
ff58f23
Updates to work with multiple zenith angles
ParsonsRD Feb 17, 2021
22bf62e
Updated fit limits
ParsonsRD Feb 17, 2021
7eca0be
Removed function call from test
ParsonsRD Feb 17, 2021
5659993
Minor fixes
ParsonsRD Feb 17, 2021
4638d42
test fixes
ParsonsRD Feb 17, 2021
6e8f0db
Minor ImPACT updates
ParsonsRD Jul 21, 2021
4e67985
Merge branch 'master' into ImPACT_tests
ParsonsRD Jul 21, 2021
bd87702
Significant changes to ImPACT reconstructor, due to testing against H…
ParsonsRD Dec 3, 2021
2b801e5
Updates to ImPACT code to use standard reconstruction method
ParsonsRD Dec 3, 2021
deb7ec8
Minor ImPACT bug fix
ParsonsRD Dec 3, 2021
4f51ec8
Merge branch 'master' into ImPACT_tests
ParsonsRD Dec 3, 2021
b4c8a7b
Modifications for ctapipe v11
ParsonsRD Dec 3, 2021
8fdffd5
ImPACT test fix
ParsonsRD Dec 3, 2021
e8b0a53
Update to event reconstruction interface
ParsonsRD Dec 6, 2021
7f5b8be
Merge branch 'ImPACT_tests' of https://github.com/ParsonsRD/ctapipe i…
ParsonsRD Dec 6, 2021
7131aad
significant code optimisations
ParsonsRD Jan 28, 2022
ac09a42
Remove scaling
ParsonsRD Jan 28, 2022
664413f
Merge branch 'ImPACT_tests' of https://github.com/ParsonsRD/ctapipe i…
ParsonsRD Jan 28, 2022
f51e60b
Performance improvements
ParsonsRD Jan 31, 2022
ce823ae
Reverted changes to likelihood classs which broke the results
ParsonsRD Feb 4, 2022
77015e8
Change back likelihood function names
ParsonsRD Feb 4, 2022
2c73c03
Speed up to imterpolator
ParsonsRD Feb 4, 2022
727b737
Added goodness of fit calculation
ParsonsRD Feb 4, 2022
82f3a2e
Added comments
ParsonsRD Feb 4, 2022
7c9c646
Including timing information in the fit
ParsonsRD Feb 15, 2022
24ef2e1
Added reset of time prediction code
ParsonsRD Feb 17, 2022
7f36f22
Made updates to minimisation procedure to decrease computation time
ParsonsRD Feb 22, 2022
52c3306
Merge branch 'master' of https://github.com/cta-observatory/ctapipe i…
ParsonsRD Jul 27, 2022
bf88048
Merged hillas_intersection to master branch
ParsonsRD Jul 27, 2022
ccc1e3b
Fixed error in core reconstruction
ParsonsRD Jul 29, 2022
9329e16
Removed unused functions from impact_utilities
ParsonsRD Jul 29, 2022
2a24376
Updated impact to work with shower_processor
ParsonsRD Jul 29, 2022
5c62604
Updates to time gradient likelihood terms.
ParsonsRD Aug 3, 2022
9b23de7
Fixed bug in core intersection position
ParsonsRD Aug 3, 2022
b67d68c
Fixes to binning issue in interpolator
ParsonsRD Aug 4, 2022
5b0ba8a
Improved tests for ImPACT code
ParsonsRD Aug 4, 2022
c62bbd1
Removed unused functions
ParsonsRD Aug 4, 2022
61ca2e7
Change test bin numbers
ParsonsRD Aug 5, 2022
f0186a2
Preminimisation fixes
ParsonsRD Aug 10, 2022
95ca4d3
Fix to file opening
ParsonsRD Aug 10, 2022
df9ded4
Added template directory trait
ParsonsRD Aug 10, 2022
96e956a
Added improved ImPACT tests
ParsonsRD Aug 11, 2022
5242525
Added ImPACT container for likelihood output
ParsonsRD Aug 11, 2022
ac988e2
Changes to pixel likelihood function to work better with ImPACT
ParsonsRD Aug 11, 2022
8c2b262
Merge branch 'master' of https://github.com/cta-observatory/ctapipe i…
ParsonsRD Aug 11, 2022
9fefc85
Fix merge errors
ParsonsRD Aug 11, 2022
8e0fd9b
Fix more merge errors
ParsonsRD Aug 11, 2022
4c60c2a
Merge error
ParsonsRD Aug 11, 2022
9fa0944
Merge fix
ParsonsRD Aug 11, 2022
324f34c
Removed print statement
ParsonsRD Aug 11, 2022
6b81b19
Fix merge errors
ParsonsRD Aug 11, 2022
1a6562d
Readded telescope info
ParsonsRD Aug 11, 2022
97e5d4b
Fixed fomatting errors
ParsonsRD Aug 11, 2022
7b4bd58
Removed unused import statement
ParsonsRD Aug 11, 2022
9050454
Fix unstructured interpolator tests
ParsonsRD Aug 11, 2022
76c672e
Ran "black" on everything
ParsonsRD Aug 11, 2022
3d38054
Merge branch 'ImPACT' into ImPACT_tests
Tobychev Mar 16, 2023
5cb5ddc
Merge pull request #1 from ParsonsRD/ImPACT_tests
Tobychev Mar 16, 2023
b5f58bd
Fixes to imports and attempts to get shower_processor trought the tes…
Tobychev Mar 17, 2023
91065a7
Pulled in latest version of shower reconstruction from main
Tobychev Mar 17, 2023
5807d1e
Working on support for multiple recos
Tobychev Mar 17, 2023
a36b4cc
Working on support for multiple recos
Tobychev Mar 17, 2023
8b6a27c
Working on support for multiple recos
Tobychev Mar 17, 2023
4ba9b45
Fixed typo
Tobychev Mar 17, 2023
f4fff5b
Fixed failing tests due to new names
Tobychev Mar 17, 2023
eaa9fd4
Merge branch 'ManyRecos' into ImPACT
Tobychev Mar 17, 2023
85eed5f
Add property flags to ImPACT reconstructor
Tobychev Mar 17, 2023
24fede0
Merge Rename
Tobychev Mar 18, 2023
61e1a86
Changed to subclassing from HillasGeometryReconstructor
Tobychev Mar 22, 2023
9a6ad8a
Disable the skip of the tests along with some small fixes of imports
Tobychev Apr 4, 2023
502fb48
Passes all tests, but requires disabling deprecation of old atmospher…
Tobychev Apr 4, 2023
7e35c91
Modified test so that asser for finite results only happens on valid …
Tobychev Apr 4, 2023
cbb2995
Don't remove depreciation, instread tell pytest it is expected
Tobychev Apr 4, 2023
fd7d330
Ran black and removed unused import I'd forgotten to take out
Tobychev Apr 4, 2023
43bd6b7
Undo foolish edits to the test
Tobychev Apr 5, 2023
75c5804
Update call to follow the interface expected of reconstructors, renam…
Tobychev Apr 5, 2023
711e004
Updated ImPACT tests to match new reconstructor interface, cleaned up…
Tobychev Apr 5, 2023
e338d42
restructured parametrisation to handle (temporarily) expected ImPACT …
Tobychev Apr 6, 2023
c1d6769
Added impact reco to the test
Tobychev Apr 6, 2023
31e87a9
Renamed vertices to simplices to comply with scipy depreciation
Tobychev Apr 6, 2023
dd5262c
First implementation of energy seed
gschwefer Apr 26, 2023
19e7538
Add saving the impact parameters when reco works
gschwefer May 5, 2023
31867bb
Add short changelog
Tobychev May 11, 2023
ba3c0fe
Ran linters and formatters
Tobychev May 11, 2023
c645c05
Moved catching of atmosphere depreciation warning to tests
Tobychev May 12, 2023
7ddf09f
Was double catching warning, removed it from testing
Tobychev May 12, 2023
564d9c0
Fixed jitting not working in test due to incorrectly giving translati…
Tobychev May 12, 2023
5624ea6
Rebased on main
Tobychev May 12, 2023
53c6d3e
Sorted imports
May 12, 2023
0e37495
Sort imports
May 12, 2023
271ac9d
Fix muon code for changed API of pixel likelihoods
maxnoe May 15, 2023
dd9c1a4
Adjust number of tested events so the test pass
Tobychev May 15, 2023
dedce82
Remove energy preminimization, require energy seed
gschwefer Aug 16, 2023
b0ef014
Removed preminimization args from minimize func
gschwefer Aug 16, 2023
1a2d862
Remove final occurence of preminimisation
gschwefer Aug 16, 2023
dd912f0
A couple of comments
gschwefer Aug 22, 2023
3fe353a
Made array height variable from subarray
gschwefer Aug 29, 2023
a330a82
Fixed numeric logL to match approx, all vectorized
gschwefer Aug 29, 2023
5f698ea
Fixed datatypes and sign for mean calculation
gschwefer Aug 29, 2023
b0453bc
Tests vectorized and passing
gschwefer Aug 29, 2023
0256ab5
Changed docstring
gschwefer Aug 29, 2023
67de2d3
Added unit test for mean approx. likelihood
gschwefer Aug 29, 2023
494a5e0
factor 2 because of change in likelihood & flake8
gschwefer Aug 29, 2023
880e334
Fixed mask in combined pixel likelihood
gschwefer Sep 1, 2023
f82395d
Consistent naming of xmax and column density
gschwefer Sep 14, 2023
d726353
Rename min to minimizer and remove assign to self
gschwefer Sep 15, 2023
d5746fb
Moved miunuit settings to global constants
gschwefer Sep 15, 2023
d7bad12
Migrad iterate now global variable
gschwefer Sep 15, 2023
7da9f90
Removed unnecessary ImPACTLikelihoodContainer
gschwefer Sep 15, 2023
3638f63
Goodness of fit now also from reconstructed energy
gschwefer Sep 18, 2023
1d6e18f
Adjustments for time likelihood
gschwefer Sep 20, 2023
156d941
Add SST-Camera to ped_table
gschwefer Sep 20, 2023
0ce2180
Remove offset dependence from TemplateInterpolator
gschwefer Sep 21, 2023
d9172ba
Guard against neg. uncertainties in time templates
gschwefer Sep 22, 2023
3843173
Merge remote-tracking branch 'origin/main' into ImPACT
gschwefer Oct 26, 2023
6a9379e
Removed unused import
gschwefer Oct 26, 2023
2b05ec1
Impact tests passing now
gschwefer Oct 27, 2023
22c40f2
Pixel likelihood tests passing now
gschwefer Oct 27, 2023
3120f08
ran black and isort
gschwefer Oct 27, 2023
7b321ab
isort again
gschwefer Oct 27, 2023
552ec1f
isort again again
gschwefer Oct 27, 2023
4740ebc
Linting
Tobychev Oct 27, 2023
61ff14d
Update 2305.feature.rst
Tobychev Mar 22, 2024
919cee9
Merge branch 'main' into ImPACT
gschwefer Apr 5, 2024
1e138fa
Merge branch 'ImPACT' of https://github.com/Tobychev/ctapipe into ImPACT
gschwefer Apr 5, 2024
8018e00
Fix linting in changelog file
gschwefer Apr 5, 2024
a291cea
Implement proper atmosphere module in impact code
gschwefer Apr 10, 2024
22fde37
Change reconstructor API to include atmosphere
gschwefer Apr 12, 2024
b789dc0
Update atmosphere in ImPACT tests
gschwefer Apr 12, 2024
7bfed1e
Include atmopshere_profile in ShowerProcessor
gschwefer Apr 12, 2024
cb3bde6
Make atmoprofile optional arg for ShowerProcessor
gschwefer Apr 12, 2024
243f641
Add atmo to ShowerProcessor init in process tool
gschwefer Apr 12, 2024
5d35794
Use effective focal length
gschwefer Apr 12, 2024
19ae78a
Don't use template remember function
gschwefer Apr 12, 2024
9daf9dc
Workaround for numba not supporting masked arrays
maxnoe Apr 15, 2024
51f5fc9
Simplify
maxnoe Apr 15, 2024
84e075e
Fix test: make pixel coordinates a masked array
gschwefer Apr 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/changes/2305.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Large updates to the Image Pixel-wise fit for Atmospheric Cherenkov Telescopes reconstruction method (https://doi.org/10.48550/arXiv.1403.2993)

* ImPACT - General code clean up and optimisation. Now updated to work similarly to other reconstructors using the standardised interface, such that it can be used ctapipe-process. Significant improvements to tests too
* ImPACT_utilities - Created new file to hold general usage functions, numba used in some areas for speedup
* template_network_interpolator - Now works with templates with different zenith and azimuth angles
* unstructured_interpolator - Significant speed improvements
* pixel_likelihood - Constants added back to neg_log_likelihood_approx, these are quite important to obtaining a well normalised goodness of fit.
* hillas_intersection - Fixed bug in core position being incorrectly calculated, fixed tests too
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a sentence about atmosphere_profile now being an argument to Reconstructor()?

2 changes: 1 addition & 1 deletion src/ctapipe/image/muon/intensity_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def negative_log_likelihood(
# scale prediction by optical efficiency of the telescope
prediction *= optical_efficiency_muon

return neg_log_likelihood_approx(image, prediction, spe_width, pedestal)
return neg_log_likelihood_approx(image, prediction, spe_width, pedestal).sum()

return negative_log_likelihood

Expand Down
58 changes: 31 additions & 27 deletions src/ctapipe/image/pixel_likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ def neg_log_likelihood_approx(image, prediction, spe_width, pedestal):

Returns
-------
float
ndarray
"""
theta = pedestal**2 + prediction * (1 + spe_width**2)

neg_log_l = 0.5 * (
np.log(2 * np.pi * theta + EPSILON) + (image - prediction) ** 2 / theta
)
theta = 2 * (pedestal**2 + prediction * (1 + spe_width**2))
neg_log_l = np.log(np.pi * theta) / 2.0 + (image - prediction) ** 2 / theta

return np.sum(neg_log_l)
return neg_log_l


def neg_log_likelihood_numeric(
Expand All @@ -123,14 +121,14 @@ def neg_log_likelihood_numeric(

Returns
-------
float
ndarray
"""

epsilon = np.finfo(np.float64).eps

prediction = prediction + epsilon

likelihood = epsilon
likelihood = np.full_like(prediction, epsilon, dtype=np.float64)

n_signal = np.arange(poisson(np.max(prediction)).ppf(confidence) + 1)

Expand All @@ -147,7 +145,7 @@ def neg_log_likelihood_numeric(
)
likelihood += _l

return -np.sum(np.log(likelihood + EPSILON))
return -np.log(likelihood)


def neg_log_likelihood(image, prediction, spe_width, pedestal, prediction_safety=20.0):
Expand All @@ -173,27 +171,33 @@ def neg_log_likelihood(image, prediction, spe_width, pedestal, prediction_safety

Returns
-------
float
ndarray
"""

approx_mask = prediction > prediction_safety

neg_log_l = 0
neg_log_l = np.zeros_like(image, dtype=np.float64)
if np.any(approx_mask):
neg_log_l += neg_log_likelihood_approx(
image[approx_mask], prediction[approx_mask], spe_width, pedestal
neg_log_l[approx_mask] += neg_log_likelihood_approx(
image[approx_mask],
prediction[approx_mask],
spe_width[approx_mask],
pedestal[approx_mask],
)

if not np.all(approx_mask):
neg_log_l += neg_log_likelihood_numeric(
image[~approx_mask], prediction[~approx_mask], spe_width, pedestal
neg_log_l[~approx_mask] += neg_log_likelihood_numeric(
image[~approx_mask],
prediction[~approx_mask],
spe_width[~approx_mask],
pedestal[~approx_mask],
)

return neg_log_l


def mean_poisson_likelihood_gaussian(prediction, spe_width, pedestal):
"""Calculation of the mean likelihood for a give expectation
"""Calculation of the mean of twice the negative log likelihood for a give expectation
value of pixel intensity in the gaussian approximation.
This is useful in the calculation of the goodness of fit.

Expand All @@ -208,12 +212,12 @@ def mean_poisson_likelihood_gaussian(prediction, spe_width, pedestal):

Returns
-------
float
ndarray
"""
theta = pedestal**2 + prediction * (1 + spe_width**2)
mean_log_likelihood = 1 + np.log(2 * np.pi) + np.log(theta + EPSILON)

return np.sum(mean_log_likelihood)
return mean_log_likelihood


def _integral_poisson_likelihood_full(image, prediction, spe_width, ped):
Expand All @@ -229,7 +233,7 @@ def _integral_poisson_likelihood_full(image, prediction, spe_width, ped):

def mean_poisson_likelihood_full(prediction, spe_width, ped):
"""
Calculation of the mean likelihood for a give expectation value
Calculation of the mean of twice the negative log likelihood for a give expectation value
of pixel intensity using the full numerical integration.
This is useful in the calculation of the goodness of fit.
This numerical integration is very slow and really doesn't
Expand All @@ -246,21 +250,21 @@ def mean_poisson_likelihood_full(prediction, spe_width, ped):

Returns
-------
float
ndarray
"""

if len(spe_width) == 1:
spe_width = np.full_like(prediction, spe_width)
spe_width = np.full_like(prediction, spe_width, dtype=np.float64)

if len(ped) == 1:
ped = np.full_like(prediction, ped)
ped = np.full_like(prediction, ped, dtype=np.float64)

mean_like = 0
mean_like = np.zeros_like(prediction, dtype=np.float64)

width = ped**2 + prediction * spe_width**2
width = np.sqrt(width)

for pred, w, spe, p in zip(prediction, width, spe_width, ped):
for i, (pred, w, spe, p) in enumerate(zip(prediction, width, spe_width, ped)):
lower_integration_bound = pred - 10 * w
upper_integration_bound = pred + 10 * w

Expand All @@ -272,7 +276,7 @@ def mean_poisson_likelihood_full(prediction, spe_width, ped):
epsrel=0.05,
)

mean_like += integral
mean_like[i] = integral

return mean_like

Expand All @@ -294,10 +298,10 @@ def chi_squared(image, prediction, pedestal, error_factor=2.9):

Returns
-------
float
ndarray
"""

chi_square = (image - prediction) ** 2 / (pedestal + 0.5 * (image - prediction))
chi_square *= 1.0 / error_factor

return np.sum(chi_square)
return chi_square
28 changes: 14 additions & 14 deletions src/ctapipe/image/tests/test_pixel_likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_chi_squared():
chi = chi_squared(image, prediction, ped)
bad_chi = chi_squared(image, bad_prediction, ped)

assert chi < bad_chi
assert np.sum(chi) < np.sum(bad_chi)


def test_mean_poisson_likelihoood_gaussian():
Expand All @@ -30,7 +30,7 @@ def test_mean_poisson_likelihoood_gaussian():
small_mean_likelihood = mean_poisson_likelihood_gaussian(prediction, spe, 0)
large_mean_likelihood = mean_poisson_likelihood_gaussian(prediction, spe, 1)

assert small_mean_likelihood < large_mean_likelihood
assert np.all(small_mean_likelihood < large_mean_likelihood)

# Test that the mean likelihood of abunch of samples drawn from the gaussian
# behind the approximate log likelihood is indeed the precalculated mean
Expand All @@ -48,7 +48,7 @@ def test_mean_poisson_likelihoood_gaussian():
)

rel_diff = (
2 * neg_log_likelihood_approx(normal_samples, prediction[0], spe, ped) / 100000
np.mean(2 * neg_log_likelihood_approx(normal_samples, prediction[0], spe, ped))
- mean_likelihood
) / mean_likelihood

Expand All @@ -63,7 +63,7 @@ def test_mean_poisson_likelihood_full():
small_mean_likelihood = mean_poisson_likelihood_full(prediction, spe, [0.1])
large_mean_likelihood = mean_poisson_likelihood_full(prediction, spe, [1])

assert small_mean_likelihood < large_mean_likelihood
assert np.all(small_mean_likelihood < large_mean_likelihood)


def test_full_likelihood():
Expand All @@ -72,30 +72,30 @@ def test_full_likelihood():
signal cases. Check that full calculation and the gaussian approx become
equal at high signal.
"""
spe = 0.5 # Single photo-electron width
pedestal = 1 # width of the pedestal distribution
spe = 0.5 * np.ones(3) # Single photo-electron width
pedestal = np.ones(3) # width of the pedestal distribution

image_small = np.array([0, 1, 2])
expectation_small = np.array([1, 1, 1])

full_like_small = neg_log_likelihood(image_small, expectation_small, spe, pedestal)
exp_diff = full_like_small - np.sum(
np.asarray([1.37815294, 1.31084662, 1.69627197])
)
exp_rel_diff = (
full_like_small - np.asarray([1.37815294, 1.31084662, 1.69627197])
) / full_like_small

# Check against known values
assert np.abs(exp_diff / np.sum(full_like_small)) < 1e-4
assert np.all(np.abs(exp_rel_diff) < 3e-4)

image_large = np.array([40, 50, 60])
expectation_large = np.array([50, 50, 50])

full_like_large = neg_log_likelihood(image_large, expectation_large, spe, pedestal)
# Check against known values
exp_diff = full_like_large - np.sum(
np.asarray([3.72744569, 2.99652694, 3.83113004])
)
exp_rel_diff = (
full_like_large - np.asarray([3.78183004, 2.99452694, 3.78183004])
) / full_like_large

assert np.abs(exp_diff / np.sum(full_like_large)) < 3e-4
assert np.all(np.abs(exp_rel_diff) < 3e-5)

gaus_like_large = neg_log_likelihood_approx(
image_large, expectation_large, spe, pedestal
Expand Down
15 changes: 7 additions & 8 deletions src/ctapipe/reco/hillas_intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from .reconstructor import (
HillasGeometryReconstructor,
InvalidWidthException,
ReconstructionProperty,
TooFewTelescopesException,
)

Expand Down Expand Up @@ -90,19 +91,17 @@ class HillasIntersection(HillasGeometryReconstructor):
Note: only input from CameraFrame is currently supported
"""

atmosphere_profile_name = traits.CaselessStrEnum(
["paranal"], default_value="paranal", help="name of atmosphere profile to use"
).tag(config=True)

weighting = traits.CaselessStrEnum(
["Konrad", "hess"], default_value="Konrad", help="Weighting Method name"
).tag(config=True)

def __init__(self, subarray, **kwargs):
property = ReconstructionProperty.GEOMETRY

def __init__(self, subarray, atmosphere_profile=None, **kwargs):
"""
Weighting must be a function similar to the weight_konrad already implemented
"""
super().__init__(subarray, **kwargs)
super().__init__(subarray, atmosphere_profile, **kwargs)

# We need a conversion function from height above ground to depth of maximum
# To do this we need the conversion table from CORSIKA
Expand Down Expand Up @@ -423,8 +422,8 @@ def reconstruct_tilted(self, hillas_parameters, tel_x, tel_y):
hillas2 = np.transpose(hillas2)

# Perform intersection
crossing_x, crossing_y = self.intersect_lines(
tel_x[:, 0], tel_y[:, 0], hillas1[0], tel_x[:, 1], tel_y[:, 1], hillas2[0]
crossing_y, crossing_x = self.intersect_lines(
tel_y[:, 0], tel_x[:, 0], hillas1[0], tel_y[:, 1], tel_x[:, 1], hillas2[0]
)

# Weight by chosen method
Expand Down
8 changes: 6 additions & 2 deletions src/ctapipe/reco/hillas_reconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ class that reconstructs the direction of an atmospheric shower

"""

def __init__(self, subarray: SubarrayDescription, **kwargs):
super().__init__(subarray=subarray, **kwargs)
def __init__(
self, subarray: SubarrayDescription, atmosphere_profile=None, **kwargs
):
super().__init__(
subarray=subarray, atmosphere_profile=atmosphere_profile, **kwargs
)
_cam_radius_m = {
cam: cam.geometry.guess_radius().to_value(u.m)
for cam in subarray.camera_types
Expand Down
Loading