-
Notifications
You must be signed in to change notification settings - Fork 24
Comparison Tool for Single Initial Nuclide Response #135
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: main
Are you sure you want to change the base?
Conversation
gonuke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of comments on all the code to read certain CSV files, perhaps superseded by the suggestion to simply use the parse_tables function from the script in #113
tools/single_nuc.py
Outdated
| variables = [ | ||
| 'Number_Density', 'Specific_Activity', | ||
| 'Total_Decay_Heat', 'Contact_Dose' | ||
| ] | ||
| units = ['atoms_kg', 'Bq_kg', 'W_kg', 'Sv_hr_._data_ANS6_4_3'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably be bound together in some kind of dictionary. However, you might want to note that ALARA is flexible and allows different units for these same quantities. We may need to handle this differently....
tools/single_nuc.py
Outdated
| val for i, val in enumerate(x, start=1) | ||
| if val in y or i in (y if isinstance(y, list) else [y]) | ||
| ] | ||
| indices = [i for i, val in enumerate(x) if val in sublist] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be simpler to use list.index() for this: https://stackoverflow.com/questions/176918/how-can-i-find-the-index-for-a-given-item-in-a-list
tools/single_nuc.py
Outdated
| sublist = [ | ||
| val for i, val in enumerate(x, start=1) | ||
| if val in y or i in (y if isinstance(y, list) else [y]) | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you convert them both to sets and use set operations?
sublist = list(set(x).intersection(set(y)))
tools/single_nuc.py
Outdated
| units = ['atoms_kg', 'Bq_kg', 'W_kg', 'Sv_hr_._data_ANS6_4_3'] | ||
|
|
||
| if inp_datalibs: | ||
| datalibs, _ = select_sublist(datalibs, inp_datalibs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might not need the select_sublist() method if these are replaced by a single line if using set intersection (see above)
tools/single_nuc.py
Outdated
| if inp_units: | ||
| units, _ = select_sublist(units, inp_units) | ||
| else: | ||
| units = [units[idx] for idx in var_indices] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely don't want to rely on two lists being indexed the same way - better to make them into a dictionary.
tools/single_nuc.py
Outdated
| inp_variables=[], | ||
| inp_units=[]): | ||
|
|
||
| datalibs = ['fendl2', 'fendl3'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'd make these fixed in the code - you could just let users pick any set of names on the command line
tools/single_nuc.py
Outdated
| return sublist, indices | ||
|
|
||
| def process_metadata( | ||
| gen_csv='', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of reading CSV files, why not import your script from #113 and call parse_tables() to get the data straight into dataframes?
a34efdb to
a3f55fe
Compare
…urrently referenced only as URL, but is central to this process, so it might be good to have it saved here as a backup in case URL ever changes or file is taken down.
4afb3ad to
af46f6a
Compare
|
I've just added a few functions to |
gonuke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tools seemed to be aimed at the QA of the library processing, so I wonder if they should live in a subdirectory of ALARAJOYWrapper?
Also, I'd love to review this in pieces. You appear to have a progression of capabilities here:
- setup and run a new simulation
- load the results of one or more simulations into a data structure
- a variety of independent post-processing and plotting steps - each of which can be added/reviewed separately
Could you break this PR up into some of these steps, please?
Closes #84 .
I've included a Jupyter notebook and an accompanying Python module for the comparison of ALARA output data from an ALARA run based on the input scripts and data from
examples/singleElement.ala. This Jupyter notebook allows for the comparison between the standard fendl2 data infendl2bin, as well as ALARAJOY-processed data from fendl3. I converted the data from both output files to CSV files, following the meshless table extraction method in #114.I'm still working on expanding and building all of my comparison tools, so I'm only uploading this as a draft for now, but I wanted to put up my work that I have thus far ahead of tomorrow's fusion-activation meeting.
The major first impression from the plots that I am seeing is that ALARAJOY is not allowing for proper tritium tracking, as we know both from fendl2 and FISPACT that tritium is highly significant on the century timescale for specific activity and decay heat in particular, but the ALARAJOY-processed fendl3 data is not showing any tritium.
More analysis and plots to come, but I wanted to get this up so that we can start discussing initial results and next steps in debugging ALARAJOY's tritium issue.