grids#

class pinballrt.grids.UniformCartesianGrid(ncells=9, dx=<Quantity 1. AU>, device='cpu')#

Bases: Grid

A Cartesian grid with uniform cell sizes.

Parameters:
ncellsint or tuple of int

The number of cells in each dimension. If an int is provided, the same number of cells will be used in all dimensions. If a tuple is provided, it should contain three integers specifying the number of cells in the x, y, and z dimensions.

dxastropy Quantity or tuple of astropy Quantity

The size of each cell in each dimension. If a Quantity is provided, the same cell size will be used in all dimensions. If a tuple is provided, it should contain three Quantities specifying the cell size in the x, y, and z dimensions.

devicestr

The device to use for computations. Can be “cpu” or “cuda”.

class pinballrt.grids.UniformSphericalGrid(ncells=9, dr=<Quantity 1. AU>, mirror=True, device='cpu')#

Bases: Grid

A grid in spherical coordinates with uniform cell sizes in r, theta, and phi.

Parameters:
ncellsint or tuple

The number of cells in each dimension. If an integer is provided, the same cells will be used in all dimensions. If a tuple is provided, it should contain three integers specifying the number of cells in the x, y, and z dimensions.

drastropy Quantity

The size each cell in the radial dimension.

mirrorbool

If True, the grid will only cover theta from 0 to pi/2, with mirror symmetry applied at the midplane. If False, the grid will cover theta from 0 to pi.

devicestr

The device to use for computations. Can be “cpu” or “cuda”.

class pinballrt.grids.LogUniformSphericalGrid(ncells=9, rmin=<Quantity 0.1 AU>, rmax=<Quantity 4.5 AU>, mirror=True, device='cpu')#

Bases: UniformSphericalGrid

A grid in spherical coordinates with logarithmically spaced cells in r and uniform cell sizes in theta and phi.

Parameters:
ncellsint or tuple

The number of cells in each dimension. If an integer is provided, the same cells will be used in all dimensions. If a tuple is provided, it should contain three integers specifying the number of cells in the x, y, and z dimensions.

rminastropy Quantity

The minimum radius of the grid.

rmaxastropy Quantity

The maximum radius of the grid.

mirrorbool

If True, the grid will only cover theta from 0 to pi/2, with mirror symmetry applied at the midplane. If False, the grid will cover theta from 0 to pi.

devicestr

The device to use for computations. Can be “cpu” or “cuda”.