Skip to content
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

Trying to read source.precpoints output file #304

Open
ghost opened this issue Apr 12, 2019 · 3 comments
Open

Trying to read source.precpoints output file #304

ghost opened this issue Apr 12, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2019

The binary file is supposed to contain in following order: x, y, z coordinates for delayed neutron precursors, 1, 0, 0,1, wgt (statistical weight ) and g (precursor group) for all stored precursors.

Code for reproducing the issue

import serpentTools
res = serpentTools.read('/home/asnalb/Serpent2N/26.03Transient/Transient500s/inp')

Actual outcome including console output and error traceback if applicable

Traceback (most recent call last):
File "", line 1, in
File "/home/asnalb/.local/lib/python2.7/site-packages/serpentTools/parsers/init.py", line 141, in read
loader = inferReader(filePath)
File "/home/asnalb/.local/lib/python2.7/site-packages/serpentTools/parsers/init.py", line 87, in inferReader
'a specific reader:\n{}'.format(filePath, SUPPORTED_READER_MSG)
serpentTools.messages.SerpentToolsException: Failed to infer filetype and thus accurate reader fromfile path /home/asnalb/Serpent2N/26.03Transient/Transient500s/inp. Pass one of the below options to ensure a specific reader:
branch: BranchingReader
bumat: BumatReader
dep: DepletionReader
depmtx: DepmtxReader
det: DetectorReader
fission: FissionMatrixReader
history: HistoryReader
microxs: MicroXSReader
results: ResultsReader
sensitivity: SensitivityReader
xsplot: XSPlotReader

Expected outcome

I'd like to be able to somehow convert this file to hiuman readable format, modify it and change it back to original binary. Any help would be very much appreciated!

Versions

  • Version from serpentTools.0.6.2

  • Python version - 2.7

  • IPython or Jupyter version if applicable

@drewejohnson
Copy link
Collaborator

So we may be able to help with the first task, the reading. We don't currently have a supported reader for that, hence the error message you're seeing.

One could be implemented and added to the project. There is a format given on the wiki that we could use, basically 9 doubles for each precursor neutron. Interestingly enough, we could use a similar reading process for the live neutron file as well

I'll leave this open for people to claim, but it could be a good addition to the project.

Some thoughts

  • Both a reader and a writer would have to be implemented. That way we don't store a binary file in the repository.
  • The data could largely be stored in a single array, maybe stripping out unused value 4-6.
  • Could make for some cool distribution/visualization plots

@ghost
Copy link
Author

ghost commented Apr 12, 2019

Thanks for the prompt reply! I\m trying to squeeze any info on encoding using chardet package from python.
The reason why I am looking into this file to begin with, is that I'm researching molten salt reactors and the delayed neutron precursors for me are actually moving with the flow. I though a quick and maybe not very clean but still usable way could be to take this source.precpoints file and manually shift the delayed neutron precursor coordinates according to flow velocity after each time step.

@drewejohnson
Copy link
Collaborator

Interesting concept. If you make some scripts to work with the output before we make a full blown reader/writer, and don't mind sharing them, that would be super helpful!

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

No branches or pull requests

1 participant