Dear pyNE team,
I would like to using the SurfSrc class from PyNE (link: http://pyne.io/pyapi/mcnp.html#pyne.mcnp.SurfSrc) to read the MCNP wssa file.
And I have installed pyne-0.7.0_ubuntu-20.04 in VMware.
I followed the instructions on the website and ran the following lines of code( from pyne import mcnp, pyne.mcnp.SurfSrc(wssa, rb) ), but an error was NameError: name 'pyne' is not defined (see screenshot).
How to solve this problem?
Best
wishes,
nashdeng
Hello,
It looks like you might not be calling the method correctly.
Since you have imported `mcnp` from pyne already, you should call
it with
mcnp.SurfSrc
instead of
pyne.mcnp.SurfSrc
That is, you have not imported `pyne` but only imported the `mcnp` class from PyNe.
Paul
--
You received this message because you are subscribed to the Google Groups "PyNE Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyne-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-users/CAG-wuxronxvuX0xAErmXO0UZUr1qqZwhKNdbsQQrm1qJeZifrg%40mail.gmail.com.
How to solve this problem?
Best wishes,
nashdeng
Dear Alex Malins ,
Thank you very much for your selfless teaching.
According to your opinion, I use mcnp.SurfSrc('wssa','rb') to run, it report <pyne.mcnp.SurfSrc object at 0x7fa18c9aee80>.
And I tried to use mcnp.SurfSrc('/home/pyne-user/Downloads/wssa','rb') to run, it report <pyne.mcnp.SurfSrc object at 0x7fa18c9c7a00>(see screenshot).
Does this indicate a successful operation?
If the wssa file has been successfully read, where is the generated file?r how to export files processed by pyne?
Best wishes,
nashdeng
Hello again,
It does look like you have correctly opened/read the WSSA file.
All the data from the file is loaded into the computer for further
manipulation.
It is unclear what you actually want to do with the WSSA file, so it is hard to know what additional suggestions to make.
There is a script that shows how to combine multiple WSSA files into one: https://github.com/pyne/pyne/blob/develop/scripts/ssw_combine.py
Perhaps that can help you understand how to accomplish your goals.
Regards,
Paul
To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-users/ccc14676-cd61-459a-8c39-8e5ecce9476fn%40googlegroups.com.
Dear Paul Wilson ,
Thank you very much for your selfless teaching.
I want to use openmc(version 0.12.0)program to read the external source sampling wssa file generated by the MCNPX.
The developer of the openmc program recommended me to use the SurfSrc class from PyNE to read the MCNP wssa file and then use openmc.write_source_file to create a source file that OpenMC could read.
Could the ssw_combine.py achieve this function?
Or is there any other way to
achieve this function?
Best wishes,
nashdeng
Dear Paul Wilson ,
Thank you very much for your selfless teaching.
I want to use openmc(version 0.12.0)program to read the external source sampling wssa file generated by the MCNPX.
The developer of the openmc program recommended me to use the SurfSrc class from PyNE to read the MCNP wssa file and then use openmc.write_source_file to create a source file that OpenMC could read.
Could the ssw_combine.py achieve this function?
Or is there any other way to achieve this function?
Best wishes,
nashdeng
Hello again,
No - the file I indicated will not do exactly what you want.
I think the advice from the OpenMC team was that you could write your own Python script to accomplish this. It will require you to do the following steps:
In summary, nothing exists already (that I know of) to do exactly what you want, but the combination of PyNE and openmc tools should make it easier for you to accomplish this without worrying too much about the file formats.
If/when you do complete this, we would gratefully accept it as a
contribution to PyNE.
Paul
To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-users/fe942358-8800-4c96-959c-f070c54da688n%40googlegroups.com.
Dear Paul Wilson ,
Thank you very much for your selfless teaching.
I will try it with your suggestions, thank you again .
Best wishes,
nashdeng