-
Notifications
You must be signed in to change notification settings - Fork 8
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
Refactor MC DL0 to DL1 script #75
Conversation
@YoshikiOhtani I would like to keep the information about the type of telescope available in the muon file. |
@gabemery yes sure, please push commits to this branch, sorry for that I changed it without consulting with you...! |
It is done. Now in your script the subarray.tel[tel_id].name is used to keep information about the telescope type in the muon file. |
Thanks a lot for the commit @gabemery. Any other comments/suggestions are very welcome. |
The changes look fine to me! |
I faced an issue that some of the files processed with this refactored script cannot be merged with the merge_hdf_files.py script. I found that it is because the data type of the leakage parameters are different between the files, and if the first processed event is MAGIC it is np.float32, and if LST-1 it is np.float64. Actually it comes from the difference of the type of the EDIT: for more information, the data types of the DL1 table columns are defined based on the first output event, so if the leakage columns are defined as np.float64 by a LST event, the leakage parameters of next MAGIC events will be saved as np.float64. That's why we didn't see this problem in the past, since we processed the events telescope wise (first LST, next M1, and last M2). |
…-pipe into refactor-mcdl0todl1
Hi, I gradually come back to my work and now I pushed several new commits to this blanch. Let me summarize what I changed here. First of all I modified the script based on comments by flake8 with max-line-length = 90. I actually used pylint with the rc file but found that it is too strict and seems not to be considered well even in ctapipe. It looks to be used for Codacy check, but most of pull requests were merged without satisfying it. And also I prefer to use flake8 because it is simply faster than pylint. |
So, do you need another review on this? |
Hi @aleberti, if you have time, yes please! But please note that I just pushed a few last-minute commits for the DISP and off-axis angle calculations. If you are fine with these |
well, lmk when you are done with the commits and I can check the new changes. |
btw, do not worry about the failed tests in the CI... |
I'm already done with this script/pull request so it is ready for your review. What I meant is that I will do the similar modifications to the other pull requests. Sorry for the confusion!
Yes sure :-) |
OK, I checked the code. Changes with black/isort are kind of safe I would say, so nothing much to say. All the other changes look good, so green light from my side. |
Thank you very much for your checks. Since I want to use the new function to the other script, let me merge this pull request now. |
In the pull request #72 there was a confusion related to the event source which is created several times in the MC DL0 to DL1 script. This actually could make confusions again in the future when we adapt the script to the cta-process tool. Then by looking into the script I found that it is not absolutely necessary and could be more simplified. So with this pull request I refactored the code by creating the event source only once, and also with the following minor changes:
subarray.tel[tel_id].camera.geometry.frame
instead of creating them inside the scriptI confirmed that this pull request does not change the output results so I think I can safely merge it to the master branch. But I will keep it here a few days and so please let me know if you have any further requests or comments, especially @aleberti, @jsitarek and @gabemery. Otherwise I will merge it at the beginning of next week. Thanks!