oimPlots
various plotting function and classes
Functions:
|
Creates a plot with error bars. |
|
Creates a plot of the x and y data with the z data as color. |
|
Plot the uv coverage of the data. |
|
Get the color indices of the data depending on the colorisation. |
|
Plot the data from the oifits files. |
|
Set the x-axis to the wavelength of the data. |
|
Classes:
|
|
|
A class to plot the wavelength of the data. |
|
Class derived from plt.Axes that allows easy plotting of oifits data |
- oimodeler.oimPlots._errorplot(axe, x: ndarray, y: ndarray, dy: ndarray, smooth: int | None = 1, **kwargs)
Creates a plot with error bars.
- Parameters:
axe (matplotlib.axes.Axes) – The axes to plot on.
x (numpy.ndarray) – The x data.
y (numpy.ndarray) – The y data.
dy (np.ndarray) – The error on the y data.
smooth (int, optional) – The smoothing factor. The default is 1.
- oimodeler.oimPlots._colorPlot(axe, x: ndarray, y: ndarray, z: ndarray, flag: ndarray = None, setlim: bool | None = False, **kwargs) Collection
Creates a plot of the x and y data with the z data as color.
- Parameters:
axe (matplotlib.axes.Axes) – The axes to plot on.
x (np.ndarray) – The x data.
y (numpy.ndarray) – The y data.
z (numpy.ndarray) – The colorbar data.
flag (None or numpy.ndarray, optional) – Flagging of bad data (not to be plotted). The default is None.
setlim (bool, optional) – Automatically sets the plot’s limit. The default is False.
- Returns:
res – The collection of the plot.
- Return type:
matplotlib.collections.Collection
- oimodeler.oimPlots.uvPlot(oifitsList: HDUList, arrname: str = 'OI_VIS2', unit: Quantity = Unit('m'), stringunitformat: str = 'latex_inline', color: str | None = None, maxi: float | None = None, grid: bool = True, gridcolor: str = 'k', fontsize: int | None = None, xytitle: List[bool] = [True, True], showLegend: bool = True, showColorbar: bool = True, showFlagged: bool = False, colorTab: List[str] | None = None, axe: Axes | None = None, title: str | None = None, cunit: Quantity = Unit('m'), legendkwargs: Dict = {}, wavelength: Quantity | None = None, **kwargs) Axes
Plot the uv coverage of the data.
- Parameters:
oifitsList (astropy.io.fits.HDUList) – A list of oifits files.
arrname (str, optional) – The name of the array. The default is “OI_VIS2”.
unit (astropy.units.Quantity, optional) – The unit of the data. The default is u.m.
stringunitformat (str, optional) – The unit format. The default is “latex_inline”.
color (str, optional) – The color of the plot. The default is None.
maxi (float, optional) – The maximum value of the plot. The default is None.
grid (bool, optional) – Show the grid. The default is True.
gridcolor (str, optional) – The color of the grid. The default is “k”.
fontsize (int, optional) – The fontsize of the labels. The default is None.
xytitle (list of bool, optional) – Show the x and y labels. The default is [True, True].
showLegend (bool, optional) – Show the legend. The default is True.
showColorbar (bool, optional) – Show the colorbar. The default is True.
showFlagged (bool, optional) – Show the u,v point even when data are flagged. The default is False.
colorTab (list of str, optional) – A list with colornames to apply. The default is None.
axe (matplotlib.axes.Axes, optional) – An axes to be plotted onto. The default is None.
title (str, optional) – The title of the plot. The default is None.
cunit (astropy.units.Quantity, optional) – The colorbar unit. The default is astropy.unit.m.
legendkwargs (dict, optional) – Keyword arguments for the legend. The default is {}.
wavelength (astropy.units.m) – A singular wavelength to display for the cycle/rad unit. The default is None (shows all wavelengths).
- Returns:
axe – The axes of the plot.
- Return type:
matplotlib.axes.Axes
- oimodeler.oimPlots.getColorIndices(oifitsList: HDUList, color: str, yarr: ndarray, yname: str, flatten: bool = False) Tuple[ndarray, List[str]]
Get the color indices of the data depending on the colorisation.
- Parameters:
oifitsList (fits.HDUList) – A list of oifits files.
color (str) – The color of the plot.
yarr (numpy.ndarray) – The data.
yname (str) – The data name.
flatten (bool, optional) – If toggled, flattens the data. The default is False.
- Returns:
idx (numpy.ndarray) – The color indices.
names (list of str) – The names of the colors.
- oimodeler.oimPlots.oimPlot(oifitsList: HDUList, xname: str, yname: str, axe: Axes | None = None, xunit: Quantity | None = None, yunit: Quantity | None = None, cname: str | None = None, cunit: str | None = None, xlim: float | None = None, ylim: float | None = None, xscale: str | None = None, yscale: str | None = None, shortLabel: bool = True, color: str | None = None, colorTab: str | None = None, showColorbar: bool = True, errorbar: bool = False, showFlagged: bool = False, colorbar: bool = True, legend: bool = False, kwargs_error: Dict = {}, **kwargs)
Plot the data from the oifits files.
- Parameters:
oifitsList (fits.HDUList) – A list of oifits files.
xname (str) – The name of the x-axis parameter.
yname (str) – The name of the y-axis parameter.
axe (matplotlib.axes.Axes, optional) – The axes to plot on. The default is None.
xunit (astropy.units.Quantity, optional) – The unit of the x-axis parameter. The default is None.
yunit (astropy.units.Quantity, optional) – The unit of the y-axis parameter. The default is None.
cname (str, optional) – The name of the colorbar. The default is None.
cunit (astropy.units.Quantity, optional) – The unit of the colorbar. The default is None.
xlim (float, optional) – The limit of the x-axis. The default is None.
ylim (float, optional) – The limit of the y-axis. The default is None.
xscale (str, optional) – The scale of the x-axis. The default is None.
yscale (str, optional) – The scale of the y-axis. The default is None.
shortLabel (str, optional) – The label format. The default is True.
color (str, optional) – The color of the plot. The default is None.
colorTab (str, optional) – The color table. The default is None.
errorbar (bool, optional) – If toggled shows error bars. The default is False.
showFlagged (bool, optional) – If toggled shows flagged data. The default is False.
legend (bool, optional) – show the plot legend False.
kwargs_error (dict, optional) – Additional keyword arguments for the error plot. The default is {}.
**kwargs (dict) – Keyword arguments for the plot.
- Returns:
res – DESCRIPTION.
- Return type:
TYPE
- class oimodeler.oimPlots._HandlerColorLineCollection(marker_pad=0.3, numpoints=None, **kwargs)
- create_artists(legend, artist, xdescent, ydescent, width, height, fontsize, trans)
Create the artists for the legend.
- class oimodeler.oimPlots.oimWlTemplatePlots(*args, **kwargs)
A class to plot the wavelength of the data.
- autoShape(oifitsList: HDUList, shape: List[List[str]] | None = [['VIS2DATA', None], ['VISAMP', None], ['VISPHI', None], ['T3AMP', None], ['T3PHI', None], ['FLUXDATA', None]]) None
Automatically set the shape of the plot.
- Parameters:
oifitsList (fits.HDUList) – A list of oifits files.
shape (list of list of str, optional) – The shape of the plot.
- plot(oifitsList: HDUList, add: bool = True, plotFunction: Axes = <function Axes.plot>, plotFunctionkwarg: Dict = {}) None
Plot the data from the oifits files.
- set_xunit(xunit: Quantity) None
Set the unit of the x-axis.
- set_wllim(*arg) None
Set the wavelength limits of the plot.
- set_xlim(*arg) None
Set the x-axis limits of the plot.
- set_ylim(dataTypes: str | List[str], *arg) None
Set the y-axis limits of the plot.
- set_xlabels(mode: str, *arg, **kwargs) None
Set the x-axis label of the plot.
- set_ylabels(mode: str, *arg) None
Set the y-axis label of the plot.
- set_legends(*arg, **kwargs) None
Set the legend of the plot.
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, canvas=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, constrained_layout=<UNSET>, constrained_layout_pads=<UNSET>, dpi=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, figheight=<UNSET>, figwidth=<UNSET>, frameon=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, layout_engine=<UNSET>, legends=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, size_inches=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tight_layout=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, wllim=<UNSET>, xlabels=<UNSET>, xlim=<UNSET>, xunit=<UNSET>, ylabels=<UNSET>, ylim=<UNSET>, zorder=<UNSET>)
Set multiple properties at once.
Supported properties are
- Properties:
agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: float or None animated: bool canvas: FigureCanvas clip_box: ~matplotlib.transforms.BboxBase or None clip_on: bool clip_path: Patch or (Path, Transform) or None constrained_layout: unknown constrained_layout_pads: unknown dpi: float edgecolor: :mpltype:`color` facecolor: :mpltype:`color` figheight: float figure: unknown figwidth: float frameon: bool gid: str in_layout: bool label: object layout_engine: {‘constrained’, ‘compressed’, ‘tight’, ‘none’, .LayoutEngine, None} legends: unknown linewidth: number mouseover: bool path_effects: list of .AbstractPathEffect picker: None or bool or float or callable rasterized: bool size_inches: (float, float) or float sketch_params: (scale: float, length: float, randomness: float) snap: bool or None tight_layout: unknown transform: ~matplotlib.transforms.Transform url: str visible: bool wllim: unknown xlabels: unknown xlim: unknown xunit: unknown ylabels: unknown ylim: unknown zorder: float
- oimodeler.oimPlots.oimSimplePlotWavelength(oifitsList: HDUList, ifile: int, dataType: str, iB: int, extver=None, axe: Axes | None = None, plotFunction: Axes = <function Axes.plot>, xunit: Quantity = Unit("m"), plotFunctionkwarg: Dict = {}) None
Set the x-axis to the wavelength of the data.
- Parameters:
oifitsList (fits.HDUList) – A list of oifits files.
ifile (int)
The index of the file.
dataType (str) – The data type to plot.
iB (int)
The baseline index.
extver (int, optional)
The extension version. The default is None.
- class oimodeler.oimPlots.oimAxes(fig, *args, facecolor=None, frameon=True, sharex=None, sharey=None, label='', xscale=None, yscale=None, box_aspect=None, forward_navigation_events='auto', **kwargs)
Class derived from plt.Axes that allows easy plotting of oifits data
- name = 'oimAxes'
- xtype = None
- ytype = None
- colorbar = None
- uvplot(oifits: HDUList, **kwargs)
Plot the uv coverage of the oifits data.
- oiplot(oifitsList: HDUList, xname: str, yname: str, **kwargs)
Plot the data from the oifits files.
- autolim()
Set the limits of the axes to the data.
- legend(**kwargs)
Add a legend to the plot.
- set_xscale(value, **kwargs)
Set the xscale of the plot.
- set_yscale(value, **kwargs)
Set the yscale of the plot.
- _subclass_uses_cla = False
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, forward_navigation_events=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, subplotspec=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)
Set multiple properties at once.
Supported properties are
- Properties:
adjustable: {‘box’, ‘datalim’} agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: float or None anchor: (float, float) or {‘C’, ‘SW’, ‘S’, ‘SE’, ‘E’, ‘NE’, …} animated: bool aspect: {‘auto’, ‘equal’} or float autoscale_on: bool autoscalex_on: unknown autoscaley_on: unknown axes_locator: Callable[[Axes, Renderer], Bbox] axisbelow: bool or ‘line’ box_aspect: float or None clip_box: ~matplotlib.transforms.BboxBase or None clip_on: bool clip_path: Patch or (Path, Transform) or None facecolor or fc: :mpltype:`color` figure: ~matplotlib.figure.Figure or ~matplotlib.figure.SubFigure forward_navigation_events: bool or “auto” frame_on: bool gid: str in_layout: bool label: object mouseover: bool navigate: bool navigate_mode: unknown path_effects: list of .AbstractPathEffect picker: None or bool or float or callable position: [left, bottom, width, height] or ~matplotlib.transforms.Bbox prop_cycle: ~cycler.Cycler rasterization_zorder: float or None rasterized: bool sketch_params: (scale: float, length: float, randomness: float) snap: bool or None subplotspec: unknown title: str transform: ~matplotlib.transforms.Transform url: str visible: bool xbound: (lower: float, upper: float) xlabel: str xlim: (left: float, right: float) xmargin: float greater than -0.5 xscale: unknown xticklabels: unknown xticks: unknown ybound: (lower: float, upper: float) ylabel: str ylim: (bottom: float, top: float) ymargin: float greater than -0.5 yscale: unknown yticklabels: unknown yticks: unknown zorder: float
- oimodeler.oimPlots.vltiplot(axe=None, configs: ndarray = array([], dtype=float64), marker: str = 'o', markersize: int = 10, telcolor: str = 'k', labels: bool = True, fontsize: int = 2)