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

Reconstruction fix (also for Divergent Pointing) #946

Merged
merged 55 commits into from
Jul 17, 2019
Merged
Changes from 2 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8a9b821
Few bugs corrected in HillasIntersection after #896
Feb 1, 2019
9b58769
Create HorizonFrame with location and obstime.
Feb 4, 2019
e245120
horizon frame derived from array_pointing.frame
Feb 4, 2019
f99ae3d
Merge remote-tracking branch 'upstream/master' into small_coords_fix
Feb 9, 2019
89ae1fb
First change to HillasReconstructor for divergent
Feb 19, 2019
caddffa
Fixed coords in nominal frame ImPACT. small bug fix.
Feb 25, 2019
c8a7fd8
Telescopes pointings fixed. Remove plotting for debug.
Feb 25, 2019
96bdc8b
Merge branch 'master' into small_coords_fix
Feb 25, 2019
fddc013
Really remove plotting (not just comment).
Feb 25, 2019
d0b95c1
put back function where it was.
Feb 25, 2019
43c874a
Docstrings fix.
Feb 25, 2019
415ac8a
Merge remote-tracking branch 'upstream/master' into small_coords_fix
Feb 26, 2019
71479ce
Fix docstrings after merging.
Feb 27, 2019
fa6eea6
Fix docstrings and typos.
Feb 28, 2019
a12f105
Move NominalFrame to init. No need to compute it everytime.
Feb 28, 2019
16a0c19
Remove trial over different seeds. Increase time and physical perform…
Feb 28, 2019
8989e37
Add interpolator variables reset at each ImPACT.predict() call.
Feb 28, 2019
c1c00f1
typos fixed
Mar 15, 2019
170d04d
Merge remote-tracking branch 'upstream/master' into small_coords_fix
Mar 15, 2019
12e2fc4
Updated impact point reconstruction for divergent pointing.
Apr 30, 2019
38189c8
Fix test for HillasReconstructor. Flag divergent as True.
Apr 30, 2019
823a635
Fix Impact tests.
Apr 30, 2019
75cddab
Remove useless print and return in __init__
Apr 30, 2019
cd3756e
Merge remote-tracking branch 'upstream/master' into small_coords_fix
Apr 30, 2019
4fc8b19
Fixen lst bootcamp notebook.
May 3, 2019
82f848f
Fix stereo_reconstruction example
May 3, 2019
b302716
Fix for plot_theta_square
May 3, 2019
89b7c79
Fix reconstruction and tel_id instead of telescope_id
May 3, 2019
fb67869
Merge remote-tracking branch 'upstream/master' into small_coords_fix
Jun 12, 2019
5145b85
remove useless function calls in tests
Jun 12, 2019
60c2f83
remove useless print
Jun 12, 2019
3f00ab7
Fixed xmax reco with hillas intersection
Jun 12, 2019
63c3880
added test for xmax with hillas intersection
Jun 12, 2019
61f16ef
correct to_value conversion
Jun 12, 2019
27b9296
fix bug for hess weighting function
Jun 12, 2019
8e5c46e
simplify weight_sin function. remove np.fabs
Jun 12, 2019
2620b11
removed HESS weighting since equal to Konrad's. move weighting to init
Jun 12, 2019
68c86fa
More tests for the impact point reconstruction in tilted frame
Jun 12, 2019
c87e686
revert meters to radians. add test for nominal reconstruction.
Jun 12, 2019
3ee93aa
removed useless import
Jun 13, 2019
90d3711
fix codacy complainings
Jun 13, 2019
5d2cf66
fixed non used argument in function
Jun 13, 2019
3c99602
Fix codacy...again
Jun 13, 2019
c7f4828
Refactored HillasIntersector to use it as HillasReconstructor.
Jun 18, 2019
57ac9c4
Test Reconstructor for divergent pointing. tested with parallel file …
Jun 18, 2019
e6c397f
Added tests to HillasIntersection.
Jun 18, 2019
d07d6bb
copy hillas_dictionary before changing it
Jun 19, 2019
5432aaf
Remove divergent_mode flag from predict.
Jun 19, 2019
088a98c
Update test
Jun 19, 2019
d15a6af
Verify test_reconstruction is tested and not skipped
Jun 19, 2019
0ea4ce8
add single test for HillasReconstructor and HillasIntersection
Jun 19, 2019
161467b
Refactor warnings for both reconstructors. Warnings are in reco_algor…
Jun 19, 2019
8a440a9
Added traitlets to hillas_intersection
Jun 19, 2019
2405e2d
Docstrings fix
Jun 19, 2019
f5c847f
tests for reconstructors updated.
Jun 19, 2019
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
26 changes: 14 additions & 12 deletions ctapipe/reco/hillas_intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,22 @@ def predict(self, hillas_parameters, tel_x, tel_y, array_direction):
src_x, src_y, err_x, err_y = self.reconstruct_nominal(hillas_parameters)
core_x, core_y, core_err_x, core_err_y = self.reconstruct_tilted(
hillas_parameters, tel_x, tel_y)
err_x *= u.rad
err_y *= u.rad
err_x *= u.deg
err_y *= u.deg

nom = SkyCoord(
x=src_x * u.rad,
y=src_y * u.rad,
frame=NominalFrame(array_direction=array_direction)
sky_pos = SkyCoord(
az=src_x * u.deg,
alt=src_y * u.deg,
frame=HorizonFrame(location=array_direction.location, obstime=array_direction.obstime)
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it then SkyCoord(az=..., alt=..., frame=array_direction.frame)?

Copy link
Author

@thomasgas thomasgas Feb 4, 2019

Choose a reason for hiding this comment

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

yes! in this way all the information in the frame should be passed.

)
horiz = nom.transform_to(HorizonFrame())

nom_frame = NominalFrame(origin=array_direction)

nom = sky_pos.transform_to(nom_frame)

result = ReconstructedShowerContainer()
result.alt, result.az = horiz.alt, horiz.az
result.alt = nom.altaz.alt # src_y * u.deg
result.az = nom.altaz.az # src_x * u.deg

tilt = SkyCoord(
x=core_x * u.m,
Expand All @@ -99,7 +103,7 @@ def predict(self, hillas_parameters, tel_x, tel_y, array_direction):
result.core_y = grd.y

x_max = self.reconstruct_xmax(
nom.x, nom.y,
nom.altaz.az, nom.altaz.alt,
tilt.x, tilt.y,
hillas_parameters,
tel_x, tel_y,
Expand Down Expand Up @@ -135,7 +139,7 @@ def reconstruct_nominal(self, hillas_parameters, weighting="Konrad"):

Returns
-------
Reconstructed event position in the nominal system
Reconstructed event position in the horizon system

"""
if len(hillas_parameters) < 2:
Expand Down Expand Up @@ -185,8 +189,6 @@ def reconstruct_nominal(self, hillas_parameters, weighting="Konrad"):
var_x = np.average((sx - x_pos) ** 2, weights=weight)
var_y = np.average((sy - y_pos) ** 2, weights=weight)

# Copy into nominal coordinate

return x_pos, y_pos, np.sqrt(var_x), np.sqrt(var_y)

def reconstruct_tilted(self, hillas_parameters, tel_x, tel_y,
Expand Down