ModelBoundingBox

class astropy.modeling.bounding_box.ModelBoundingBox(intervals: Dict[int, astropy.modeling.bounding_box._Interval], model, ignored: Optional[List[int]] = None, order: str = 'C')[source]

Bases: astropy.modeling.bounding_box._BoundingDomain

A model’s bounding box

Parameters
intervalsdict
A dictionary containing all the intervals for each model input

keys -> input index values -> interval for that index

modelModel

The Model this bounding_box is for.

ignoredlist

A list containing all the inputs (index) which will not be checked for whether or not their elements are in/out of an interval.

orderoptional, str

The ordering that is assumed for the tuple representation of this bounding_box. Options: ‘C’: C/Python order, e.g. z, y, x. (default), ‘F’: Fortran/mathematical notation order, e.g. x, y, z.

Methods

validate :

Constructs a valid bounding_box from any of the allowed respresentations of a bounding_box.

bounding_box :

Contructs a tuple respresentation

domain :

Contructs a discretization of the points inside the bounding_box

Attributes Summary

dimension

ignored

ignored_inputs

intervals

Return bounding_box labeled using input positions

named_intervals

Return bounding_box labeled using input names

order

Methods Summary

bounding_box([order])

Return the old tuple of tuples representation of the bounding_box

copy([ignored])

domain(resolution[, order])

fix_inputs(model, fixed_inputs[, _keep_ignored])

Fix the bounding_box for a fix_inputs compound model.

has_interval(key)

prepare_inputs(input_shape, inputs)

Get prepare the inputs with respect to the bounding box.

validate(model, bounding_box[, ignored, order])

Construct a valid bounding box for a model.

Attributes Documentation

dimension
ignored
ignored_inputs
intervals

Return bounding_box labeled using input positions

named_intervals

Return bounding_box labeled using input names

order

Methods Documentation

bounding_box(order: Optional[str] = None)[source]
Return the old tuple of tuples representation of the bounding_box

order=’C’ corresponds to the old bounding_box ordering order=’F’ corresponds to the gwcs bounding_box ordering.

copy(ignored=None)[source]
domain(resolution, order: Optional[str] = None)[source]
fix_inputs(model, fixed_inputs: dict, _keep_ignored=False)[source]

Fix the bounding_box for a fix_inputs compound model.

Parameters
modelModel

The new model for which this will be a bounding_box

fixed_inputsdict

Dictionary of inputs which have been fixed by this bounding box.

keep_ignoredbool

Keep the ignored inputs of the bounding box (internal argument only)

has_interval(key)[source]
prepare_inputs(input_shape, inputs)Tuple[Any, Any, Any][source]

Get prepare the inputs with respect to the bounding box.

Parameters
input_shapetuple

The shape that all inputs have be reshaped/broadcasted into

inputslist

List of all the model inputs

Returns
valid_inputslist

The inputs reduced to just those inputs which are all inside their respective bounding box intervals

valid_indexarray_like

array of all indices inside the bounding box

all_out: bool

if all of the inputs are outside the bounding_box

classmethod validate(model, bounding_box, ignored: Optional[list] = None, order: str = 'C', **kwargs)[source]

Construct a valid bounding box for a model.

Parameters
modelModel

The model for which this will be a bounding_box

bounding_boxdict, tuple

A possible representation of the bounding box

orderoptional, str
The order that a tuple representation will be assumed to be

Default: ‘C’