astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Models and Fitting (`astropy.modeling`) »
- Reference/API »
- CompoundBoundingBox

# CompoundBoundingBox

class astropy.modeling.bounding_box.CompoundBoundingBox(bounding_boxes: Dict[Any, ModelBoundingBox], model, selector_args: _SelectorArguments, create_selector: Callable = None, ignored: List[int] = None, order: str = 'C')

  Bases: `_BoundingDomain`

  A model’s compound bounding box

  Parameters:
    bounding_boxes `python:dict`
      A dictionary containing all the ModelBoundingBoxes that are possible

        keys -> _selector (extracted from model inputs) values -> ModelBoundingBox

    model `Model`

      The Model this compound bounding_box is for.

    selector_args`_SelectorArguments`

      A description of how to extract the selectors from model inputs.

    create_selector optional

      A method which takes in the selector and the model to return a valid bounding corresponding to that selector. This can be used to construct new bounding_boxes for previously undefined selectors. These new boxes are then stored for future lookups.

    order optional, `python:str`

      The ordering that is assumed for the tuple representation of the bounding_boxes.

  Attributes Summary

  `bounding_boxes` |
  `create_selector` |
  `named_selector_tuple` |
  `selector_args` |

  Methods Summary

  `copy`() |
  `fix_inputs`(model, fixed_inputs) | Fix the bounding_box for a `fix_inputs` compound model.
  `prepare_inputs`(input_shape, inputs) | Get prepare the inputs with respect to the bounding box.
  `validate`(model, bounding_box[, ...]) | Construct a valid compound bounding box for a model.

  Attributes Documentation

  bounding_boxes
  create_selector
  named_selector_tuple
  selector_args

  Methods Documentation

  copy()
  fix_inputs(model, fixed_inputs: dict)

    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.

  prepare_inputs(input_shape, inputs) → Tuple[Any, Any, Any]

    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: dict, selector_args=None, create_selector=None, ignored: list = None, order: str = 'C', _preserve_ignore: bool = False, **kwarg)

    Construct a valid compound bounding box for a model.

    Parameters:
      model `Model`

        The model for which this will be a bounding_box

      bounding_box `python:dict`

        Dictionary of possible bounding_box respresentations

      selector_args optional

        Description of the selector arguments

      create_selector optional, `python:callable()`

        Method for generating new selectors

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

          Default: ‘C’