nugridpy.data_plot¶
data_plot.py
SuperClass module for the YProfile and Table Classes. It contains numerous plot function for the YProfile and Table Classes.
If one in the future wants their class to inherit this superclasses methods this is what is required:
- Place
from data_table import *
at the top of the module. - If the class is defined like ‘class MyClass:’, change that to ‘class MyClass(DataTable):’
- To properly use DataTable’s methods properly one will need these methods: a get(atri) that returns a numpy array of Data, or a list of numpy arrays of data. The arguments of this function would need to be atri which is the name of the data one is looking for.
Functions
flux_chart (file_name, plotaxis, plot_type[, …]) |
Plots a chart with fluxes |
Classes
DataPlot |
-
nugridpy.data_plot.
flux_chart
(file_name, plotaxis, plot_type, which_flux=None, I_am_the_target=None, prange=None)¶ Plots a chart with fluxes
Parameters: - file_name (string) – Name of the file of fluxes we are looking at.
- plotaxis (list) – [xmin, xmax, ymin, ymax], where on x axis there is neutron number and on y axis there is Z.
- plot_types (integer) – Set to 0 for standard flux plot. Set to 1 if fluxes focused on one specie.
- which_flux (integer, optional) – Set to 0 for nucleosynthesis flux plot. Set to 1 is for energy flux plot. Seting to None is the same a 0. The default is None.
- I_am_the_target (list, optional) – A 2xArray used only if plot_type=1, and is given by [neutron number, proton number]. The default is None.
- prange (integer, optional) – The range of fluxes to be considered. If prange is None, then 8 fluxes are consdered. The default is None.
Notes
This script is terribly slow and needs to be improved. For now I put here in data_plot:
[1]: import data_plot
- [2]: data_plot.flux_chart(‘file_name’, [xmin, xmax, ymin, ymax],
- int, which_flux, I_am_the_target, prange)
The pdf is created, but an error bumped up and the gui is empty. To avoid this, I had to set ‘text.usetex’: False. See below. Also, for the same reason no label in x axys is written using ‘text.usetex’: True.
Note also that the GUI works really slow with this plot. So, we need to optimize from the graphic point of view. This need to be included in ppn.py I think, and set in multi option too, in case we want to read more flux files at the same time.
Finally, you need to have stable.dat to read in to make it work …