Logical

class jwst.transforms.models.Logical(condition, compareto, value, **kwargs)[source]

Bases: astropy.modeling.core.Model

Substitute values in an array where the condition is evaluated to True.

Similar to numpy’s where function.

Parameters:
  • condition (str) – A string representing the logical, one of GT, LT, NE, EQ
  • compareto (float, ndarray) – A number to compare to using the condition If ndarray then the input array, compareto and value should have the same shape.
  • value (float, ndarray) – Value to substitute where condition is True.

Attributes Summary

conditions
inputs
outputs

Methods Summary

__call__(x[, model_set_axis, …]) Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.
evaluate(x) Evaluate the model on some input variables.

Attributes Documentation

conditions = {'EQ': <ufunc 'equal'>, 'GT': <ufunc 'greater'>, 'LT': <ufunc 'less'>, 'NE': <ufunc 'not_equal'>}
inputs = ('x',)
outputs = ('x',)

Methods Documentation

__call__(x, model_set_axis=None, with_bounding_box=False, fill_value=nan, equivalencies=None)

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(x)[source]

Evaluate the model on some input variables.