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

Use the impact distance calculation from ctapipe. #209

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

aleberti
Copy link
Collaborator

Until now, we were using a function internal to MCP to calculate the impact distance. Since ctapipe provides it and it is calculated when calling the HillasReconstructor, it makes sense to use that.

@aleberti aleberti added refactoring For code refactoring maintenance Maintenance related labels Feb 22, 2024
@aleberti
Copy link
Collaborator Author

aleberti commented Feb 26, 2024

As a cross-check, find attached the (real data) stereo files from the tests created with the current version from the master and the version from this branch. The calculated impact distances are consistent:

In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: df_orig = pd.read_hdf("dl1_stereo_MAGIC_LST-1.Run15337.0002_original.h5", key="events/parameters")

In [4]: df_new = pd.read_hdf("dl1_stereo_MAGIC_LST-1.Run15337.0002.h5", key="events/parameters")

In [5]: impact_orig = np.array(df_orig["impact"])

In [6]: impact_new = np.array(df_new["impact"])

In [7]: np.allclose(impact_new, impact_orig, equal_nan=True)
Out[7]: True

impact_check.zip

@aleberti
Copy link
Collaborator Author

aleberti commented Sep 6, 2024

@jsitarek can you quickly review this PR? It is here since a long time

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.23%. Comparing base (01f273d) to head (7017ee3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #209   +/-   ##
=======================================
  Coverage   77.23%   77.23%           
=======================================
  Files          21       21           
  Lines        2614     2614           
=======================================
  Hits         2019     2019           
  Misses        595      595           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance related refactoring For code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant