Skip to content

Conversation

@inti-abbate
Copy link

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.

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).
@tkittel tkittel changed the base branch from master to develop September 5, 2022 09:42
@tkittel
Copy link
Member

tkittel commented Sep 5, 2022

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,
Thomas

@inti-abbate
Copy link
Author

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).

@tkittel
Copy link
Member

tkittel commented Sep 5, 2022

Great. And feel free to ping me in a few weeks time if I haven't come back to this 😃

@tkittel
Copy link
Member

tkittel commented Apr 1, 2025

@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.

@tkittel
Copy link
Member

tkittel commented Apr 25, 2025

@inti-abbate @norberto-schmidt it is my fault for taking so long, but is anyone around to contribute to this PR any more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants