PyNeb
1.1.2
PyNeb Reference Manua
|
Inherits object.
Public Member Functions | |
def | getDiagFromLabel (self, label) |
def | getDiags (self) |
def | getDiagLabels (self) |
def | getAllDiags (self) |
def | getAllDiagLabels (self) |
def | getUniqueAtoms (self) |
def | addDiag |
def | addAll (self) |
def | delDiag |
def | addDiagsFromObs (self, obs) |
def | setAtoms (self, atom_dic) |
def | addClabel (self, label, clabel) |
def | plot |
def | getCrossTemDen |
def | getDiagLimits (self, diag) |
Public Attributes | |
log_ | |
calling | |
diags | |
The dictionary containing the diagnostics. More... | |
atomDict | |
The dictionary containing the atoms used for the diagnostics. More... | |
OmegaInterp | |
Diagnostics is the class used to manage the diagnostics and to computed physical conditions (electron temperatures and densities) from them. It is also the class that plots the diagnostic Te-Ne diagrams.
def addAll | ( | self | ) |
Insert all the possible diagnostics in the Object (no parameters)
def addClabel | ( | self, | |
label, | |||
clabel | |||
) |
Add an alternative label to a diagnostic that can be used when plotting diagnostic diagrams.
def addDiag | ( | self, | |
label = None , |
|||
diag_tuple = None , |
|||
atom = None , |
|||
wave_range = None |
|||
) |
Add diagnostics to the list of available diagnostics. It can either be one of the built-in diagnostics, a new, user-defined one, or a subset of the built-in diagnostics corresponding to a given atom or wavelength. Parameters: - label a string or a list of strings describing the diagnostic, e.g. '[OIII] 4363/5007'. If it is not a key of diags_dict (a diagnostic define by PyNeb), diag_tuple must also be specified - diag_tuple a 3 elements tuple containing: + the atom, e.g. 'Ar5' + the algebraic description of the diagnostic, in terms of line wavelengths or blends or levels, e.g. '(L(6435)+L(7006))/L(4626)' + the algebraic description of the error, e.g. 'RMS([E(6435)*L(6435)/(L(6435)+L(7006)), E(7006)*L(7006)/(L(6435)+L(7006)), E(4626)])' - atom the selected atom, e.g. 'O3' - wave_range the selected wavelength range Usage: diags.addDiag('[OIII] 4363/5007') diags.addDiag('[OIII] 5007/51m', ('O3', 'L(5007)/L(51800)', 'RMS([E(51800), E(5007)])')) diags.addDiag(atom='O3') diags.addDiag(wave_range=[4000, 6000])
def addDiagsFromObs | ( | self, | |
obs | |||
) |
Add all the possible diagnostics that can be computed from an Observation object Usage: diags.addDiagsFromObs(obs) Parameter: obs an Observation object
def delDiag | ( | self, | |
label = None |
|||
) |
Remove a diagnostic, based on its label. Parameter: - label the label of the diagnostic ('all': removes all the diagnostics)
def getAllDiagLabels | ( | self | ) |
Return the labels of all the possible diagnostics. No parameter.
def getAllDiags | ( | self | ) |
Return the definitions (tuples) of all the possible diagnostics. No parameter.
def getCrossTemDen | ( | self, | |
diag_tem, | |||
diag_den, | |||
value_tem = None , |
|||
value_den = None , |
|||
obs = None , |
|||
i_obs = None , |
|||
guess_tem = 10000 , |
|||
tol_tem = 1. , |
|||
tol_den = 1. , |
|||
max_iter = 5 , |
|||
maxError = 1e-3 , |
|||
start_tem = -1 , |
|||
end_tem = -1 , |
|||
start_den = -1 , |
|||
end_den = -1 |
|||
) |
Cross-converge the temperature and density derived from two sensitive line ratios, by inputting the quantity derived with one line ratio into the other and then iterating. The temperature- and density-sensitive ratios can be input directly or as an Observation object Parameters: - diag_tem temperature-sensitive diagnostic line ratio - diag_den density-sensitive diagnostic line ratio - value_tem value of the temperature-sensitive diagnostic - value_den value of the density-sensitive diagnostic - obs np.Observation object. Values for observed temperature and density diagnostics are taken from it if value_tem and value_den are None - i_obs index of the observations to be used from obs. If None, all the observations are considered. May be a boolean array - guess_tem temperature assumed in the first iteration, in K - tol_tem tolerance of the temperature result, in % - tol_den tolerance of the density result, in % - max_iter maximum number of iterations to be performed, after which the function will throw a result - maxError maximum error in the calls to getTemDen, in % - start_tem, end_tem lower and upper limit of the explored temperature range - start_den, end_den lower and upper limit of the explored density range Example: tem, den = diags.getCrossTemDen('[OIII] 4363/5007', '[SII] 6731/6716', 0.0050, 1.0, guess_tem=10000, tol_tem = 1., tol_den = 1., max_iter = 5)
def getDiagFromLabel | ( | self, | |
label | |||
) |
Return the definition of a diagnostic (the 3 or 4 elements tuple) Usage: diags.getDiagFromLabel('[NII] 5755/6548') Parameters: -label a diagnostic label
def getDiagLabels | ( | self | ) |
Return the labels of all the diagnostics defined in the Object No parameter.
def getDiagLimits | ( | self, | |
diag | |||
) |
Return the low and high density values for a given diagnostic
def getDiags | ( | self | ) |
Return the definitions (tuples) of all the diagnostics defined in the Object. No parameter.
def getUniqueAtoms | ( | self | ) |
Return a numpy.ndarray of the ions needed by the diagnostics. Unique is applied to the list before returning. No parameter.
def plot | ( | self, | |
emis_grids, | |||
obs, | |||
quad = True , |
|||
i_obs = None , |
|||
alpha = 0.3 , |
|||
ax = None , |
|||
error_band = True |
|||
) |
PLotting tool to generate Te-Ne diagrams. Usage: diags.plot(emisgrids, obs, i_obs=3) Parameters: - emis_grids A dictionary of EmisGrid objects refereed by their atom strings (e.g. 'O3') This can for example be the output of pn.getEmisGridDict() - obs A pn.Observation object that is supposed to contain the line intensities used for the plot (corrected intensities). - quad If True (default) the sum of the error is quadratic,otherwise is linear. - i_obs reference for the observation to be plotted, in case there is more than one in the obs object - alpha Transparency for the error bands in the plot - error_band Boolean: plot [default] an error band
def setAtoms | ( | self, | |
atom_dic | |||
) |
Define the dictionary containing the atoms used for the diagnostics. A dictionary of atom instantiations refereed by atom strings, for example: {'O3': pn.Atom('O', 3)}
atomDict |
The dictionary containing the atoms used for the diagnostics.
Diagnostics constructor Parameters: - addAll switch to include all defined diagnostics (default = False) - OmegaInterp parameter sent to Atom, default is 'Cheb', other can be 'linear'
calling |
diags |
The dictionary containing the diagnostics.
log_ |
OmegaInterp |