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

DM-27106: Add array-based operations to simple photoCalib routines. #630

Merged
merged 2 commits into from Mar 25, 2022

Conversation

erykoff
Copy link
Contributor

@erykoff erykoff commented Mar 10, 2022

This also adds a property to know if the given photoCalib is constant (spatially-varying) or not.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Thank you for using astropy units for magnitudes and fluxes here. The more places we can get rid of people hard-coding 3631, the better!

My only substantial objection is the usual one about making the internals of the PhotoCalib object visible in the public API. It's unfortunate that we've built up an API in afw that is now not going to be used much since most people (even within DM) are going to pandas/parquet tables.

include/lsst/afw/image/PhotoCalib.h Show resolved Hide resolved
Parameters
----------
instFluxes : `np.ndarray` (N,)
Array of instFluxes to convert.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that instFluxes have units of counts?

Parameters
----------
x : `np.ndarray` (N,)
Array of x values.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should all these x/y parameters say they are in pixels? Should we also say that in the method docstrings (where you say "for numpy arrays")?

pointXShiftXArray,
pointXShiftYArray
)
np.testing.assert_array_equal(localCalib2, localCalib)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want explicit equality here? We do have self.assertFloatsEqual() for that.

@erykoff erykoff merged commit 776a55d into main Mar 25, 2022
@erykoff erykoff deleted the tickets/DM-27106 branch March 25, 2022 14:58
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.

None yet

2 participants