Skip to main content
`Ctrl`+`K`

# ModelBoundingBox

class astropy.modeling.bounding_box.ModelBoundingBox(intervals, model, ignored=None, order='C')

  Bases: `_BoundingDomain`

  A model’s bounding box.

  Parameters:
    intervals `python:dict`
      A dictionary containing all the intervals for each model input

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

    model `Model`

      The Model this bounding_box is for.

    ignored `python:list`

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

    order optional, `python: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.

  Attributes Summary

  `dimension` |
  `intervals` | Return bounding_box labeled using input positions.
  `named_intervals` | Return bounding_box labeled using input names.

  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, ...]) | Construct a valid bounding box for a model.

  Attributes Documentation

  dimension
  intervals

    Return bounding_box labeled using input positions.

  named_intervals

    Return bounding_box labeled using input names.

  Methods Documentation

  bounding_box(order=None)
    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)
  domain(resolution, order=None)
  fix_inputs(model, fixed_inputs, _keep_ignored=False)

    Fix the bounding_box for a `fix_inputs` compound model.

    Parameters:
      model `Model`

        The new model for which this will be a bounding_box

      fixed_inputs `python:dict`

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

      keep_ignored bool

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

  has_interval(key)
  prepare_inputs(input_shape, inputs)

    Get prepare the inputs with respect to the bounding box.

    Parameters:
      input_shape `python:tuple`

        The shape that all inputs have be reshaped/broadcasted into

      inputs `python:list`

        List of all the model inputs

    Returns:
      valid_inputs `python:list`

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

      valid_index numpy:array_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=None, order='C', _preserve_ignore=False, **kwargs)

    Construct a valid bounding box for a model.

    Parameters:
      model `Model`

        The model for which this will be a bounding_box

      bounding_box `python:dict`, `python:tuple`

        A possible representation of the bounding box

      order optional, `python:str`
        The order that a tuple representation will be assumed to be

          Default: ‘C’