osyris.map#
- osyris.map(*layers, direction='z', dx=None, dy=None, dz=None, filename=None, title=None, plot=True, mode=None, norm=None, vmin=None, vmax=None, origin=None, resolution=None, operation='sum', ax=None, **kwargs)#
Create a 2D spatial map of a region inside a simulation domain. By default, the map represents a plane with zero thickness. A thick slab or cube can also be computed by specifying a thickness via the
dzargument. In this case, the resulting 3D box is integrated along thezdirection before being sent to the image rendering.- Parameters:
layers – Dicts or Arrays representing the quantities to be mapped onto the generated image.
direction (str | list) –
The vector normal to the map. Possible choices are:
'x','y', or'z'representing the cartesian axesa list of 3 numbers representing the components of the vector, e.g.
[1, 0.5, 2]'top'or'side'for automatic top or side view of a disk, according to the angular momentum computed around the center of the plotted region
dx (Quantity | None) – The horizontal size of the plotted region. Default is
None, in which case the entire horizontal range of the simulation domain is plotted.dy (Quantity | None) – The vertical size of the plotted region. If not specified, it will either be equal to
dxifdxis notNone, or the entire vertical range of the simulation domain ifdxisNone. Default isNone.dz (Quantity | None) – The depth range over which the
zdimension is to be integrated. Default isNone, in which case a plane with no thickness is plotted.filename (str | None) – If specified, the returned figure is also saved to file. Default is
None.title (str | None) – The title of the figure. Default is
None.plot (bool) – Make a plot if
True. If not, just return thePlotobject containing the data that would be used to generate the plot. Default isTrue.mode (str | None) – The rendering mode for the map. Possible choices are
'image','contourf', and'contour'for scalar Arrays,'vec'and'stream'for vector quantities. Default isNone, which selects therender_modeset in the user configuration file ('image'by default).norm (str | None) – The colormap normalization. Possible values are
'linear'and'log'. Default isNone(='linear').vmin (float | None) – Minimum value for colorbar range. Default is
None.vmax (float | None) – Maximum value for colorbar range. Default is
None.origin (Array | None) – An Array describing the position of the center of the map (with 2 or 3 components depending on the dimensionality of the simulation).
resolution (int | dict | None) – Resolution of the generated map. This can either be an integer or a dict. In the case of an integer, it represents the number of pixels used for the horizontal and vertical dimensions. For a dictionary, the following syntax should be used:
resolution={'x': 128, 'y': 192}. Default is256.operation (str) – Numpy operation to apply along the
zdimension ifdzis notNone. Example values are'sum','nansum','nanmin','nanmax','nanmean','mean','min', and'max'. Default is'sum'.ax (object | None) – A matplotlib axes inside which the figure will be plotted. Default is
None, in which case some new axes a created.
- Return type:
Plot