Skip to content

Conversation

@laldoroty
Copy link
Collaborator

No description provided.

@laldoroty laldoroty requested review from rknop and wmwv June 13, 2025 22:56
@laldoroty laldoroty linked an issue Jun 13, 2025 that may be closed by this pull request
@laldoroty
Copy link
Collaborator Author

See linked issue (#83) for proof this works.

Copy link
Collaborator

@wmwv wmwv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks fine, I added in some editorializing with ideas for structuring in the future.

sci_image.skyrms, templ_image.skyrms,
data_sci, data_templ,
cp.zeros((4088, 4088)), cp.zeros((4088, 4088)), # Replace with variance
cp.array( sci_image.image.noise ), cp.array( templ_image.image.noise ),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a mild preference for creating these as variables outside the SpaceSFFT_CupyFlow call in parallel with the other. array definitions above. I would put this thus in between the templ_psf = ... and before the wwith fits.open(sci_image.detmask_path ... lines. This would just make the code logically easier to read.

  1. Create all of our arrays
  2. Call function

bkgfunc = LocalBackground(15, 25, MMMBackground())
psfphot = PSFPhotometry(psf, fit_shape, localbkg_estimator=bkgfunc)
psf_results = psfphot(scienceimage, init_params=init_params)
psf_results = psfphot(scienceimage, error=error, init_params=init_params)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having a function named psf_phot and a variable named psfphot is asking for confusion. I would suggest more clearly distinct names.

So really this is a comment on line 98, and about something that was already true before this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a function and a variable--PSFPhotometry is a class in photutils, and I instantiate it as psfphot, and then call it in the line psf_results = psfphot(....

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm talking about the function that this line is in, phrosty.photometry.psf_phot

return {'exptime': exptime, 'area_eff': area_eff, 'gs_zpt': gs_zpt}

def get_zpt(self, zptimg, psf, band, stars, ap_r=4, ap_phot_only=False,
def get_zpt(self, zptimg, err, psf, band, stars, ap_r=4, ap_phot_only=False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that err is passed to psf_phot, but I don't think it's actually logically used in get_zpt because there's no SNR cut.

I appreciate that this is pre-existing from before this PR, but given the relevance, I observe that I find the comment bloack at the beginning of this function confusing. It says "we may have to do our own zeropoints" but "we're going to use calibration information we get from elsewhere."?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... it is, in psf_phot()--unless you mean a larger restructuring to not include psf_phot() in get_zpt()?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but get_zpt doesn't actually used the uncertainties returned by psf_phot.

@laldoroty
Copy link
Collaborator Author

Made some of @wmwv's suggested changes.

@laldoroty laldoroty merged commit 6f5aecb into main Jun 16, 2025
3 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add variance image

3 participants