Ejemplo n.º 1
0
    def test_flat(self):
        domain = Orange.data.Domain([
            Orange.data.ContinuousVariable(str(w))
            for w in [6800., 6940., 7060., 7400., 7800., 8000.]
        ])
        data = Table.from_numpy(domain, [[0.2, 0.2, 0.8, 0.8, 0.8, 0.8]])

        f = XASnormalization(edge=7000.,
                             preedge_dict={
                                 'from': 6800.,
                                 'to': 6950.,
                                 'deg': 1
                             },
                             postedge_dict={
                                 'from': 7050.,
                                 'to': 8000.,
                                 'deg': 2
                             })

        fdata = f(data)

        numpy.testing.assert_almost_equal(fdata.X, [[0., 0., 1., 1., 1., 1.]])
        numpy.testing.assert_almost_equal(fdata.metas, [[0.6]])
    Normalize(method=Normalize.Vector),
    Normalize(method=Normalize.Area,
              int_method=Integrate.PeakMax,
              lower=0,
              upper=10000),
    Normalize(method=Normalize.MinMax),
    CurveShift(1),
    Despike(threshold=5, cutoff=60, dis=5),
]

xas_norm_collagen = XASnormalization(edge=1630,
                                     preedge_dict={
                                         'from': 1000,
                                         'to': 1300,
                                         'deg': 1
                                     },
                                     postedge_dict={
                                         'from': 1650,
                                         'to': 1700,
                                         'deg': 1
                                     })
extract_exafs = ExtractEXAFS(edge=1630,
                             extra_from=1630,
                             extra_to=1800,
                             poly_deg=1,
                             kweight=0,
                             m=0)


class ExtractEXAFSUsage(PreprocessorList):
    """ExtractEXAFS needs previous XAS normalization"""