fix_inputs#
- astropy.modeling.fix_inputs(modelinstance, values, bounding_boxes=None, selector_args=None)[source]#
This function creates a compound model with one or more of the input values of the input model assigned fixed values (scalar or array).
- Parameters:
- modelinstance
Modelinstance This is the model that one or more of the model input values will be fixed to some constant value.
- values
dict A dictionary where the key identifies which input to fix and its value is the value to fix it at. The key may either be the name of the input or a number reflecting its order in the inputs.
- bounding_boxes
dict, optional A dictionary of bounding boxes for the fixed model, keyed on the fixed input values, from which a
CompoundBoundingBoxis constructed. If not given, the returned model has no bounding box.- selector_args
listoftuple, optional The selector arguments used to construct the compound bounding box from
bounding_boxes. If not given, defaults to(key, True)for each input named invalues.
- modelinstance
Examples
>>> from astropy.modeling.models import Gaussian2D >>> g = Gaussian2D(1, 2, 3, 4, 5) >>> gv = fix_inputs(g, {0: 2.5})
Results in a 1D function equivalent to Gaussian2D(1, 2, 3, 4, 5)(x=2.5, y)