Beispiel #1
0
class TestThetaParam:
    def setup_class(self):
        self.thetaparam = ThetaParam(grid=np.array([4000., 4.32, -0.2]),
        vz=10., vsini=4.0, logOmega=-0.2, Av=0.3)

    def test_save(self):
        self.thetaparam.save(fname="theta_test.json")

    def test_load(self):
        load = ThetaParam.load("theta_test.json")
        print(load.grid)
        print(load.vz)
        print(load.vsini)
        print(load.logOmega)
        print(load.Av)
Beispiel #2
0
class TestThetaParam:
    def setup_class(self):
        self.thetaparam = ThetaParam(grid=np.array([4000., 4.32, -0.2]),
                                     vz=10.,
                                     vsini=4.0,
                                     logOmega=-0.2,
                                     Av=0.3)

    def test_save(self):
        self.thetaparam.save(fname="theta_test.json")

    def test_load(self):
        load = ThetaParam.load("theta_test.json")
        print(load.grid)
        print(load.vz)
        print(load.vsini)
        print(load.logOmega)
        print(load.Av)
Beispiel #3
0
        print(pars, "lnp:", s)

        if s == -np.inf:
            return 1e99
        else:
            return -s

    start = Starfish.config["Theta"]
    p0 = np.array(start["grid"] +
                  [start["vz"], start["vsini"], start["logOmega"]])

    from scipy.optimize import fmin
    p = fmin(fprob, p0, maxiter=10000, maxfun=10000)
    print(p)
    pars = ThetaParam(grid=p[0:3], vz=p[3], vsini=p[4], logOmega=p[5])
    pars.save()

    # Kill all of the orders
    for pconn in pconns.values():
        pconn.send(("FINISH", None))
        pconn.send(("DIE", None))

    # Join on everything and terminate
    for p in ps.values():
        p.join()
        p.terminate()

    import sys
    sys.exit()

if args.initPhi:
Beispiel #4
0
        print(pars, "lnp:", s)

        if s == -np.inf:
            return 1e99
        else:
            return -s

    start = Starfish.config["Theta"]
    p0 = np.array(start["grid"] + [start["vz"], start["vsini"], start["logOmega"]])

    from scipy.optimize import fmin
    p = fmin(fprob, p0, maxiter=10000, maxfun=10000)
    print(p)
    pars = ThetaParam(grid=p[0:3], vz=p[3], vsini=p[4], logOmega=p[5])
    pars.save()

    # Kill all of the orders
    for pconn in pconns.values():
        pconn.send(("FINISH", None))
        pconn.send(("DIE", None))

    # Join on everything and terminate
    for p in ps.values():
        p.join()
        p.terminate()

    import sys;sys.exit()

if args.initPhi:
    # Figure out how many models and orders we have