-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add pointing interpolated values #223
Conversation
- Added filling gps_time field with the timestamps taken from UCTS - When the UCTS timestamps are not availables take time info from TIB NTP counters - This time will be used to interpolate the pointing direction for each event
- Takes the timing info previously defined
- The drive log with pointing can be parse as an input optional argument. - The pointing info is added only when this file is parsed. - Otherwise the only new parameter that dl1 files contain is gps_time taken from UCTS or TIB.
This is an example of how to run the script adding pointing information:
simply parsing the path to the drive log file. The problem at this moment is that one has to check first which drive report file should use because they usually mix several days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks overall good.
I haven't tested with real data.
I am working on getting a real data sample for unit tests, in the meantime, did you run it on real data and get a proper DL1 output ?
lstchain/reco/dl0_to_dl1.py
Outdated
ucts_timestamp = event.lst.tel[telescope_id].evt.ucts_timestamp | ||
|
||
if ucts_timestamp != 0: | ||
ns = 1e-9 # Convert nanosecs to secs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using astropy units has been on the todo list for a long time.
Starting now would be great :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lstchain/reco/dl0_to_dl1.py
Outdated
dl1_container.gps_time = gps_time | ||
|
||
if pointing_file_path: | ||
pointing_file = pointing_file_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Yes, I tested it with one subrun of real data on my laptop I think getting proper output values. |
@morcuended dl1ab test is failing. |
I think it is because that branch was merged in the meanwhile and I did not pull it to my local repo. Will fix it and push again |
I do not understand why is failing though. The scripts I modified are not dependant on lstchain_mc_dl1ab.py. I pulled the changes on my local repo and ran pytest. It's failing too. What should I do? |
After pulling the master, did you merge it? |
Oh, I forgot that last step. I just pushed my branch again. |
Still failing |
Last changes are not merged yet. Can you do: |
@morcuended weird it's not failing on my system, I'm investigating. |
|
@morcuended actually, master is failing.... |
I see. However, when PR #222 was merged, all tests had passed, right? |
That's why I am a bit confused right now. Working on patch... |
#224 should fix the issue. |
@morcuended please merge the new master, after #224 fix tests should pass. |
Just did it. I think tests are OK now. Thanks a lot, @vuillaut and @rlopezcoto |
Here is the modification to add non-empty gps_time and interpolate the pointing values event-wise from the values contained in the Drive log files.
Something weird happened: I thought I had made a fresh installation of the lstchain repo yesterday, following the instructions written en the README. However, apparently the ctapipe-io-lst package was not pointing to the last version v0.2 as it is specified in environment.yml. So some names within the LSTDriveContainer were not properly set. I had to reinstall it manually to make everything work.
Disclaimer: When adding the pointing interpolated values, the code becomes substantially slower. Maybe this could be optimized. Perhaps it is due to the large file size of the Drive log.
Please have a look and let me know if you have any comment/suggestion