You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does something quite simple: it adds a
model_paramsoption tomake_model_image. It still requires several things to be ready to be un-drafted:make_model_imageBefore 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
psfmachinery and expected to find a way to do it here. A couple of alternatives are available though: 1) just tell people to usedatasets.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.