pencil.calc.part_to_grid ======================== .. py:module:: pencil.calc.part_to_grid Functions --------- .. autoapisummary:: pencil.calc.part_to_grid.part_to_grid Module Contents --------------- .. py:function:: part_to_grid(xp, yp, zp=False, quantity=False, Nbins=[1024, 1024, 1024], sim=False, extent=False, fill_gaps=False) Bins quantity based on position data xp and yp to 1024^2 bins like a histrogram. This method is not using TSC. :param - xp: array of x and y positions :param yp: array of x and y positions :param - zp: specify if 3D run, set False to have zp == 0 :param - quantity: array of same shape as xp and yp, but with quantity to bin, set it False to count number of occurrences/histrogram2d :param - Nbins: number of histrogram bins for each direction. if 2d only the first two entries in Nbins are used :param - sim: to extract extent from by loading ghostzone-free grid :param - extent: [[xmin, xmax],[ymin, ymax]] or set false and instead give a sim set extent manually e.g. if you want to include ghost zones :param - fill_gaps interpolate empty grid cells: Returns: arr, xgrid, ygrid - arr: 2d array with binned values - x-/ygrid: linspace of used x/y grid - zgrid: if zp != False .. rubric:: Example vpx = part_to_grid_2d(pvar.xp, pvar.yp, pvar.vpx), notice that this will execute pc.get_sim() internally to get the extent