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-37102: convertGaiaXpManager added #300

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 24 additions & 1 deletion python/lsst/meas/algorithms/convertRefcatManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

__all__ = ["ConvertRefcatManager", "ConvertGaiaManager"]
__all__ = ["ConvertRefcatManager", "ConvertGaiaManager", "ConvertGaiaXpManager"]

from ctypes import c_int
import os.path
Expand Down Expand Up @@ -454,3 +454,26 @@ def gaiaFluxToFlux(flux, zeroPoint):
result['phot_rp_mean_fluxErr'] = result['phot_rp_mean_flux'] / input['phot_rp_mean_flux_over_error']

return result


class ConvertGaiaXpManager(ConvertRefcatManager):
"""Special-case convert manager for Gaia XP spectrophotometry catalogs,
that have fluxes/flux errors, instead of magnitudes/mag errors. The input
flux and error values are in units of W/Hz/(m^2) (Gaia Collaboration, Montegriffo et al. 2022).
The the flux and fluxErr fields in the output catalog have units of nJy.
"""

def _getFluxes(self, inputData):
result = {}
for item in self.config.mag_column_list:

error_col_name = item.replace("_flux_", "_flux_error_")

result[item + "_flux"] = (
inputData[item] * u.Watt / u.Hz / u.meter / u.meter
).to_value(u.nJy)
result[item + "_fluxErr"] = (
inputData[error_col_name] * u.Watt / u.Hz / u.meter / u.meter
).to_value(u.nJy)

return result