PyNeb  1.1.2
PyNeb Reference Manua
EmisGrid Class Reference

Inherits object.

Public Member Functions

def __init__ (self, elem=None, spec=None, n_tem=100, n_den=100, tem_min=5000., tem_max=20000., den_min=10., den_max=1.e8, restore_file=None, atomObj=None, kwargs)
 
def save (self, file_)
 
def getGrid
 
def plotImage (self, to_eval=None, lev_i1=None, lev_j1=None, lev_i2=None, lev_j2=None, wave1=-1, wave2=-1, cblabel='', kwargs)
 
def plotContours (self, to_eval, low_level=None, high_level=None, n_levels=20, linestyles='-', clabels=True, log_levels=True, title=None, ax=None, kwargs)
 
def plotLineRatio (self, to_eval, par=None, par_low=None, par_high=None, n_par=10, linestyles='-', title=None, legend=True, loc=2, kwargs)
 

Public Attributes

 log_
 
 calling
 
 elem
 
 spec
 
 atom
 
 tem
 
 den
 
 n_tem
 
 n_den
 
 tem_min
 
 tem_max
 
 den_min
 
 den_max
 
 emis_grid
 
 atomFitsFile
 
 collFitsFile
 
 recFitsFile
 
 tem2D
 

Detailed Description

Instantiates an atom and compute the emissivities of all the atom lines for the (tem, den) 
values of a regularly spaced grid.
Each line is represented in a 2D array, and there are as many arrays as transitions in the atom.
The results can be saved for a later use in a cPickle file.

Constructor & Destructor Documentation

def __init__ (   self,
  elem = None,
  spec = None,
  n_tem = 100,
  n_den = 100,
  tem_min = 5000.,
  tem_max = 20000.,
  den_min = 10.,
  den_max = 1.e8,
  restore_file = None,
  atomObj = None,
  kwargs 
)
Container for the emission line intensity grids depending on Te and Ne.

Usage:
    O3map = pn.EmisGrid('O', 3, n_tem=30, n_den=30)
    O3map = pn.EmisGrid(restore_file='plot/O3_10k.pypic') # Recovers the map from a previous computation

Parameters:
    - elem               element (e.g. 'O')
    - spec               spectrum (e.g. 3)
    - n_tem              number of points of the electron temperature sample
    - n_den              number of points of the electron density sample
    - tem_min, tem_max   limits for the electron temperature
    - den_min, den_max   limits for the electron density
    - restore_file       if set, the emissivities are loaded from this file, 
                 otherwise (None) it is computed
    - atomObj            an atom object. In this case, no need for elem and spec.

Member Function Documentation

def getGrid (   self,
  lev_i = None,
  lev_j = None,
  wave = -1,
  to_eval = None,
  label = None 
)
2D array of a line emissivity for the (Te, Ne) values of a regularly spaced grid.
The line is specified either as the wavelength or the levels. An expression can also be used, 
for example to_eval = 'L(5007)/L(4959)'

Parameters:
    - lev_i, lev_j   levels for the emission line
    - wave           wavelength
    - to_eval        algebraic expression of the line combination to evaluate
def plotContours (   self,
  to_eval,
  low_level = None,
  high_level = None,
  n_levels = 20,
  linestyles = '-',
  clabels = True,
  log_levels = True,
  title = None,
  ax = None,
  kwargs 
)
Plot a contour map of the diagnostic defined by to_eval.

Usage:
    O3map.plotContours('L(4363)/L(5007)')

Parameters:
    - to_eval                   algebraic definition of the line ratio to contour-plot
    - low_levels, high_levels   limit levels for the contour. If not set, the limit of the 
                        ratio values are used.
    - n_levels                  number of levels (20 is the default)
    - linestyles                used for the contour lines (default: solid line)
    - clabels                   Boolean. Controls if line labels are printed (default: True)
    - log_levels                Boolean. If True (default), the log of the line ratio is used.
    - title                     plot title
    - **kwargs                  sent to plt.contour
def plotImage (   self,
  to_eval = None,
  lev_i1 = None,
  lev_j1 = None,
  lev_i2 = None,
  lev_j2 = None,
  wave1 = -1,
  wave2 = -1,
  cblabel = '',
  kwargs 
)
Draw a contour plot of a line ratio. The contour is obtained by a horizontal cut in a temden-emissivity array.
More elaborated plots can be obtained with the Diagnostic object.

Usage:
    O3map.plotImage('L(4363)/L(5007)')
    O3map.plotImage(wave1=4363, wave2=5007)
    
Parameters:
    - to_eval                         algebraic expression of the line combination to draw. May combine L(lambda) and I(i,j).
    - lev_i1, lev_i2, lev_j1, lev_j2  levels of the a lines in case of simple line ratio plot.
    - wave1, wave2                    wavelengths of the two lines in case of simple line ratio plot.
    - cblabel                         a title for the colorbar
    - **kwargs                        any other parameter will be sent to contourf and pcolor
def plotLineRatio (   self,
  to_eval,
  par = None,
  par_low = None,
  par_high = None,
  n_par = 10,
  linestyles = '-',
  title = None,
  legend = True,
  loc = 2,
  kwargs 
)
Plot the diagnostic defined by to_eval as a function of either Ne or Te, with the other
variable as a parameter.

Usage:
    o3grid.plotLineRatio('L(4363)/L(5007)', par='den')
    s2grid.plotLineRatio('I(2,1)/I(3,1)', par='tem', par_low=5000, par_high=20000, n_par=4)

Parameters:
    - to_eval      algebraic definition of the line ratio to contour-plot
    - par          quantity to be used as a parameter (either 'den' or 'tem')
    - par_low      lowest limit of the parameter range
    - par_high     highest limit of the parameter range
    - n_par        number of parameter's values (default: 10)
    - linestyles   used for the contour lines (default: solid)
    - title        plot title
    - legend       Boolean. If True, write legend title (default: True) 
    - **kwargs     sent to plt.contour
def save (   self,
  file_ 
)
Save results for a later use.

Usage:
    O3map.save('plot/O3_30by30.pypic')

Parameter:
    file_  the name of the file in which the emissivity grids are stored

Member Data Documentation

atom
atomFitsFile
calling
collFitsFile
den
den_max
den_min
elem
emis_grid
log_
n_den
n_tem
recFitsFile
spec
tem
tem2D
tem_max
tem_min