Closed entaylor closed 3 months ago
Hi @entaylor , yes there is a very easy way to reset any parameters you like in this kind of format :) you can just do something like psf_model["n"].value = 2
inside you're loop and that will set the value.
Awesome; works; thank you! This is what i needed.
Describe the bug A clear and concise description of what the bug is.
My fits are getting stuck at the boundary of the allowed fitting range, and i cannot find an easy way to reset/recover so that the model object is reusable.
I want to fit many stars with the same PSF model.
My strategy is to define a PSF model like:
Then, i look over all of my stars, treating each one as a point source with this PSF object, and with psf_mode='full' to get the best fits for the PSF shape parameters for each star.
So far, so good.
The issue is that when the fit hits the boundary of allowed values (namely, it hits the maximum allowed value of the shape parameter, which is 8.), then all subsequent fits have the same bad value.
The way that i interpret this is that each subsequent fit is using the previous outcome as its initial guess, and then also when the fit finds itself near to the boundary it cannot easily escape.
One solution would be to create a new PSF object for each star. That would add extra and unnecessary overheads with the initialisation of the same kind of object over and over. But also, what i want to do next is to fit all the stars with the same PSF model, so i would prefer to have each point source use the same PSF model. (Hopefully that's clear?)
I think what i am missing is a way to set or reset the values of my PSF model, so that i can start each star in the loop with the same starting values and the same object.
Is there a simple way to reset the parameters of a (PSF) model so that the same object can be reused for multiple fits?
PS. Sorry i haven't got back to my earlier issues; today is the first day i have managed to get back to this project! But i promise i will, now that the teaching semester has finished ... !