fitroom.room module

Created on Mon Sep 18 01:58:04 2017

@author: erwan


class DynVar(slab, param, func=<function DynVar.<lambda>>)[source]

Bases: object

To allow dynamic (runtime) filling of conditions in SlabList

Parameters
  • slab (str) – slab config name in Slablist. Note that 'self' in DynVar can be used to refer to the DynVar’s own slab. Ex:

    slabPlasma={
            'Trot':2000,
            'Tvib':DynVar('self', 'Trot'),
            }
    
  • param (str) – param name in slab config dict

  • func (function) – function to apply. Default identity

Examples

 slbPostCO2 = {
         'db':db0,
         'Tgas':500,
         'db':dbp,
         'Tgas':1100,
         'path_length':0.7,
         'mole_fraction':0.35,
          }

 slbPostCO = {
       'db':dbco,
       'Tgas':slbPostCO2['Tgas'],
       'path_length':DynVar('sPostCO2', 'path_length', lambda x:x),
                     # evaluated at runtime using names in Slablist
       'mole_fraction':0.01,
        }

Slablist = {
          'sPostCO2': slbPostCO2,
          'sPostCO': slbPostCO,
          }

You can also use a function, for instance to maintain the equilibrium concentration in a fit on temperature:

from radis.tools.gascomp import get_eq_mole_fraction
get_co2_eq = lambda T: get_eq_mole_fraction('CO2:1', T, 1e5)
slbPlasmaCO2 = {
         'db':dbp,
         'Trot':1500,
         'Tvib':DynVar('self', 'Trot'),
         'path_length':0.025,
         'mole_fraction':DynVar('self', 'Trot', get_co2_eq),
         }

Here the CO2 Plasma slab is always evaluated with Tvib=Trot and x_co2 at chemical equilibrium with T=Trot.

eval(slabsconfig)[source]

Evaluate value at runtime based on other static values

class FitRoom(Slablist, slbInteractx, slbInteracty, xparam, yparam, perfmode=False)[source]

Bases: object

Parameters
  • perfmode (boolean)

  • if ``True`` we try to optimize calculation times (ex (minimized windows)

  • are not recalculated)

Examples

add_tool(tool, verbose=True)[source]
eval_dynvar(config)[source]

Evaluate dynamic links for a given configuration. Changes updated config (inplace) Note that ‘self’ in DynVar can be used to refer to the current slab

get_config()[source]

Get values for Target configuration

update(xspace=None, yspace=None)[source]
update_plots()[source]