Inherits object.
|
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) |
|
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.
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.
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