pencil.visu.rvid_box ==================== .. py:module:: pencil.visu.rvid_box .. autoapi-nested-parse:: This script contains three functions, whereas plot_box is the only function that needs to be called by the user. One can call plot_box from a Python interpreter after importing rvid_box.py. An example call: plot_box(field='lnTT', slice=50, datadir=, unit='temperature'). The output image will be saved to directory visu/images/. The details of the three functions are listed as follows: 1) plot_box : the main function to plot cube objects by assembling slice_xy, slice_xy2, slice_xz and slice_yz together, it calls read_slices first then plot. Arguments: field --- a string variable, indicating which variable to slice. datadir --- a string variable, indicating the path to the data directory. proc --- an integer giving the processor to read a slice from. scale --- a string variable, the scale of the colorbar; default is regular scale, can be changed to logarithmic by setting it 'log' (the base number is 10). quiet --- a boolean variable, print debug information. slice --- the sequential integer number of a slice in given period (starting from 0), default is the first slice (slice 0), can be set to '-1' to generate all slices in given period. colorscale --- a string variable, color scale for the plot. Default is 'brbg_r'. Plotly supports most matplotlib colormaps and you can customize a colorscale on your own. See https://plot.ly/python/colorscales/ for more information. unit --- a string variable, define the unit of the colorbar, shown on its title. axestitle --- a three-tuple indicating the title of x, y and z axis. It is 'x', 'y', 'z' by default. viewpoint --- a three-tuple indicating the viewpoint of the center of the box (default is (0, 0, 0), you can change the center in the layout of the figure in function plot()). imageformat --- a string variable, indicating the format of the output image. Set to 'png' by default. It supports png, jpeg, webp, svg and pdf format. 2) pcn.read.slices: read the four slices 3) plot: plot cube objects Attributes ---------- .. autoapisummary:: pencil.visu.rvid_box.unwrapped pencil.visu.rvid_box.wrapped Functions --------- .. autoapisummary:: pencil.visu.rvid_box.plot pencil.visu.rvid_box.plot_box Module Contents --------------- .. py:data:: unwrapped .. py:data:: wrapped .. py:function:: plot(slice_obj, fields, xyzplane, itt, it, quiet=True, figdir='./images/', imageformat='png', norm='linear', colorscale='brbg_r', cmin=0, cmax=1, dtype='f', viewpoint=(-1.35, -2.1, 0.5), offset=2.0, margin=(20, 20, 30, 0), autosize=False, image_dim=(800, 500), visxyz=[True, True, True], axestitle=('x', 'y', 'z'), xyz=None, cbar_label='', cbar_loc=1.0, cbar_label_pos='right', cbar_thickness=10.0, cbar_borderwidth=None, time=0, textxy=(0, 0), str_unit='', tscale=1.0, isd=3, fontsize=25) :param yzslices --- a numpy array: :param data of a yz slice.: :param xyslices --- a numpy array: :param data of a xy slice.: :param xzslices --- a numpy array: :param data of a xz slice.: :param xy2slices --- a numpy array: :param data of a xy2 slice.: :param scale --- a string variable: can be changed to logarithmic by setting it 'log' (the base number is 10). :param scale of the colorbar; default is regular scale: can be changed to logarithmic by setting it 'log' (the base number is 10). :param : can be changed to logarithmic by setting it 'log' (the base number is 10). :param slice --- the sequential integer number of a slice in given period: default is the first slice (slice 0), can be set to '-1' to generate all slices in given period. :type slice --- the sequential integer number of a slice in given period: starting from 0 :param colorscale --- a string variable: Plotly supports most Matplotlib colormaps and you can customize a colorscale on your own. See https://plot.ly/python/colorscales/ for more information. :param color scale for the plot. Default is 'brbg_r'.: Plotly supports most Matplotlib colormaps and you can customize a colorscale on your own. See https://plot.ly/python/colorscales/ for more information. :param unit --- a string variable: :param define the unit of the colorbar: :param shown on its title.: :param axestitle --- a three-tuple indicating the title of x: :param y and z axis. It is 'x': :param 'y': :param 'z' by default.: :param viewpoint --- a three-tuple indicating the viewpoint of the center of the box: you can change the center in the layout of the figure in function plot()). :type viewpoint --- a three-tuple indicating the viewpoint of the center of the box: default is (0, 0, 0 :param field --- a string variable: :param which variable to slice.: :param time --- a double variable: :param the simulation time when the data to be plotted is generated.: :param xyz --- a three-tuple indicating the value range of the three axes.: :param offset --- a double variable: It is set to 2 by default, meaning the xy2 slice is located below the box by half of the height of the box. :param the offset of xy2 slice below the box.: It is set to 2 by default, meaning the xy2 slice is located below the box by half of the height of the box. :param imageformat --- a string variable: It supports png, jpeg, webp, svg and pdf format. :param indicating the format of the output image. Set to 'png' by default.: It supports png, jpeg, webp, svg and pdf format. .. py:function:: plot_box(slice_obj, fields=['uu1'], datadir='./data/', proc=-1, xyzplane=[], quiet=True, oldfile=False, tstart=0.0, tend=1e+38, islice=-1, imageformat='png', figdir='./images/', colorscale='brbg_r', norm='linear', color_range=None, color_levels=None, viewpoint=(-1.35, -2.1, 0.5), offset=2.0, margin=(20, 20, 30, 0), autosize=False, image_dim=(800, 500), visxyz=[True, True, True], axestitle=('x', 'y', 'z'), xyz=None, cbar_label='$u_x\\,[{\\rm km s}^{-1}]$', cbar_loc=1.0, cbar_label_pos='right', cbar_thickness=10.0, cbar_borderwidth=None, timestamp=False, textxy=(0, 0), tscale=1, str_unit='', isd=2, fontsize=25, unit='unit_velocity', rescale=1.0, par=list())