PSFConvolvedModel2D
- class petrofit.modeling.PSFConvolvedModel2D(model, psf=None, oversample=None, psf_oversample=None, name=None, **kwargs)[source]
Bases:
FittableModel
Fittable model for converting
FittableModel
andCompoundModel
into 2D images. This model takes the input sub-model and adds PSF convolution, as well as PSF convolution.- Parameters:
- model
astropy.modeling.core.Model
Base model to convert into an image.
- psfarray
2D normalized (i.e sum(psf) = 1) image of the point spread function.
- oversampleNone or int or tuple
Oversampling factor. If set to None, no oversampling will be applied to the image. If an integer is provided, the whole image will be oversampled by that factor. If a tuple of
(center_x, center_y, box_length, oversample_factor)
can be used to define an oversampling window.box_length
andoversample_factor
should always be integers.center_x
andcenter_y
can be either float values of the oversampling window or string names of parameters in the input model (for example"x_0"
).- psf_oversampleNone or int
Oversampling factor of the PSF relative to data. The
oversample
factor should be an integer multiple of the PSF oversampling factor (i.eoversample > psf_oversample
).- namestring
Name for the
PSFConvolvedModel2D
model instance.
- model
Attributes Summary
Returns the cached sampling grid
Returns sub-model with current parameters of the
PSFConvolvedModel2D
The number of inputs.
The number of outputs.
Sampling grid oversample Factor
On most
Model
classes this is a class attribute, but forPSFConvolvedModel2D
models it is an instance attribute since each input sub-model can have different parameters.PSF Image
PSF oversample factor relative to data
Methods Summary
__call__
(*inputs[, model_set_axis, ...])Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.
Clears cached grid and resets class attributes to default values
evaluate
(x, y, *params, **kwargs)Evaluate the model on some input variables.
Attributes Documentation
- cache_grid
Returns the cached sampling grid
- model
Returns sub-model with current parameters of the
PSFConvolvedModel2D
- n_inputs = 2
The number of inputs.
- n_outputs = 1
The number of outputs.
- oversample
Sampling grid oversample Factor
- param_names
Names of the parameters that describe models of this type.
The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.
When defining a custom model class the value of this attribute is automatically set by the
Parameter
attributes defined in the class body.
- psf
PSF Image
- psf_oversample
PSF oversample factor relative to data
Methods Documentation
- __call__(*inputs, model_set_axis=None, with_bounding_box=False, fill_value=nan, equivalencies=None, inputs_map=None, **new_inputs)
Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.