Beispiel #1
0
    def _update_light_curve_meta_data(self, light_curve_data_day: LightCurve,
                                      snid: int) -> Union[LightCurve, None]:
        """
        Loads light curve data of the given SNID

        Parameters
        ----------
        light_curve_data_day
            An instance of LightCurve class instance of the data
        snid
            Object id for the transient to be fitted.

        Returns
        -------
        light_curve_data_day
            LightCurve class data for the given SNID
        """
        if light_curve_data_day is not None:
            snid_mask = self.metadata['object_id'].values == snid
            if np.sum(snid_mask) > 0:
                light_curve_data_day.redshift = self.metadata['true_z'].values[
                    snid_mask][0]
                light_curve_data_day.sncode = (
                    self.metadata['true_target'].values[snid_mask][0])
                light_curve_data_day.id = snid

                return light_curve_data_day

        return None
Beispiel #2
0
    def _update_light_curve_meta_data(self, light_curve_data_day: LightCurve,
                                      snid: int) -> Union[LightCurve, None]:
        """ Add docstring!!!
        """

        if light_curve_data_day is not None:
            snid_mask = self.metadata['object_id'].values == snid
            if np.sum(snid_mask) > 0:
                light_curve_data_day.redshift = self.metadata['true_z'].values[
                    snid_mask][0]
                light_curve_data_day.sncode = (
                    self.metadata['true_target'].values[snid_mask][0])
                light_curve_data_day.id = snid

                return light_curve_data_day

        return None