예제 #1
0
def test_AlphaModelholo_likelihood():
    holo = get_example_data('image0001')
    s = Sphere(
        prior.Gaussian(.5, .1), prior.Gaussian(1.6, .1),
        (prior.Gaussian(5, 1), prior.Gaussian(5, 1), prior.Gaussian(5, 1)))
    model = AlphaModel(s, alpha=prior.Gaussian(.7, .1), noise_sd=.01)
    assert_pickle_roundtrip(model)
예제 #2
0
def test_emcee():
    holo = get_example_data('image0001.yaml')
    s = Sphere(
        prior.Gaussian(.5, .1), prior.Gaussian(1.6, .1),
        (prior.Gaussian(5, 1), prior.Gaussian(5, 1), prior.Gaussian(5, 1)))
    model = AlphaModel(s, Mie, alpha=prior.Gaussian(.7, .1), noise_sd=.01)
    emcee = Emcee(model, holo)
    assert_pickle_roundtrip(emcee)
예제 #3
0
def test_PerfectLensModelholo_likelihood():
    holo = get_example_data('image0001')
    sphere_center = (prior.Gaussian(5, 1), prior.Gaussian(5, 1),
                     prior.Gaussian(5, 1))
    s = Sphere(n=prior.Gaussian(1.6, .1),
               r=prior.Gaussian(.5, .1),
               center=sphere_center)
    model = PerfectLensModel(s, noise_sd=0.01, lens_angle=0.8)
    assert_pickle_roundtrip(model)
예제 #4
0
def test_ExactModelholo_likelihood():
    holo = get_example_data('image0001')
    sphere_center = (prior.Gaussian(5, 1), prior.Gaussian(5, 1),
                     prior.Gaussian(5, 1))
    s = Sphere(n=prior.Gaussian(1.6, .1),
               r=prior.Gaussian(.5, .1),
               center=sphere_center)
    model = ExactModel(s, noise_sd=.01)
    assert_pickle_roundtrip(model)
예제 #5
0
def test_TimeSeriesAlphaModel():
    n = TimeIndependent(prior.Gaussian(5, .5))
    assert_pickle_roundtrip(n)
    st = Sphere(n=n,
                r=TimeIndependent(prior.BoundedGaussian(1.6, .1, 0, np.inf)),
                center=(prior.Gaussian(10, 1), prior.Gaussian(10, 1),
                        prior.BoundedGaussian(1.6, .1, 0, np.inf)))
    assert_pickle_roundtrip(st)
    noise_sd = .1
    mt = TimeSeriesAlphaModel(st,
                              Mie,
                              noise_sd,
                              alpha=prior.Uniform(0, 1),
                              n_frames=2)
    assert_pickle_roundtrip(mt)
예제 #6
0
def test_image():
    holo = get_example_data('image0001')
    assert_pickle_roundtrip(holo)
예제 #7
0
def test_AlphaModelholo_likelihood():
    holo = get_example_data('image0001')
    s = Sphere(prior.Gaussian(.5, .1), prior.Gaussian(1.6, .1),
               (prior.Gaussian(5, 1), prior.Gaussian(5, 1), prior.Gaussian(5, 1)))
    model = AlphaModel(s, alpha = prior.Gaussian(.7, .1), noise_sd=.01)
    assert_pickle_roundtrip(model)
예제 #8
0
def test_prior():
    g = prior.Gaussian(1, 1)
    assert_pickle_roundtrip(g)
    assert_pickle_roundtrip(g.lnprob)
예제 #9
0
def test_pickle_mie_object():
    m = Mie()
    assert_pickle_roundtrip(m)
    assert_pickle_roundtrip(m.calc_holo, True)
예제 #10
0
def test_pickle_calc_holo():
    assert_pickle_roundtrip(Mie.calc_holo)
예제 #11
0
def test_prior():
    g = prior.Gaussian(1, 1)
    assert_pickle_roundtrip(g)
    assert_pickle_roundtrip(g.lnprob)
예제 #12
0
def test_pickle_mie_object():
    m = Mie()
    assert_pickle_roundtrip(m)
예제 #13
0
def test_pickle_calc_holo():
    assert_pickle_roundtrip(Mie.calc_holo)
예제 #14
0
def test_pickle_mie_object():
    m = Mie()
    assert_pickle_roundtrip(m)
    assert_pickle_roundtrip(m.calc_holo, True)
예제 #15
0
def test_pickle_mie_object():
    m = Mie()
    assert_pickle_roundtrip(m)
예제 #16
0
def test_image():
    holo = get_example_data('image0001.yaml')
    assert_pickle_roundtrip(holo)