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

Implement utility functions purely related to survey and filter numbers #24

Merged
merged 6 commits into from
Mar 2, 2022

Conversation

aboucaud
Copy link
Collaborator

Tentative implementation of functions for

  • for converting mag to counts
  • for computing the mean sky background
  • for typical expected background on a moonless night

Fixes #15

@aboucaud aboucaud changed the title [WIP} Implement utility functions purely related to survey and filter numbers Implement utility functions purely related to survey and filter numbers Oct 10, 2021
@aboucaud aboucaud marked this pull request as draft October 10, 2021 16:09
@aboucaud
Copy link
Collaborator Author

@beckermr @esheldon, would you be able to provide me with actual numbers / conversions that you already computed to be able to check the code, say for Rubin or other survey ?

@beckermr
Copy link

We've been using the stuff in wldeblending, so if these functions match that, then it should be good to go. I'd suggest downloading their catalogs and converting the same entries w/ the same survey properties maybe?

@aboucaud aboucaud marked this pull request as ready for review March 2, 2022 17:16
@aboucaud
Copy link
Collaborator Author

aboucaud commented Mar 2, 2022

We'll leave the typical background on a moonless night out of this PR for now.

@ismael-mendoza I think I'll merge this branch now

@aboucaud aboucaud merged commit ba38b5a into main Mar 2, 2022
@aboucaud aboucaud deleted the utility-functions branch March 2, 2022 22:42


def mag2counts(magnitude, survey_name, filter_name):
"""Convert source magnitude to counts for a given filter of a survey
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may mention that it consists of electron counts ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But is it really ?
For me, this is photon count. To be electron counts it needs to be multiplied by the gain.
It does not change a thing for LSST because the gain is set to 1.0 but for other surveys this is relevant.

This comes back to another related question about the units of the gain currently in electron/adu that should be changed to electron/count if we would like them to be compatible.

Copy link
Collaborator

@mpaillassa mpaillassa Mar 4, 2022

Choose a reason for hiding this comment

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

Hm I think that the conversion from photons to electrons depends on the quantum efficiency while the gain is effectively transforming electrons to ADUs (it is in e-/ADU such that going from e- to ADUs is done by dividing by the gain).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Coming back to this, as we are using zeropoints indicating magnitudes giving 1e-/s, I would say that the fluxes we compute with those zeropoints should be in e-.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See #93

@mpaillassa
Copy link
Collaborator

ping @aboucaud (I don't know if you have a notification as the PR has been merged)

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 functions for converting magnitudes to counts, getting noise levels for images, etc.
3 participants