Beispiel #1
0
def test_round_trip_dataset():
    data = sc.Variable(['tof'], values=[10., 10.], unit=sc.units.counts)
    tof = sc.Variable(['tof'], values=[1., 2., 3.], unit=sc.units.us)

    d = sc.Dataset({'data': data}, coords={'tof': tof})

    dd = sc.density_to_counts(sc.counts_to_density(d, 'tof'), 'tof')
    assert sc.is_equal(dd, d)
Beispiel #2
0
def test_round_trip_dataset():
    data = sc.Variable([Dim.Tof], values=[10., 10.], unit=sc.units.counts)
    tof = sc.Variable([Dim.Tof], values=[1., 2., 3.], unit=sc.units.us)

    d = sc.Dataset({'data': data}, coords={Dim.Tof: tof})

    dd = sc.density_to_counts(sc.counts_to_density(d, Dim.Tof), Dim.Tof)
    assert dd == d
Beispiel #3
0
def test_round_trip_dataarray():
    data = sc.Variable(['tof'], values=[10., 10.], unit=sc.units.counts)
    tof = sc.Variable(['tof'], values=[1., 2., 3.], unit=sc.units.us)

    d = sc.DataArray(data, coords={'tof': tof})

    dd = sc.density_to_counts(sc.counts_to_density(d, 'tof'), 'tof')
    assert dd == d