@@ -369,7 +369,7 @@ class for more information.
369369 """
370370
371371 # Default value for parameter initialization (invalid sources)
372- DEFAULT_PARAM_VALUE = np .nan
372+ _DEFAULT_PARAM_VALUE = np .nan
373373
374374 def __init__ (self , psf_model , fit_shape , * , finder = None , grouper = None ,
375375 fitter = None , fitter_maxiters = 100 , xy_bounds = None ,
@@ -489,7 +489,7 @@ def _init_model_param_storage(self, n_sources):
489489 for model_param in model_params :
490490 # initialize all parameters with np.nan (for invalid sources)
491491 param_data [model_param ] = np .full (n_sources ,
492- self .DEFAULT_PARAM_VALUE )
492+ self ._DEFAULT_PARAM_VALUE )
493493 param_data [f'{ model_param } _fixed' ] = [None ] * n_sources
494494 param_data [f'{ model_param } _bounds' ] = [None ] * n_sources
495495
@@ -523,7 +523,7 @@ def _cache_fitted_parameters(self, row_index, model):
523523 template_model = self .psf_model
524524 for param_name in template_model .param_names :
525525 # Set all parameters to np.nan for invalid sources
526- param_data [param_name ][row_index ] = self .DEFAULT_PARAM_VALUE
526+ param_data [param_name ][row_index ] = self ._DEFAULT_PARAM_VALUE
527527
528528 template_param = getattr (template_model , param_name )
529529 param_data [f'{ param_name } _fixed' ][row_index ] = (
@@ -1803,6 +1803,34 @@ def _get_model_image_params(self):
18031803
18041804 def make_model_image (self , shape , * , psf_shape = None ,
18051805 include_localbkg = False ):
1806+ """
1807+ Create a model image from the fit results.
1808+
1809+ Parameters
1810+ ----------
1811+ shape : 2-tuple of int
1812+ The shape (ny, nx) of the output image.
1813+
1814+ psf_shape : 2-tuple of int, optional
1815+ The shape (ny, nx) of the PSF model to be rendered. If
1816+ `None`, the shape of the PSF model is determined by the
1817+ ``fit_shape`` parameter.
1818+
1819+ include_localbkg : bool, optional
1820+ Whether to include the local background in the model image.
1821+ Default is `False`.
1822+
1823+ Returns
1824+ -------
1825+ image : `~numpy.ndarray`
1826+ The model image.
1827+
1828+ Raises
1829+ ------
1830+ ValueError
1831+ If no results are available. Please run the `PSFPhotometry`
1832+ instance first.
1833+ """
18061834 if self .results is None :
18071835 msg = ('No results available. Please run the PSFPhotometry '
18081836 'instance first.' )
@@ -1817,6 +1845,34 @@ def make_model_image(self, shape, *, psf_shape=None,
18171845
18181846 def make_residual_image (self , data , * , psf_shape = None ,
18191847 include_localbkg = False ):
1848+ """
1849+ Create a residual image from the fit results.
1850+
1851+ Parameters
1852+ ----------
1853+ data : 2D `~numpy.ndarray`
1854+ The data image.
1855+
1856+ psf_shape : 2-tuple of int, optional
1857+ The shape (ny, nx) of the PSF model to be rendered. If
1858+ `None`, the shape of the PSF model is determined by the
1859+ ``fit_shape`` parameter.
1860+
1861+ include_localbkg : bool, optional
1862+ Whether to include the local background in the model image
1863+ that is subtracted from the data. Default is `False`.
1864+
1865+ Returns
1866+ -------
1867+ image : `~numpy.ndarray`
1868+ The residual image.
1869+
1870+ Raises
1871+ ------
1872+ ValueError
1873+ If no results are available. Please run the `PSFPhotometry`
1874+ instance first.
1875+ """
18201876 if self .results is None :
18211877 msg = ('No results available. Please run the PSFPhotometry '
18221878 'instance first.' )
0 commit comments