- class craftutils.wrap.psfex.PSFExModel(craftutils.wrap.psfex.Fittable2DModel)
Warning: does not work. I tried!
Public members¶
-
n_inputs =
2 The number of inputs.
-
n_outputs =
1 The number of outputs.
-
flux =
Parameter('flux', value=nan)
-
x_0 =
Parameter('x_0', value=nan)
-
y_0 =
Parameter('y_0', value=nan)
- PSFExModel(psfex_file: str, data_shape: tuple, flux: float, ...)
Initialize self. See help(type(self)) for accurate signature.
- evaluate(x, y, flux, x_0, y_0)
Evaluate the model on some input variables.
-
param_names =
('flux', 'x_0', 'y_0') Names of the parameters that describe models of this type.
-
__call__(*inputs, model_set_axis=
None, with_bounding_box=False, ...) Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.
-
linear =
False
-
fit_deriv =
None Function (similar to the model’s ~Model.evaluate) to compute the derivatives of the model with respect to its parameters, for use by fitting algorithms. In other words, this computes the Jacobian matrix with respect to the model’s parameters.
-
col_fit_deriv =
True
-
fittable =
True
-
parameter_constraints =
('fixed', 'tied', 'bounds') Primarily for informational purposes, these are the types of constraints that can be set on a model’s parameters.
-
model_constraints =
('eqcons', 'ineqcons') Primarily for informational purposes, these are the types of constraints that constrain model evaluation.
-
standard_broadcasting =
True
- meta
A dict-like object to store optional information.
-
input_units_equivalencies =
None
- classmethod __init_subclass__(**kwargs)
This method is called when a class is subclassed.
- __repr__()
Return repr(self).
- __str__()
Return str(self).
- __setattr__(attr, value)
Implement setattr(self, name, value).
-
get_bounding_box(with_bbox=
True) Return the
bounding_boxof a model if it exists orNoneotherwise.
- input_shape(inputs)
Get input shape for bounding_box evaluation
-
name =
'Model'
- has_inverse()
Returns True if the model has an analytic or user inverse defined.
- set_slice_args(*args)
- without_units_for_data(**kwargs)
Return an instance of the model for which the parameter values have been converted to the right units for the data, then the units have been stripped away.
- output_units(**kwargs)
Return a dictionary of output units for this model given a dictionary of fitting inputs and outputs
- with_units_from_data(**kwargs)
Return an instance of the model which has units for which the parameter values are compatible with the data units specified.
- sum_of_implicit_terms(*args, **kwargs)
Evaluate the sum of any implicit model terms on some input variables. This includes any fixed terms used in evaluating a linear model that do not have corresponding parameters exposed to the user. The prototypical case is astropy.modeling.functional_models.Shift, which corresponds to a function y = a + bx, where b=1 is intrinsically fixed by the type of model, such that sum_of_implicit_terms(x) == x. This method is needed by linear fitters to correct the dependent variable for the implicit term(s) when solving for the remaining terms (ie. a = y - bx).
-
render(out=
None, coords=None) Evaluate a model at fixed positions, respecting the
bounding_box.
-
prepare_inputs(*inputs, model_set_axis=
None, equivalencies=None, **) This method is used in ~astropy.modeling.Model.__call__ to ensure that all the inputs to the model can be broadcast into compatible shapes (if one or both of them are input as arrays), particularly if there are more than one parameter sets. This also makes sure that (if applicable) the units of the input will be compatible with the evaluate method.
- prepare_outputs(broadcasted_shapes, *outputs, **kwargs)
- copy()
Return a copy of this model.
- deepcopy()
Return a deep copy of this model.
-
classmethod rename(name=
None, inputs=None, outputs=None) Return a copy of this model with a new name.
-
coerce_units(input_units=
None, return_units=None, ...) Attach units to this (unitless) model.
Properties¶
- property inputs
- property outputs
- property input_units_strict
Enforce strict units on inputs to evaluate. If this is set to True, input values to evaluate will be in the exact units specified by input_units. If the input quantities are convertible to input_units, they are converted. If this is a dictionary then it should map input name to a bool to set strict input units for that parameter.
- property input_units_allow_dimensionless
Allow dimensionless input (and corresponding output). If this is True, input values to evaluate will gain the units specified in input_units. If this is a dictionary then it should map input name to a bool to allow dimensionless numbers for that input. Only has an effect if input_units is defined.
- property uses_quantity
True if this model has been created with ~astropy.units.Quantity objects or if there are no parameters.
- property bbox_with_units
- property model_set_axis
The index of the model set axis–that is the axis of a parameter array that pertains to which model a parameter value pertains to–as specified when the model was initialized.
- property param_sets
Return parameters as a pset.
- property parameters
A flattened array of all parameter values in all parameter sets.
- property sync_constraints
This is a boolean property that indicates whether or not accessing constraints automatically check the constituent models current values. It defaults to True on creation of a model, but for fitting purposes it should be set to False for performance reasons.
- property fixed
A
dictmapping parameter names to their fixed constraint.
- property bounds
A
dictmapping parameter names to their upper and lower bounds as(min, max)tuples or[min, max]lists.
- property tied
A
dictmapping parameter names to their tied constraint.
- property eqcons
List of parameter equality constraints.
- property ineqcons
List of parameter inequality constraints.
- property inverse
Returns a new ~astropy.modeling.Model instance which performs the inverse transform, if an analytic inverse is defined for this model.
- property has_user_inverse
A flag indicating whether or not a custom inverse model has been assigned to this model by a user, via assignment to
model.inverse.
- property bounding_box
A tuple of length n_inputs defining the bounding box limits, or raise NotImplementedError for no bounding_box.
- property has_user_bounding_box
A flag indicating whether or not a custom bounding_box has been assigned to this model by a user, via assignment to
model.bounding_box.
- property cov_matrix
Fitter should set covariance matrix, if available.
- property stds
Standard deviation of parameters, if covariance matrix is available.
- property separable
A flag indicating whether a model is separable.
- property input_units
This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).
- property return_units
This property is used to indicate what units or sets of units the output of evaluate should be in, and returns a dictionary mapping outputs to units (or None if any units are accepted).
- property n_submodels
Return the number of components in a single model, which is obviously 1.
-
n_inputs =