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]
maps_summary()[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.

profile()[source]
profiles_summary()[source]
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)]

summary_2d(parameters: Tuple[str, ...], regimes: Dict[str, Dict[str, Tuple]], best_lines: List[List[Tuple[str, ...]]], confidences: List[List[float]])[source]

infobs.graphics.latex module

class infobs.graphics.latex.LaTeX(activate: bool = True)[source]

Bases: object

Class 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.latex.latex_line(line: str, transition: bool = True) str[source]

Returns a printable LaTeX version of the line line_name (without degenerate energy levels). If transition is True, the transition is indicated, else it isn’t.

infobs.graphics.latex.latex_param(param: str) str[source]

Returns a printable latex version of the physical parameter param.

infobs.graphics.pdrplots module

class infobs.graphics.pdrplots.PDRPlotter(kelvin: bool = True)[source]

Bases: object

Class 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.

intensity_unit_latex() str[source]
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.

print_parameters_space() None[source]

TODO

save_profiles_from_csv(csv_file: str | DataFrame, path_outputs: str, n_samples: int = 100, legend: bool = True, latex: bool = True, figsize: Tuple[float, float] = (6.4, 2.88), dpi: int = 150) None[source]

TODO

save_slices_from_csv(csv_file: str | DataFrame, path_outputs: str, n_samples: int = 100, contour: bool = False, legend: bool = True, latex: bool = True, figsize: Tuple[float, float] = (6.4, 4.8), dpi: int = 150) None[source]

TODO

Module contents