Commit 59269ca5 authored by Akke Viitanen's avatar Akke Viitanen
Browse files

Fixes the reference catalog #2

parent e6464b43
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3
# encoding: utf-8
# Author: Akke Viitanen
# Email: akke.viitanen@helsinki.fi
# Date: 2025-09-12 00:39:53

"""
Middleware for reference catalog config
"""

import numpy as np
from lsst.meas.algorithms.convertRefcatManager import ConvertGaiaManager

import util

class ConvertAgileManager(ConvertGaiaManager):

    """
    Convert from AGILE to the reference catalog format. This class is
    piggybacking on the existing Gaia converter (proper motions, covariances),
    but only overloads the way fluxes are handled.
    """

    def _getFluxes(self, input):
        ret = {}
        for band in "ugrizy":
            ret[f"{band}_flux"] = 1000.0 * util.mag_to_flux(input[band]),
            ret[f"{band}_fluxErr"] = np.zeros_like(input[band]),
        return ret