Exemplo n.º 1
0
    def fit_bazin(self, band: str):
        """Extract Bazin features for one filter.

        Parameters
        ----------
        band: str
            Choice of broad band filter

        Returns
        -------
        bazin_param: list, float
            Best fit parameters for the Bazin function: [a, b, t0, tfall, trise] followed by a float corresponding to 
            the value of the cost function for the fit.
        """

        # build filter flag
        filter_flag = self.photometry['band'] == band

        # get info for this filter
        time = self.photometry['mjd'].values[filter_flag]
        ### Do we want to be subtracting off the minimum flux here?
        flux = self.photometry['flux'].values[filter_flag] - np.min(
            self.photometry['flux'].values)
        errors = self.photometry['fluxerr'].values[filter_flag]

        # fit Bazin function
        bazin_param = fit_scipy(time - time[0], flux, errors)

        return bazin_param
Exemplo n.º 2
0
    def fit_bazin(self, band: str):
        """Extract Bazin features for one filter.

        Parameters
        ----------
        band: str
            Choice of broad band filter

        Returns
        -------
        bazin_param: list
            Best fit parameters for the Bazin function: [a, b, t0, tfall, trise]
        """

        # build filter flag
        filter_flag = self.photometry['band'] == band

        # get info for this filter
        time = self.photometry['mjd'].values[filter_flag]
        flux = self.photometry['flux'].values[filter_flag]

        # fit Bazin function
        bazin_param = fit_scipy(time - time[0], flux)

        return bazin_param