FISPACT II legacy output#
F4Enix wraps pypact to provide some higher level routines and to complement some of the missing feature.
Parsing of pathways#
The complete API can be found at f4enix.output.fispact_legacy_out.PathwayCollection
Unfortunately, reaction pathways are not supported yet in pypact, so a parser has been built directly in F4Enix
from f4enix.output.fispact_legacy_out import PathwayCollection
from pprint import pprint # just to print in a nicer way
pathways_collection = PathwayCollection.from_file('testSS.out')
pprint(pathways_collection.pathways) # print the pathways in the collection
/home/docs/checkouts/readthedocs.org/user_builds/f4enix/envs/developing/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
[Pathway(parent=Mn55,
daughter=Mn56,
perc=43.807,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Fe56,
daughter=Mn56,
perc=56.135,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Cr52,
daughter=V52,
perc=96.532,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Mn55,
daughter=V52,
perc=2.86,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Si28,
daughter=Al28,
perc=96.924,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=P31,
daughter=Al28,
perc=2.384,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Co58,
perc=54.559,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Co58,
perc=44.714,
reactions=['(n,p)', '(IT)'],
intermediates=[Co58m]),
Pathway(parent=Cr53,
daughter=V53,
perc=99.103,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Mn55,
daughter=Mn54,
perc=24.38,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Fe54,
daughter=Mn54,
perc=75.418,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Mo100,
daughter=Mo101,
perc=99.97,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Fe57,
daughter=Mn57,
perc=99.136,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Co59,
daughter=Co60,
perc=33.93,
reactions=['(n,g)', '(IT)'],
intermediates=[Co60m]),
Pathway(parent=Co59,
daughter=Co60,
perc=27.116,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Ni60,
daughter=Co60,
perc=21.82,
reactions=['(n,p)', '(IT)'],
intermediates=[Co60m]),
Pathway(parent=Ni60,
daughter=Co60,
perc=16.095,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Cu63,
daughter=Cu62,
perc=99.936,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Ta181,
daughter=Ta182,
perc=99.41,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Cr54,
daughter=Cr55,
perc=24.045,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Mn55,
daughter=Cr55,
perc=72.763,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Fe58,
daughter=Cr55,
perc=2.838,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Cr54,
daughter=V54,
perc=99.463,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Mo98,
daughter=Mo99,
perc=76.882,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Mo100,
daughter=Mo99,
perc=23.117,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Co57,
perc=96.742,
reactions=['(n,np)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Co57,
perc=3.067,
reactions=['(n,2n)', '(b+)'],
intermediates=[Ni57]),
Pathway(parent=Co59,
daughter=Co60m,
perc=60.592,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Ni60,
daughter=Co60m,
perc=38.966,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Ni62,
daughter=Co62,
perc=93.768,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Cu65,
daughter=Co62,
perc=5.265,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Cu65,
daughter=Cu66,
perc=99.801,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Co58m,
perc=99.587,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Cr50,
daughter=Cr51,
perc=37.705,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Cr52,
daughter=Cr51,
perc=54.958,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Fe54,
daughter=Cr51,
perc=7.329,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Ni57,
perc=99.999,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Fe54,
daughter=Fe55,
perc=7.123,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Fe56,
daughter=Fe55,
perc=86.318,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Ni58,
daughter=Fe55,
perc=6.119,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Fe58,
daughter=Fe59,
perc=86.129,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Co59,
daughter=Fe59,
perc=3.422,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Ni62,
daughter=Fe59,
perc=10.285,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Mo92,
daughter=Mo91,
perc=95.028,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Mo92,
daughter=Mo91,
perc=4.957,
reactions=['(n,2n)', '(IT)'],
intermediates=[Mo91m]),
Pathway(parent=Mo98,
daughter=Tc99m,
perc=76.884,
reactions=['(n,g)', '(b-)'],
intermediates=[Mo99]),
Pathway(parent=Mo100,
daughter=Tc99m,
perc=23.117,
reactions=['(n,2n)', '(b-)'],
intermediates=[Mo99]),
Pathway(parent=Mo100,
daughter=Tc101,
perc=100.0,
reactions=['(n,g)', '(b-)'],
intermediates=[Mo101]),
Pathway(parent=Si29,
daughter=Al29,
perc=99.473,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Fe54,
daughter=Fe53,
perc=99.918,
reactions=['(n,2n)'],
intermediates=None),
Pathway(parent=Ni62,
daughter=Co62m,
perc=92.664,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Cu65,
daughter=Co62m,
perc=7.302,
reactions=['(n,a)'],
intermediates=None),
Pathway(parent=Fe58,
daughter=Mn58m,
perc=100.0,
reactions=['(n,p)'],
intermediates=None),
Pathway(parent=Cu63,
daughter=Cu64,
perc=82.084,
reactions=['(n,g)'],
intermediates=None),
Pathway(parent=Cu65,
daughter=Cu64,
perc=17.913,
reactions=['(n,2n)'],
intermediates=None)]
# as it can see above, each pathway is represented as a dataclass that have
# different attributes that can be accessed directly
pathway = pathways_collection.pathways[13]
# a handy str method is provided to get a compact description of the pathway
print(pathway)
print(pathway.is_multistep()) # isomeric transitions are not considered as steps
print(pathway.reduce()) # isomeric transitions can be compressed
Co59 -(n,g)-> Co60m -(IT)-> Co60
False
Co59 -(n,g)-> Co60
# Zaid data is contanied in the FispactZaid dataclass
zaid = pathway.parent
zaid
Co59
# Finally, it is also possible to get a dataframe summarizing all the pathways
pathways_collection.to_dataframe().iloc[20:30]
| Parent | Intermediates | Reactions | ||
|---|---|---|---|---|
| Daughter | % contribution | |||
| Fe55 | 7.123 | Fe54 | [] | [(n,g)] |
| 86.318 | Fe56 | [] | [(n,2n)] | |
| 6.119 | Ni58 | [] | [(n,a)] | |
| Fe59 | 10.285 | Ni62 | [] | [(n,a)] |
| 3.422 | Co59 | [] | [(n,p)] | |
| 86.129 | Fe58 | [] | [(n,g)] | |
| Co57 | 96.742 | Ni58 | [] | [(n,np)] |
| 3.067 | Ni58 | [Ni57] | [(n,2n), (b+)] | |
| Co58 | 44.714 | Ni58 | [Co58m] | [(n,p), (IT)] |
| 54.559 | Ni58 | [] | [(n,p)] |
Parsing of the output file at large#
When parsing a FISPACT output the code requires to specify labels to be associated with the different cooling times after shutdown. No internal check is performed to assert that the number of labels provided corresponds to the number of cooling times defined in the FISPACT run. Simply the last N times will be selected where N is the number of provided labels.
from f4enix.output.fispact_legacy_out import FispactOutput
cooling_time_labels = ['24h', '1y']
outp = FispactOutput('testSS.out', cooling_time_labels)
# the original pypact TimeStep objects can be found in the inventory_data attribute
print(type(outp.inventory_data[0]))
<class 'pypact.output.timestep.TimeStep'>
The main attributes of the object are the SDDR and decay heat global dataframe and the pathways collection
outp.sddr.head()
| element | isotope | state | dose | cooling time | isotope % dose | Cumulative dose sum | |
|---|---|---|---|---|---|---|---|
| 70 | Co | 60 | 0.003954 | 24h | 48.786745 | 48.786745 | |
| 57 | Mn | 54 | 0.003297 | 24h | 40.680298 | 89.467043 | |
| 68 | Co | 58 | 0.000581 | 24h | 7.168715 | 96.635758 | |
| 126 | Ta | 182 | 0.000147 | 24h | 1.807602 | 98.443360 | |
| 67 | Co | 57 | 0.000103 | 24h | 1.277043 | 99.720403 |
outp.decay_heat.head()
| element | isotope | state | heat | alpha_heat | beta_heat | gamma_heat | cooling time | isotope % heat | Cumulative heat sum | |
|---|---|---|---|---|---|---|---|---|---|---|
| 70 | Co | 60 | 2.297000e-09 | 0.0 | 8.549000e-11 | 2.212000e-09 | 24h | 44.509873 | 44.509873 | |
| 57 | Mn | 54 | 2.044000e-09 | 0.0 | 9.798000e-12 | 2.034000e-09 | 24h | 39.607393 | 84.117266 | |
| 68 | Co | 58 | 3.837000e-10 | 0.0 | 1.303000e-11 | 3.707000e-10 | 24h | 7.435106 | 91.552372 | |
| 67 | Co | 57 | 2.546000e-10 | 0.0 | 3.245000e-11 | 2.222000e-10 | 24h | 4.933484 | 96.485856 | |
| 126 | Ta | 182 | 1.045000e-10 | 0.0 | 1.507000e-11 | 8.939000e-11 | 24h | 2.024938 | 98.510794 |
outp.pathways_collection
<f4enix.output.fispact_legacy_out.PathwayCollection at 0x7cf31f17add0>
A common task when running an activation study in preparation of a D1S calculation is to identify what are the main decay pathways that should be tracked during the simulation.The output objects allows to build a pandas dataframe of the contact dose (and pathways) at specific cooling times.
df = outp.filter_by_cum_dose(
perc=95, # cap dose at 95% of the total dose
label='24h', # the label of the cooling time to filter by
add_pathways=True) # include the pathways in the output
df.set_index(['element', 'isotope', 'state'])
| dose | cooling time | isotope % dose | Cumulative dose sum | pathway | pathway % dose | |||
|---|---|---|---|---|---|---|---|---|
| element | isotope | state | ||||||
| Mn | 54 | 0.003297 | 24h | 40.680298 | 89.467043 | Fe54 -(n,p)-> Mn54 | 30.680267 | |
| Co | 60 | 0.003954 | 24h | 48.786745 | 48.786745 | Co59 -(n,g)-> Co60m -(IT)-> Co60 | 16.553343 | |
| 0.003954 | 24h | 48.786745 | 48.786745 | Co59 -(n,g)-> Co60 | 13.229014 | |||
| 0.003954 | 24h | 48.786745 | 48.786745 | Ni60 -(n,p)-> Co60m -(IT)-> Co60 | 10.645268 | |||
| Mn | 54 | 0.003297 | 24h | 40.680298 | 89.467043 | Mn55 -(n,2n)-> Mn54 | 9.917857 | |
| Co | 60 | 0.003954 | 24h | 48.786745 | 48.786745 | Ni60 -(n,p)-> Co60 | 7.852227 | |
| 58 | 0.000581 | 24h | 7.168715 | 96.635758 | Ni58 -(n,p)-> Co58 | 3.911179 | ||
| 0.000581 | 24h | 7.168715 | 96.635758 | Ni58 -(n,p)-> Co58m -(IT)-> Co58 | 3.205419 |
Similarly, it is possible to filter also for decay heat contributors. Alpha, Beta and gamma heat columns refer to the daughter isotope, not to the specific pathway.
df = outp.filter_by_cum_heating(
perc=95, # cap heat at 95% of the total heat
label='1y', # the label of the cooling time to filter by
add_pathways=True) # include the pathways in the output
df.set_index(['element', 'isotope', 'state'])
| heat | alpha_heat | beta_heat | gamma_heat | cooling time | isotope % heat | Cumulative heat sum | pathway | pathway % heat | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| element | isotope | state | |||||||||
| Co | 60 | 7.034000e-10 | 0.0 | 2.618000e-11 | 6.772000e-10 | 1y | 98.575549 | 98.575549 | Co59 -(n,g)-> Co60m -(IT)-> Co60 | 33.446684 | |
| 7.034000e-10 | 0.0 | 2.618000e-11 | 6.772000e-10 | 1y | 98.575549 | 98.575549 | Co59 -(n,g)-> Co60 | 26.729746 | |||
| 7.034000e-10 | 0.0 | 2.618000e-11 | 6.772000e-10 | 1y | 98.575549 | 98.575549 | Ni60 -(n,p)-> Co60m -(IT)-> Co60 | 21.509185 | |||
| 7.034000e-10 | 0.0 | 2.618000e-11 | 6.772000e-10 | 1y | 98.575549 | 98.575549 | Ni60 -(n,p)-> Co60 | 15.865735 |