Skip to content
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

Evaluate grid PSF on a subset? #1405

Open
keflavich opened this issue Aug 29, 2022 · 4 comments
Open

Evaluate grid PSF on a subset? #1405

keflavich opened this issue Aug 29, 2022 · 4 comments

Comments

@keflavich
Copy link
Contributor

How can I run PSF photometry on a cutout of an image using a gridPSF model?

There's probably some clever way to wrap the grid.__call__ to give it an offset, but I haven't come up with it yet.

@keflavich
Copy link
Contributor Author

This might be as simple as

grid.x_0 = bottom_left_x
grid.y_0 = bottom_left_y

but that didn't work, nor did

def evaluate(x, y, flux, x_0, y_0):
    """
    Evaluate the `GriddedPSFModel` for the input parameters.
    """
    # Get the local PSF at the (x_0,y_0)
    psfmodel = grid._compute_local_model(x_0+slcs[1].start, y_0+slcs[0].start)

    # now evaluate the PSF at the (x_0, y_0) subpixel position on
    # the input (x, y) values
    return psfmodel.evaluate(x, y, flux, x_0, y_0)
grid.evaluate = evaluate

@larrybradley
Copy link
Member

Is the cutout small enough that only one ePSF model should be applied, i.e., do you really need an ePSF grid over your cutout?

@keflavich
Copy link
Contributor Author

keflavich commented Aug 29, 2022

For the cutout, I probably only need the one, but I'm really trying to use the cutout as a small-area test region for later extracting photometry generally. I want to work on a cutout to tune the parameters before letting them loose on the full image. So ideally I'd like to keep the same software infrastructure in place.

@larrybradley
Copy link
Member

Something like what you did above by shifting the origin should work in principle, but I'd need look for all the places those shifts should be applied.

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

No branches or pull requests

2 participants