-
Notifications
You must be signed in to change notification settings - Fork 15
Add hooks for TRIPOLI-4, MCNP-PTRAC and ASCII-SSV #62
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
base: develop
Are you sure you want to change the base?
Conversation
Based on the existent hooks (MCNP SSW, PHITS), new ones for PTRAC files from MCNP(X) and stock files from TRIPOLI-4 (STORAGE) were added. Both formats are text based, and so is the processing made by the added functions. Only the applications for converting to MCPL were included (ptrac2mcpl, stock2mcpl).
Add ASCII-SSV format compatibility. This includes a mcpl2ssv hook, which redirects to mcpltool --text, and a ssv2mcpl hook, with the inverse functionality. Also add save2ascii and apend2ascii functions in Python API, which allow saving a particle list with numpy array format into an ASCII-SSV file, which then can be converted to MCPL format. This adds an indirect way of writing MCPL files from Python (github issue mctools#54).
|
Thanks for the contribution @inti-abbate, TRIPOLI support will certainly be nice to have! It will be a little while before I will have a chance to take a look at it though (a bit busy the next few weeks). For now I have changed the target branch to develop (I try to keep the HEAD of master the same as the lastest release). For good measure I have to ask you to verify that you are aware that the contribution will be included under our license (CC0) as per the LICENSE file, and that you are not adding any files which are not OK for that license. Cheers, |
|
Thanks for the answer @tkittel! Sure, take all the time you need :) I understand that the contributed files will be included under the MCPL licence (CC0). |
|
Great. And feel free to ping me in a few weeks time if I haven't come back to this 😃 |
|
@inti-abbate @norberto-schmidt Sorry for letting this PR stale so long. I am currently revamping MCPL (see #80) and after that it might be I could find some time and we could see about adopting this in the new mcpl-extra package (next to ssw2mcpl/mcpl2ssw/phits2mcpl/mcpl2phits). However, for that to happen, we would need to write some tests, so I can warn you already that we would need some tests and test data to exercise these new capabilities. |
|
@inti-abbate @norberto-schmidt it is my fault for taking so long, but is anyone around to contribute to this PR any more? |
New hooks for TRIPOLI-4 STOCK (STORAGE option), MCNP's PTRAC and ASCII SSV formats.
This includes the following new commands: "stock2mcpl", "ptrac2mcpl", "ssv2mcpl" and "mcpl2ssv" (the last is equivalent to "mcpltool --text"). Conversion from MCPL to STOCK or PTRAC were not implemented. The functions for reading STOCK and PTRAC formats were based on the existing ones for SSW format, but do not check the header information (e.g.: code version). Examples of particles lists in STOCK, PTRAC and SSV formats are included.