bin.class_files.reaclib_class.reaclib Class Reference

Public Member Functions

def __init__ (self, path, quiet=False)
 
def read_reaclib (self)
 
def reset_reaclib (self)
 
def get_statistics (self)
 
def set_rate (self, dataframe)
 
def test_reaclib (self, test_weak=True, test_mass=True, test_overflow=True)
 
def get_contained_nuc (self)
 
def test_net_consistency (self, path)
 
def get_rate_at_temp (self, temperature, reactants, products)
 
def plot_rate (self, reactants, products, figure=None, axlabel=True, temp_grid=None, **kwargs)
 
def get_rate_error (self)
 
def get_rate_error_html (self, path)
 
def save_reaclib (self, filename, dataframe=None, sort=False)
 
def get_critical_low_temperature_rates (self, min_temperature=1e-4, amount_points=20, max_rate=1.e100)
 
def drop_errors (self)
 
def get_dataframe (self, reaction_type=None, chapter=None)
 
def get_all_reactiontypes (self)
 
def is_included (self, series)
 
def update (self, reaclib_path=None, dataframe=None, reaction_type=None, chapter=None, ignore_label=False, ignore_reverse=False, ignore_type=False, replace_specific_label=None)
 
def add_new_rates (self, reaclib_path=None, dataframe=None, reaction_type=None, chapter=None, ignore_label=True, ignore_reverse=True, ignore_type=False)
 
def add_rate (self, dataframe)
 
def filter_with_sunet (self, nucleus_names)
 
def get_label_statistic (self)
 

Private Member Functions

def __classify_reaction (self, chapter, reactants, products, weak, label, afactors)
 
def __reaclib_fit_function (self, temperature, coefficients)
 
def __test_massconsistency (self, row)
 
def __test_overflows (self, row, temp_range=None, upper_lim=None)
 
def __test_weakconsistency (self, row)
 
def __convert_series_to_string (self, series)
 
def __sort_prods_reacs (self, in_list)
 
def __analyze_update (self, dataframe)
 
def __filter_rates (self, dataframe, reaction_type, chapter)
 

Private Attributes

 __path
 
 __format
 
 __quiet
 
 __column_names
 
 __pd_reaclib
 
 __reset_reaclib
 
 __cpn
 
 __lpo
 
 __lc
 
 __cpe
 
 __ignore_fission_errors
 
 __fission_flags
 
 __temperature_range
 
 __test_rate_upper_limit
 

Detailed Description

Definition at line 15 of file reaclib_class.py.

Constructor & Destructor Documentation

◆ __init__()

def bin.class_files.reaclib_class.reaclib.__init__ (   self,
  path,
  quiet = False 
)
  Analyze a rate file for a given path.
  Input:
    path    - path to reaclib file
    quiet   - Do you want to have status informations of the progress?

Definition at line 17 of file reaclib_class.py.

Member Function Documentation

◆ __analyze_update()

def bin.class_files.reaclib_class.reaclib.__analyze_update (   self,
  dataframe 
)
private
  Analyze a dataframe that contains the column "version".
  Output:
   Returns the amount of new inserted rates

Definition at line 642 of file reaclib_class.py.

◆ __classify_reaction()

def bin.class_files.reaclib_class.reaclib.__classify_reaction (   self,
  chapter,
  reactants,
  products,
  weak,
  label,
  afactors 
)
private
  Classify a reaction if it is gamma-n, n-gamma, ...
  Input:
    chapter   - reaclib chapter of the reaction (int)
    reactants - all reactants of the reaction (list of strings)
    products  - all products of the reaction (list of strings)
    weak      - 'w' if weak, else ''
    label     - reaction label to identify fission rates
    afactors  - check whether a rate is constant in dependence of the temperature
  Output:
    Returns a string, containing the type of reaction

Definition at line 158 of file reaclib_class.py.

◆ __convert_series_to_string()

def bin.class_files.reaclib_class.reaclib.__convert_series_to_string (   self,
  series 
)
private
  Convert a pandas series to a reaclib string.
  Input:
    series - pandas series of one reaction

Definition at line 466 of file reaclib_class.py.

◆ __filter_rates()

def bin.class_files.reaclib_class.reaclib.__filter_rates (   self,
  dataframe,
  reaction_type,
  chapter 
)
private
  Filter the reaction rates by type and chapter.
  Input:
    dataframe     - Pandas dataframe that contains all reactions
    reaction_type - only these reaction types (n-gamma,..), none for dont filter the type    (list of strings or string)
    chapter       - only these chapters                   , none for dont filter the chapter (list of integers or integer)
  Output:
    Filtered dataframe, that contains only the reactions with given type and chapter

Definition at line 696 of file reaclib_class.py.

◆ __reaclib_fit_function()

def bin.class_files.reaclib_class.reaclib.__reaclib_fit_function (   self,
  temperature,
  coefficients 
)
private
  Returns the value of the rate for a given temperature
  Input:
    temperature  - Temperature [GK]
    coefficients - The 7 fit coefficients from the reaclib format

Definition at line 239 of file reaclib_class.py.

◆ __sort_prods_reacs()

def bin.class_files.reaclib_class.reaclib.__sort_prods_reacs (   self,
  in_list 
)
private
  Sort the products and reactants of a given dataframe.
  A nucleus is greater if it has an higher proton number

Definition at line 501 of file reaclib_class.py.

◆ __test_massconsistency()

def bin.class_files.reaclib_class.reaclib.__test_massconsistency (   self,
  row 
)
private
  Test the reaction rate for overflows!

Definition at line 335 of file reaclib_class.py.

◆ __test_overflows()

def bin.class_files.reaclib_class.reaclib.__test_overflows (   self,
  row,
  temp_range = None,
  upper_lim = None 
)
private
  Test the reaction rate for overflows!

Definition at line 352 of file reaclib_class.py.

Here is the call graph for this function:

◆ __test_weakconsistency()

def bin.class_files.reaclib_class.reaclib.__test_weakconsistency (   self,
  row 
)
private
  Test the reaction for consistency

Definition at line 372 of file reaclib_class.py.

◆ add_new_rates()

def bin.class_files.reaclib_class.reaclib.add_new_rates (   self,
  reaclib_path = None,
  dataframe = None,
  reaction_type = None,
  chapter = None,
  ignore_label = True,
  ignore_reverse = True,
  ignore_type = False 
)
  Add new rates to existing ones
  Input:
    reaclib_path          - path of the reaclib that contains new rates
    dataframe             - pandas dataframe that contains reactions. If this is given, you don't have to give a reaclib_path.
    reaction_type         - Reaction type that will be updated (string or list of strings), for possible values see ".get_statistics()"
    chapter               - Chapter that will be updated (list of integer or integer)
    ignore_label          - ignore the label for updating and only look at the reactions itself
    ignore_reverse        - ignore if the reaction is reverse
    ignore_type           - ignore the type
    replace_specific_label- Should one specific label be replaced. E.g. Moeller 93 with Moeller 03 rates. For a list of the Jina labels see https://groups.nscl.msu.edu/jina/reaclib/db/labels.php
                    if yes, the input should be a list with [old label, new label]

Definition at line 851 of file reaclib_class.py.

Here is the call graph for this function:

◆ add_rate()

def bin.class_files.reaclib_class.reaclib.add_rate (   self,
  dataframe 
)
  Add a given dataframe to the reaclib

Definition at line 955 of file reaclib_class.py.

◆ drop_errors()

def bin.class_files.reaclib_class.reaclib.drop_errors (   self)
  Drop errors from dataframe. Need to run test_reaclib() first

Definition at line 620 of file reaclib_class.py.

◆ filter_with_sunet()

def bin.class_files.reaclib_class.reaclib.filter_with_sunet (   self,
  nucleus_names 
)
  Filter the rates with contained nuclei.
  Input:
    Contained nuclei of the network

Definition at line 962 of file reaclib_class.py.

◆ get_all_reactiontypes()

def bin.class_files.reaclib_class.reaclib.get_all_reactiontypes (   self)
  Get all types of reactions, necessary to write in "reaction_type" when filtering rates
  Output:
    List of strings, containing the possible reaction types

Definition at line 661 of file reaclib_class.py.

Here is the call graph for this function:

◆ get_contained_nuc()

def bin.class_files.reaclib_class.reaclib.get_contained_nuc (   self)
  Get all nuclei contained in reaclib file.
  Output:
    list of strings, containing the names of all nuclei contained in the reaclib

Definition at line 301 of file reaclib_class.py.

◆ get_critical_low_temperature_rates()

def bin.class_files.reaclib_class.reaclib.get_critical_low_temperature_rates (   self,
  min_temperature = 1e-4,
  amount_points = 20,
  max_rate = 1.e100 
)
  Get rates that are critical for low temperatures (< 1e-2 GK)

Definition at line 589 of file reaclib_class.py.

Here is the call graph for this function:

◆ get_dataframe()

def bin.class_files.reaclib_class.reaclib.get_dataframe (   self,
  reaction_type = None,
  chapter = None 
)
  Returns the pandas dataframe, containing all reactions (after applying a filter) of the reaclib
  Input:
    reaction_type - only these reaction types (n-gamma,..), none for dont filter the type    (list of strings or string)
    chapter       - only these chapters                   , none for dont filter the chapter (list of integers or integer)

Definition at line 632 of file reaclib_class.py.

Here is the call graph for this function:

◆ get_label_statistic()

def bin.class_files.reaclib_class.reaclib.get_label_statistic (   self)
  Get a statistic which labels are involved in the database. An overview of all labels an their meaning can be found
  at https://groups.nscl.msu.edu/jina/reaclib/db/labels.php

Definition at line 1003 of file reaclib_class.py.

◆ get_rate_at_temp()

def bin.class_files.reaclib_class.reaclib.get_rate_at_temp (   self,
  temperature,
  reactants,
  products 
)
  Get a reaction rate at given temperature
  Input:
    temperature - Temperature [GK]
    reactants   - list with reactants
    products    - list with products
  Output:
    Reaction rate at a given temperature

Definition at line 392 of file reaclib_class.py.

Here is the call graph for this function:

◆ get_rate_error()

def bin.class_files.reaclib_class.reaclib.get_rate_error (   self)
  Get a list with all rates that produce errors

Definition at line 448 of file reaclib_class.py.

◆ get_rate_error_html()

def bin.class_files.reaclib_class.reaclib.get_rate_error_html (   self,
  path 
)
  Get an html file with all rates that contain an error
  Input:
    path - Path to the html file that will be created

Definition at line 455 of file reaclib_class.py.

Here is the call graph for this function:

◆ get_statistics()

def bin.class_files.reaclib_class.reaclib.get_statistics (   self)
  Get the amount of different rate types (n-gamma, gamma-n, weak ,alpha-n,...)
  Output:
    Returns a pandas series, containing the counts of the different reaction types and the total number of reactions

Definition at line 222 of file reaclib_class.py.

◆ is_included()

def bin.class_files.reaclib_class.reaclib.is_included (   self,
  series 
)
  Is the rate included in the dataframe? Compared are only products and reactants.
  Returns true if yes, false if not

Definition at line 671 of file reaclib_class.py.

◆ plot_rate()

def bin.class_files.reaclib_class.reaclib.plot_rate (   self,
  reactants,
  products,
  figure = None,
  axlabel = True,
  temp_grid = None,
**  kwargs 
)
  Plot a rate.
  Input:
    reactants - list of reactants (list of strings)
    products  - list of products (list of strings)

Definition at line 415 of file reaclib_class.py.

Here is the call graph for this function:

◆ read_reaclib()

def bin.class_files.reaclib_class.reaclib.read_reaclib (   self)
  read the whole reaclib file.

Definition at line 54 of file reaclib_class.py.

Here is the call graph for this function:

◆ reset_reaclib()

def bin.class_files.reaclib_class.reaclib.reset_reaclib (   self)
  Reset the reaclib to the loaded one.

Definition at line 150 of file reaclib_class.py.

◆ save_reaclib()

def bin.class_files.reaclib_class.reaclib.save_reaclib (   self,
  filename,
  dataframe = None,
  sort = False 
)
  Save the pandas dataframe to a reaclib file with the correct format.
  Input:
    filename  - Filename of the output.
    dataframe - Pandas dataframe that contains reaction rates. If none, the reaction rates of the class are used

Definition at line 512 of file reaclib_class.py.

Here is the call graph for this function:

◆ set_rate()

def bin.class_files.reaclib_class.reaclib.set_rate (   self,
  dataframe 
)
  Set the dataframe (containing all reactions) of the class with the given one

Definition at line 232 of file reaclib_class.py.

◆ test_net_consistency()

def bin.class_files.reaclib_class.reaclib.test_net_consistency (   self,
  path 
)
  Test if nuclei are included in the net file, but not in the reaclib. Be careful, reaclib contains nuclei where you are trapped in.
  There are reactions producing that nuclei, but no reaction to destroy it. (e.g. "f16" in the 2017 version of reaclib)
  Input:
    path - path to net file of WinNet
  Output:
    list of strings, containing problematic nuclei. If all nuclei have a corresponding reaction, an empty list is returned

Definition at line 313 of file reaclib_class.py.

Here is the call graph for this function:

◆ test_reaclib()

def bin.class_files.reaclib_class.reaclib.test_reaclib (   self,
  test_weak = True,
  test_mass = True,
  test_overflow = True 
)
  Test the reaclib for failures

Definition at line 258 of file reaclib_class.py.

Here is the call graph for this function:

◆ update()

def bin.class_files.reaclib_class.reaclib.update (   self,
  reaclib_path = None,
  dataframe = None,
  reaction_type = None,
  chapter = None,
  ignore_label = False,
  ignore_reverse = False,
  ignore_type = False,
  replace_specific_label = None 
)
  Update the reaclib with rates from other reaclib. Dont include new rates in the file. Both reaclibs have to be in the "old version" (without chapter 9-10) or in the
  "new version", with these chapters.
  Input:
    reaclib_path          - path of the reaclib that contains new rates
    dataframe             - pandas dataframe that contains reactions. If this is given, you don't have to give a reaclib_path.
    reaction_type         - Reaction type that will be updated (string or list of strings), for possible values see ".get_statistics()"
    chapter               - Chapter that will be updated (list of integer or integer)
    ignore_label          - ignore the label for updating and only look at the reactions itself
    ignore_reverse        - ignore if the reaction is reverse
    ignore_type           - ignore the type
    replace_specific_label- Should one specific label be replaced. E.g. Moeller 93 with Moeller 03 rates. For a list of the Jina labels see https://groups.nscl.msu.edu/jina/reaclib/db/labels.php
                    if yes, the input should be a list with [old label, new label]

Definition at line 726 of file reaclib_class.py.

Here is the call graph for this function:

Member Data Documentation

◆ __column_names

bin.class_files.reaclib_class.reaclib.__column_names
private

Definition at line 35 of file reaclib_class.py.

◆ __cpe

bin.class_files.reaclib_class.reaclib.__cpe
private

Definition at line 43 of file reaclib_class.py.

◆ __cpn

bin.class_files.reaclib_class.reaclib.__cpn
private

Definition at line 40 of file reaclib_class.py.

◆ __fission_flags

bin.class_files.reaclib_class.reaclib.__fission_flags
private

Definition at line 47 of file reaclib_class.py.

◆ __format

bin.class_files.reaclib_class.reaclib.__format
private

Definition at line 30 of file reaclib_class.py.

◆ __ignore_fission_errors

bin.class_files.reaclib_class.reaclib.__ignore_fission_errors
private

Definition at line 46 of file reaclib_class.py.

◆ __lc

bin.class_files.reaclib_class.reaclib.__lc
private

Definition at line 42 of file reaclib_class.py.

◆ __lpo

bin.class_files.reaclib_class.reaclib.__lpo
private

Definition at line 41 of file reaclib_class.py.

◆ __path

bin.class_files.reaclib_class.reaclib.__path
private

Definition at line 29 of file reaclib_class.py.

◆ __pd_reaclib

bin.class_files.reaclib_class.reaclib.__pd_reaclib
private

Definition at line 36 of file reaclib_class.py.

◆ __quiet

bin.class_files.reaclib_class.reaclib.__quiet
private

Definition at line 32 of file reaclib_class.py.

◆ __reset_reaclib

bin.class_files.reaclib_class.reaclib.__reset_reaclib
private

Definition at line 38 of file reaclib_class.py.

◆ __temperature_range

bin.class_files.reaclib_class.reaclib.__temperature_range
private

Definition at line 50 of file reaclib_class.py.

◆ __test_rate_upper_limit

bin.class_files.reaclib_class.reaclib.__test_rate_upper_limit
private

Definition at line 52 of file reaclib_class.py.