示例#1
0
    def test_surf(self, datadir):
        fname = datadir("REFL_CAN.txt")
        w, resv, hdr, sdr, bhr, dhr = loadtxt(fname, unpack=True)
        kt = atleast_1d(0)

        lsm = LSM(reflectance=1, moisture=1)
        prospect = PROSPECT(N=1.5,
                            Cab=40,
                            Cxc=8.,
                            Cbr=0.0,
                            Cw=0.01,
                            Cm=0.009,
                            version="5")
        with pytest.raises(AssertionError):
            sail = SAIL(iza=30,
                        vza=10,
                        raa=0,
                        ks=prospect.ks,
                        kt=prospect.kt,
                        lai=3,
                        hotspot=0.01,
                        rho_surface=kt,
                        a=-0.35,
                        b=-0.15,
                        lidf_type='verhoef')
示例#2
0
    def test_dhr_prosail5(self, datadir):
        fname = datadir("REFL_CAN.txt")
        w, resv, hdr, sdr, bhr, dhr = loadtxt(fname, unpack=True)

        lsm = LSM(reflectance=1, moisture=1)
        prospect = PROSPECT(N=1.5,
                            Cab=40,
                            Cxc=8.,
                            Cbr=0.0,
                            Cw=0.01,
                            Cm=0.009,
                            version="5")
        sail = SAIL(iza=30,
                    vza=10,
                    raa=0,
                    ks=prospect.ks,
                    kt=prospect.kt,
                    lai=3,
                    hotspot=0.01,
                    rho_surface=lsm.ref,
                    a=-0.35,
                    b=-0.15,
                    lidf_type='verhoef')

        assert allclose(dhr, sail.DHR.ref, atol=0.01)
    def test_transmittance_prospectd(self, datadir):
        fname = datadir("prospect_d_test.mat")
        trans_mtlab = loadmat(fname)['LRT'][:, 2]

        prospect = PROSPECT(N=1.2, Cab=30, Cxc=10., Cbr=0.0, Cw=0.015, Cm=0.009, Can=1, version="D")
        w, refl, trans = prospect.l, prospect.ks, prospect.kt

        assert allclose(trans_mtlab, trans, atol=1.e-4)
    def test_transmittance_prospect5(self, datadir):
        # runs prospect and compares to online prospect run
        fname = datadir("prospect5_spectrum.txt")
        w, true_refl, true_trans = loadtxt(fname, unpack=True)

        prospect = PROSPECT(N=2.1, Cab=40, Cxc=10., Cbr=0.1, Cw=0.015, Cm=0.009, version="5")
        w, refl, trans = prospect.l, prospect.ks, prospect.kt

        assert allclose(true_trans, trans, atol=1e-4)
示例#5
0
 def test_raise_exception_version(self):
     with pytest.raises(ValueError):
         PROSPECT(N=2.1,
                  Cab=40,
                  Cxc=10.,
                  Cbr=0.1,
                  Cw=0.015,
                  Cm=0.009,
                  Can=1,
                  version="d")