-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] model does not fit correctly when the image is not normalized #11
Comments
The best way to approach this would probably be to predefine the |
Alternatively, it could be only noted in the docs so that users are cautious |
I'm not sure this is a bug, like you said if you want to fit the amplitude, you need to specify it, otherwise you could do func_kwargs = (;amps=fixed_amp_value)
PSFModels.fit(...; func_kwargs=func_kwargs)
PRs are welcome! As a note, by the way, all of the astropy PSF models require an amplitude, and don't make any assumptions about normalized or unnormalized data, the same as we do here. Are there other tools you are used to that "automatically" apply these pre-processing steps? If, so, I'd be interested in checking them out! |
Right.., I think bug was not the right word. It is just that the 'default' method for fitting does not adhere to the probably most frequent use of it... That is that fitting the normalized PSF model into a most surely unnormalized view into the image. Right? I will go through the docs and add some comment about this. With that, I think that it would be settled. Would that be OK? |
Hi! Like your work!
There is a slight problem when trying to fit a model to bead image in practice... The optimization without specifying the
amp
parameter does not work with real bead images, because they are usually not normalized to(0,1)
. For example, I have this image of a bead:and the fitted
gaussian
PSF model gives:When I normalize the bead image by
then the image looks like this:
and the fitted
gaussian
PSF model looks like this:Which is a much better fit.
Note, that just specifying the
amp = 1
parameter would not help in this case, because it makes the optimization much more likely to land at a local optimum. This could be solved only by setting theamp
parameter very close to the true value. Here is the result when optimizing againstamp
also with the same bead:The text was updated successfully, but these errors were encountered: