Skip to content

Commit

Permalink
Direction reconstruction (also) from Telescope Frame (cta-observatory…
Browse files Browse the repository at this point in the history
…#1408)

* build CameraGeometry frame correctly

* fix to work with spherical frames

added test, and fixed functionality of `CameraGeometry.transform_to()` to work with spherical frames like TelescopeFrame

* correctly recompute pixel area

* display CameraGeometry frame in default title

* fix rotation

* Modified HillasReconstructor

* remove some asumptions that coords are in meters

in a few places, `to_value(u.m)` was used to get a bare vector, however this fails when the camera is in a spherical frame.

* add test to go from spherical to cartesian

(currently fails)

* don't assume x,y coords when constructing SkyCoord

use positional keywords instead

* Add unit-test

* Generalize offset coordinate and divergent pointing

* simplify access to frame components in transform

* cleaned up imports

* Fixed array pointings in both tests for  reconstruction

* no need to recompute the neighbor list when transforming

* Ask for same shower coordinates between reconstructions

* Use arctan2 when calculating the major shower axis angle in the camera

* Adapt set_vector_hillas and set_line_hillas to telescope frame

* TEMPORARY modifications for testing in HillasReconstructor

* Add divergent mode corrected psi angle to hillas parameters.

* Use proper psi angle in array display methods

* Remove debug printings and test returns

* last fixes to Array Display

* Revert some coordinate flips

* Fix test_hillas_selected by compare NaN quantities as equals

* Fix Codacy complaints about unused imports

* Improve unit-test and merge it with the old one.

* Add new example of showers stereo reconstruction.

* Update CODEOWNERS

* Remove unnecessary pass statement

* Update public docstring

* Improve comments for divergent case

* Set az_uncert to same unique value of alt_uncert

* Fix little bug and add all missing test cases for ArrayDisplay

* improve test nan

* Improve test units

* Add divergent mode references

* Revert change to psi calculation

* Require new version of ctapipe-extra with Prod3b test files

* Fix minus sign in direction reconstruction result

* Add unit-test specific to divergent data shower reconstruction.

* Minus sign was right before (special case 180 vs -180)

* Fix unit bug in example

* Cleanup unit-test code

* update conda env to require latest version of ctapipe-extra

* remove ctapipe-extra from conda env, install with pip (no 0.3.1 package)

* Remove stale comment about missing unit-test for divergent case.

* Improve example

* Store psi core in dedicated container under ImageParametersContainer

* Remove the parallel case from Hillas reconstructor and record psi_core

* Update the tests for Hillas reconstructor

* Make ArrayDisplay line-vector hillas methods read psi_core from event

* Update ArrayDisplay tests

* removed stale divergent mode check

* Update ArrayDisplay methods docstrings

* Update example script

* Fix other tests

* Fix docstring of dl1eventsource

* update tutorials

* Update ctapipe.reco documentation

* Remove duplicate line in CODEOWNERS

* Fix docstring in unit-test for parallel pointing

* Update docstring of CoreParametersContainer

* Fix container docstrings

- Fix typo in CoreParametersContainer
- update ImageParametersContainer.core

* move comment in hillas parameters

* Partially revert docstring fix in Dl1EventSource

* Improve units check

* Generalize camera distances

* Make corrected psi angles dictionary a method argument

* Missed a code removal about corrected psi angles dictionary

* Update HillasIntersection docstring

* Refactor HillasReconstructor

* Update unit-tests

* Fix units error in HillasReconstructor

* Update ArrayDisplay methods

read a dictionary of core directions instead of the whole event.

* Update unit-tests

* Update example

* Simplify camera radii usage

* Remove unneeded line

* Remove old edits

* Rename camera radii variables

* Use camera descriptions to get camera radii

* Remove surplus code

* Remove unused imports and initialize ImageParametersContainer(s)

* Add unit-test for reco vs true

* Deepcopy event in test so to not overwrite session-scoped original event

* Fix bug in example

* Initialize null HillasParameters containers with degrees when needed

* Fix docs warnings

* strip output from the notebooks in docs/tutorials

* address review comments in hillas_reconstructor.py

* use example subarray in test_h_max_results

* fix syntax in test mpl

* fix syntax in test mpl

* update reconstructor

* Revert change to compare_result unit-test

* update test_reconstructors unit-test

* Update and address some comments in unit-tests of hillas reconstructor

* Update shower processor class

* Update theta square notebook

* Update LST analysis bootcamp 2018 notebook

* Remove unused imports from shower processor

* Fix loop variable

* fix variable namings in example

* Merge parallel and divergent tests into a single parametrized one

* Fix test imports

* Make example script a Tool

* Remove unused imports from example tool

* Remove example

* Revert docs

* Remove example images

Co-authored-by: Karl Kosack <[email protected]>
Co-authored-by: Michele Peresano <[email protected]>
Co-authored-by: Maximilian Nöthe <[email protected]>
  • Loading branch information
4 people authored Jul 5, 2021
1 parent a043d43 commit a02bd56
Show file tree
Hide file tree
Showing 13 changed files with 666 additions and 260 deletions.
5 changes: 5 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@

ctapipe/calib/camera @watsonjj
ctapipe/image/extractor.py @watsonjj @HealthyPear

ctapipe/reco/HillasReconstructor.py @HealthyPear
ctapipe/reco/tests/test_HillasReconstructor.py @HealthyPear

examples/stereo_reconstruction_core_and_direction.py @HealthyPear
11 changes: 11 additions & 0 deletions ctapipe/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"EventType",
"FlatFieldContainer",
"HillasParametersContainer",
"CoreParametersContainer",
"ImageParametersContainer",
"LeakageContainer",
"MonitoringCameraContainer",
Expand Down Expand Up @@ -213,6 +214,13 @@ class PeakTimeStatisticsContainer(StatisticsContainer):
container_prefix = "peak_time"


class CoreParametersContainer(Container):
"""Telescope-wise shower's direction in the Tilted/Ground Frame"""

container_prefix = "core"
psi = Field(nan * u.deg, "Image direction in the Tilted/Ground Frame", unit="deg")


class ImageParametersContainer(Container):
""" Collection of image parameters """

Expand All @@ -228,6 +236,9 @@ class ImageParametersContainer(Container):
peak_time_statistics = Field(
PeakTimeStatisticsContainer(), "Peak time image statistics"
)
core = Field(
CoreParametersContainer(), "Image direction in the Tilted/Ground Frame"
)


class DL1CameraContainer(Container):
Expand Down
1 change: 1 addition & 0 deletions ctapipe/image/hillas.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def hillas_parameters(geom, image):
vx, vy = eig_vecs[0, 1], eig_vecs[1, 1]

# avoid divide by 0 warnings
# psi will be consistently defined in the range (-pi/2, pi/2)
if length == 0:
psi = skewness_long = kurtosis_long = np.nan
else:
Expand Down
2 changes: 2 additions & 0 deletions ctapipe/reco/hillas_intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class HillasIntersection(Reconstructor):
Uncertainties on the positions are provided by taking the spread of the
crossing points, however this means that no uncertainty can be provided
for multiplicity 2 events.
Note: only input from CameraFrame is currently supported
"""

atmosphere_profile_name = traits.CaselessStrEnum(
Expand Down
Loading

0 comments on commit a02bd56

Please sign in to comment.