CenterGrid#
- class cherab.lhd.emc3.barycenters.CenterGrid(zone: str, index_type: str = 'coarse', dataset: str = 'emc3/grid-360.nc', **kwargs)Source#
Bases:
objectClass for center grids of EMC3-EIRENE grids.
One EMC3-based cell is divided to six tetrahedra and the center point of each cell is defined as the average of the six tetrahedra’s barycenters. Considering various indexing ways, final center points are averaged by integrating several cells, which must have 3 dimensional resolutions w.r.t. radial/poloidal/toroidal direction.
Total number of center grid is L x M x N, each letter of which means:L: Radial grid resolutionM: Poloidal grid resolutionN: Toroidal grid resolution.- Parameters:
- zone{“zone0”, “zone11”}
Name of zone, currently supporting a few zones.
- index_type{“coarse”, “cell”}
Indexing way of center grids, by default
"coarse".- dataset
str,optional Name of dataset, by default
"emc3/grid-360.nc".- **kwargs
Keyword arguments to pass to
fetch_file.
Examples
>>> cgrid = CenterGrid("zone0", index_type="cell") >>> cgrid CenterGrid(zone='zone0', index_type='cell', dataset='/path/to/cache/cherab/lhd/emc3/grid-360.nc') >>> str(cgrid) 'CenterGrid with cell index_type (zone: zone0, L: 82, M: 601, N: 37)'
Methods
__getitem__(key)Return center grid coordinates indexed by (l, m, n, xyz).
get_lmn(index)Return (l, m, n) indices from 1D index.
Attributes
DataArrayof center grid coordinates.Array of center grid coordinates of each volume.
Indexing way of center grids.
Path to dataset.
Shape of center grids.
Name of zone.