Load the filter from a txt file

        Parameters
        ----------
        file: str
            The filepath

def load_txt(self, filepath):
        """Load the filter from a txt file

        Parameters
        ----------
        file: str
            The filepath
        """
        self.raw = np.genfromtxt(filepath, unpack=True)

        # Convert to Angstroms if microns
        if self.raw[0][-1] < 100:
            self.raw[0] = self.raw[0] * 10000

        self.WavelengthUnit = str(q.AA)
        self.ZeroPointUnit = str(q.erg/q.s/q.cm**2/q.AA)
        x, f = self.raw

        # Get a spectrum of Vega
        vega_file = resource_filename('svo_filters', 'data/spectra/vega.txt')
        vega = np.genfromtxt(vega_file, unpack=True)[: 2]
        vega[0] = vega[0] * 10000
        vega = rebin_spec(vega, x)*q.erg/q.s/q.cm**2/q.AA
        flam = np.trapz((vega[1]*f).to(q.erg/q.s/q.cm**2/q.AA), x=x)
        thru = np.trapz(f, x=x)
        self.ZeroPoint = (flam/thru).to(q.erg/q.s/q.cm**2/q.AA).value

        # Calculate the filter's properties
        self.filterID = os.path.splitext(os.path.basename(filepath))[0]
        self.WavelengthPeak = np.max(self.raw[0])
        f0 = f[: np.where(np.diff(f) > 0)[0][-1]]
        x0 = x[: np.where(np.diff(f) > 0)[0][-1]]
        self.WavelengthMin = np.interp(max(f)/100., f0, x0)
        f1 = f[::-1][: np.where(np.diff(f[::-1]) > 0)[0][-1]]
        x1 = x[::-1][: np.where(np.diff(f[::-1]) > 0)[0][-1]]
        self.WavelengthMax = np.interp(max(f)/100., f1, x1)
        self.WavelengthEff = np.trapz(f*x*vega, x=x)/np.trapz(f*vega, x=x)
        self.WavelengthMean = np.trapz(f*x, x=x)/np.trapz(f, x=x)
        self.WidthEff = np.trapz(f, x=x)/f.max()
        self.WavelengthPivot = np.sqrt(np.trapz(f, x=x)/np.trapz(f/x**2, x=x))
        self.WavelengthPhot = np.trapz(f*vega*x**2, x=x)/np.trapz(f*vega*x, x=x)

        # Half max stuff
        halfmax = f.max()/2.
        hm_x1 = x[f > halfmax][0]
        hm_x2 = x[f > halfmax][-1]
        self.FWHM = hm_x2 - hm_x1
        self.WavelengthCen = (hm_x1 + hm_x2)/2.

        # Add missing attributes
        self.path = ''
        self.pixels_per_bin = self.raw.shape[-1]
        self.n_bins = 1