xbout.region.Region#
- class xbout.region.Region(*, name, ds=None, xinner_ind=None, xouter_ind=None, ylower_ind=None, yupper_ind=None, connection_inner_x=None, connection_outer_x=None, connection_lower_y=None, connection_upper_y=None)[source]#
Bases:
object
Contains the global indices bounding a single topological region, i.e. a region with logically rectangular contiguous data.
Also stores the names of any neighbouring regions.
- __init__(*, name, ds=None, xinner_ind=None, xouter_ind=None, ylower_ind=None, yupper_ind=None, connection_inner_x=None, connection_outer_x=None, connection_lower_y=None, connection_upper_y=None)[source]#
- Parameters:
name (
str
) – Name of the regionds (
BoutDataset
, optional) – Dataset to get variables to calculate coordinates fromxinner_ind (
int
, optional) – Global x-index of the inner points of this regionxouter_ind (
int
, optional) – Global x-index of the points just beyond the outer edge of this regionylower_ind (
int
, optional) – Global y-index of the lower points of this regionyupper_ind (
int
, optional) – Global y-index of the points just beyond the upper edge of this regionconnection_inner_x (
str
, optional) – The region inside this one in the x-directionconnection_outer_x (
str
, optional) – The region outside this one in the x-directionconnection_lower_y (
str
, optional) – The region below this one in the y-directionconnection_upper_y (
str
, optional) – The region above this one in the y-direction
Methods
__init__
(*, name[, ds, xinner_ind, ...])- type name:
get_inner_guards_slices
(*, mxg[, myg])Return x- and y-dimension slices that select mxg guard cells on the inner-x side of this region from the global DataArray.
get_lower_guards_slices
(*, myg[, mxg])Return x- and y-dimension slices that select myg guard cells on the lower-y side of this region from the global DataArray.
get_outer_guards_slices
(*, mxg[, myg])Return x- and y-dimension slices that select mxg guard cells on the outer-x side of this region from the global DataArray.
get_slices
([mxg, myg])Return x- and y-dimension slices that select this region from the global DataArray.
get_upper_guards_slices
(*, myg[, mxg])Return x- and y-dimension slices that select myg guard cells on the upper-y side of this region from the global DataArray.
- get_inner_guards_slices(*, mxg, myg=0)[source]#
Return x- and y-dimension slices that select mxg guard cells on the inner-x side of this region from the global DataArray.
- get_lower_guards_slices(*, myg, mxg=0)[source]#
Return x- and y-dimension slices that select myg guard cells on the lower-y side of this region from the global DataArray.
- get_outer_guards_slices(*, mxg, myg=0)[source]#
Return x- and y-dimension slices that select mxg guard cells on the outer-x side of this region from the global DataArray.