-
Notifications
You must be signed in to change notification settings - Fork 44
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
Transform back the predicted quantities into proper the space for real data #200
Conversation
@BastienLacave For a (non-negligible) number of the files produced by you, the length of the pointing table is not equal to the number of cosmic events (i.e. length of the dl1b parameter table). I thought the interpolation of the pointing already took place inside the |
I have checked one of the affected files and they do seems okay. In a sense that the range of time stamps overlays. However, the pointing table is just shorter. I checked the |
Hi @TjarkMiener Recent version of ctapipe have changed how pointing data is handled. See the following issues and change log notes: Changelog of 0.21: Issues:
PRs: So we don't store event wise pointing information in output files anymore, neither for simulations (where it was constant) nor for observations (where it was interpolated from a much coarser pointing table). Instead, we added support for interpolating pointing when reading back dl1 / dl2 files (both in This expectes a monitoring pointing table at You can find the code I used to attach LST pointing reports to ctapipe dl1 files here: |
Thanks a lot for the confirmation @maxnoe! So we need to use |
Needed to append the info to properly store it in the dl2 panda df
Hi @maxnoe |
I don't know what you are doing, but I can hardly believe that the interpolation here is really the bottleneck. I performance tested this just now, and for me interpolating for a realistic test case (2 hours of pointing data, one sample every 2 seconds) interpolating 10000 / 100000 events that are randomly distributed in 15 minutes takes < 1 ms. So I don't see how the interpolation can be a bottleneck in any meaningful evaluation of a machine learning model. In [38]: from astropy.time import Time
In [39]: from astropy.table import Table
In [40]: from ctapipe.io.pointing import PointingInterpolator
In [41]: import numpy as np
In [42]: t = Time.now() + np.arange(0, 7200, 2) * u.s
In [44]: alt = np.linspace(40, 50, len(t)) * u.deg
In [45]: az = np.linspace(0, 30, len(t)) * u.deg
In [46]: table = Table({"time": t, "altitude": alt, "azimuth": az})
In [47]: interpolator = PointingInterpolator()
In [48]: interpolator.add_table(1, table)
In [49]: event_t = (t[0] + np.random.uniform(0, 15 * 60, 100000) * u.s).sort()
In [50]: %timeit interpolator(tel_id=1, time=event_t)
898 µs ± 862 ns per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
You mean storing the reconstructed direction in an other frame than |
Ohhh, thanks a lot for this code snippet @maxnoe. Made me realize that one can provide the |
When predicting on real data, we predict in the "space" based on the selected Transform in dl1dh during training with MCs. In order to transform back the predicted quantities, this PR is needed.
Requires DL1DH#140