How to use the fsps.get_stats function in fsps

To help you get started, we’ve selected a few fsps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dfm / python-fsps / colors.py View on Github external
def __init__(self, redshift, logz, **kwargs):
        self.redshift = redshift
        mets = fsps.logz
        mi1, mi2 = sorted(np.argsort(np.abs(mets - logz))[:2])
        self.met1, self.met2 = mets[mi1], mets[mi2]
        self.zmet = logz

        fsps.compute(mi1, **kwargs)
        self._mags_1 = fsps.get_mags(redshift=redshift)
        s1 = fsps.get_stats()

        fsps.compute(mi2, **kwargs)
        self._mags_2 = fsps.get_mags(redshift=redshift)
        s2 = fsps.get_stats()

        self.age = self._interp_met(s1["age"], s2["age"])
        self.mass = self._interp_met(s1["mass"], s2["mass"])
        self.lbol = self._interp_met(s1["lbol"], s2["lbol"])
        self.sfr = self._interp_met(s1["sfr"], s2["sfr"])
        self.mdust = self._interp_met(s1["mdust"], s2["mdust"])
github dfm / python-fsps / colors.py View on Github external
def __init__(self, redshift, logz, **kwargs):
        self.redshift = redshift
        mets = fsps.logz
        mi1, mi2 = sorted(np.argsort(np.abs(mets - logz))[:2])
        self.met1, self.met2 = mets[mi1], mets[mi2]
        self.zmet = logz

        fsps.compute(mi1, **kwargs)
        self._mags_1 = fsps.get_mags(redshift=redshift)
        s1 = fsps.get_stats()

        fsps.compute(mi2, **kwargs)
        self._mags_2 = fsps.get_mags(redshift=redshift)
        s2 = fsps.get_stats()

        self.age = self._interp_met(s1["age"], s2["age"])
        self.mass = self._interp_met(s1["mass"], s2["mass"])
        self.lbol = self._interp_met(s1["lbol"], s2["lbol"])
        self.sfr = self._interp_met(s1["sfr"], s2["sfr"])
        self.mdust = self._interp_met(s1["mdust"], s2["mdust"])