tests.test_fit_star_shape.utils module

Class Inheritance Diagram

Inheritance diagram of Image, Interpreter, c_bool, c_double

A collection of functions used by the fit_star_shape unit tests.

tests.test_fit_star_shape.utils.evaluate_psffit_terms(sources, terms_str)[source]

Evaluate the specified terms to properly formatted array for PSF fitting.

Parameters:
  • sources – See sources argument to make_image_and_source_list().

  • terms_str ([str]) – List of strings to evaluate using entries in sources.

Returns:

The terms the PSF map is allowed to depend on evaluated for each source, organized suitably to pass as the fifth argument to FitStarShape.fit().

Return type:

2-D numpy array

tests.test_fit_star_shape.utils.make_image_and_source_list(sources, subpix_map)[source]

Create an image and a list of the sources in it ready for psf fitting.

Parameters:
  • sources

    A list of dictionaries with at least the following keywords:

    • x: The x coordinate of the source center.

    • y: The y coordinate of the source center.

    • psf: An instance of some sub-class of PSFBase giving the sources’s PSF. It should already be scaled to the desired flux.

    • enabled(optional): True/False flag of whether to include

      this source in shape fitting.

  • subpix_map – The sub-pixel map to impose on the image. For more details see same name argument of Image.add_source.

Returns:

The sources added to the image. The fields give the variables defined for the sources.

Return type:

numpy record array