Skip to content

Conversation

@eteq
Copy link
Member

@eteq eteq commented May 16, 2025

This PR does something quite simple: it adds a model_params option to make_model_image. It still requires several things to be ready to be un-drafted:

  • Add the option to the subclass' use of make_model_image
  • Tests
  • Asimple example in the docs?

Before I do any of these though, a key question for @larrybradley : do you like this idea or do you think there's a better way to do this?

The context is that I was talking to a photutils user who wanted to add simulated stars to an image, and they naturally came to the psf machinery and expected to find a way to do it here. A couple of alternatives are available though: 1) just tell people to use datasets.make_model_image. I could modify this in that case to just be a documentation change that shows how to do this starting from a PSF. 2) add something to the PSF base classes instead of expecting them to build a photometry object even though they aren't necessarily planning to do photometry.

@eteq eteq added the psf label May 16, 2025
@larrybradley
Copy link
Member

@eteq I don't think adding a model_params keyword to the *PSFPhotometry.make_model_image method is the best approach. That method can only be called after the *PSFPhotometry has been run (via __call__) and has results. It's intended of course to make images based on the photometry results (PSF fit parameters).

I created datasets.make_model_image for artificial (star) images, which I think fulfills the user's needs. It's not in the psf package because it's a generic "model" renderer -- but the downside is that it may be hard to find for users wanting specifically to create artificial star images. Let me know if you have documentation suggestions to help make that function easier to find.

I did add a make_psf_model_image function to the psf package (I use that a lot for unit tests), but it generates random sources. Perhaps that function should be modified to allow an optional catalog (via model_params) to be input, which would then override the random source generation? That function may be easier to find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants