infobs.graphics package
Submodules
infobs.graphics.infoplots module
- class infobs.graphics.infoplots.InfoPlotter(line_formatter: Callable, param_formatter: Callable)[source]
Bases:
object- bar(lines: List[str], mis: List[float], errs: List[float | Tuple[float, float]] | None = None, colors: List[str] | None = None, sort: bool = False, nfirst: int | None = None, transitions: bool = True, rotation: int = 90, fontsize: int = 20, capsize: int = 8, barwidth: float = 0.6, bottom_val: float | None = None) Axes[source]
TODO
- bar_comparison(lines: List[str], mis: Dict[str, List[float]], errs: Dict[str, List[float]] | None, labels: Dict[str, str], transitions: bool = True, rotation: int = 90, bottom_val: float | None = None, show_legend: bool = False, fontsize: int = 20, capsize: int = 8, barwidth: float = 0.6) Axes[source]
TODO
- line_formatter: Callable
- lines_comb_formatter(lines: List[str] | str, transition: bool = True) str[source]
Returns a printable latex version of the combination of lines lines. If the combination has only one element, it is treated as a single line.
- map(xticks: ndarray, yticks: ndarray, mat: ndarray, vmax: float | None = None, cmap: str = 'jet', paramx: str | None = None, paramy: str | None = None)[source]
- math_mode: bool
- matrix(lines: List[str], mis: List[List[float]], show_diag: bool = True, transitions: bool = True) Figure[source]
- param_formatter: Callable
- params_comb_formatter(params: List[str] | str) str[source]
Returns a printable latex version of the combination of physical parameters params. If the combination has only one element, it is treated as a single parameter.
- regime_formatter(param_name: str, reg: Tuple[float | None, float | None] | None, lower_bound: float | None = 0, upper_bound: float | None = None) str[source]
- summary_1d(parameters: Tuple[str, ...], regimes: Dict[str, Dict[str, Tuple]], best_lines: List[Tuple[str, ...]], confidences: List[float]) Figure[source]
Plot the summary of the most informative lines. The constraint is on a single parameter. parameter is the set of physical parameter to estimate Format (example): (‘g0’,) regimes contains the bounds for all subregimes Format (example): {‘av’: {‘1’: [1, 2], ‘2’: [2, None]}} best_lines contains a Format (example): [(‘13co10’, ‘c18o10’), (‘n2hp10’)] confidence contains the probabilities for the lines in best_lines to be the best. Format (example): [(line1, line2), (line3)]
infobs.graphics.latex module
- class infobs.graphics.latex.LaTeX(activate: bool = True)[source]
Bases:
objectClass to handle activation of the plotting with latex if available on the current installation.
Example: ``` with LaTeX():
# Do some matplotlib stuff
- activate: bool
- previous_mode: bool
infobs.graphics.pdrplots module
- class infobs.graphics.pdrplots.PDRPlotter(kelvin: bool = True)[source]
Bases:
objectClass to handle the plotting of profiles and slices in the parameter space in a very user-friendly way.
Plotter for 1D and 2D line profiles.
- param_scales = {'Av': 'log', 'G0': 'log', 'Pth': 'log', 'angle': 'linear'}
- param_units_latex = {'Av': 'mag', 'G0': '', 'Pth': 'K.cm$^{-3}$', 'angle': 'deg'}
- param_units_raw = {'Av': 'mag', 'G0': '', 'Pth': 'K.cm-3', 'angle': 'deg'}
- parameters = ['Av', 'G0', 'Pth', 'angle']
- plot_profile(lines: List[str] | str, Av: float | None = None, G0: float | None = None, Pth: float | None = None, angle: float | None = None, n_samples: int = 100, logy: bool = True, legend: bool = True, latex: bool = True, fontsize: int = 12, legend_loc: str = 'best') None[source]
Only one variable among Avmax, G0, Pth and angle has to be null.
- plot_slice(line: str, Av: float | None = None, G0: float | None = None, Pth: float | None = None, angle: float | None = None, n_samples: int = 100, cmap: str | None = None, transpose: bool = False, contour: bool = False, logz: bool = True, legend: bool = True, latex: bool = True, fontsize: int = 12, legend_loc: str = 'best') Tuple[Axes, Colorbar][source]
Only one variable among P, Avmax, radm and angle has to be null.