Request for example on reading the fluxes file #55
-
|
Hi there Just taking a look at this package after a long time and I am trying to read in a fluxes file like this one https://www-nds.iaea.org/conderc/fusion/element/Cr/files/2000exp_5min_fluxes By any chance pypact has a nice convenient way of reading it in? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Hi there i think it may be possible with the pypact.FluxesFile() and pypact.from_file. There is also a ArbFluxesFile() for another type of historical (?) flux file structure (see examples/groupconvert). After reading the file in one can access energy boundaries, midpoint energies, values, the name and norm. Then one could convert it in another group structure from the pre-defined ones. There is also a spectrum_lib.json where the spectrum could probably be saved (havent tried it). Cheers |
Beta Was this translation helpful? Give feedback.
-
|
Here is a simple example for fluxes files that are in one of the FISPACT predefined groups. import pypact as pp
ff = pp.FluxesFile()
pp.from_file(ff, 'Cr_2000exp_5min_fluxes')
energy_bound_ascending, bin_values = ff.boundaries, ff.valuesFor custom energy structures you will need the As @PeBoch points out there are some examples on this, but they're not well documented. I'll see if I can make this clearer in the docs and examples. |
Beta Was this translation helpful? Give feedback.
-
|
Many thanks both. This works well for me. Now plotting those fluxes files is super easy. |
Beta Was this translation helpful? Give feedback.
Here is a simple example for fluxes files that are in one of the FISPACT predefined groups.
For custom energy structures you will need the
ArbFluxesFile. But the file you point out is in 709 group it works fine as above.As @PeBoch points out there are some examples on this, but they're not well documented. I'll see if I can make this clearer in the docs and examples.