Beispiel #1
0
 def test_02_FixedBinAxis_2D(self):
     data = ba.IntensityData()
     data.addAxis(ba.FixedBinAxis("axis0", 9, -1.00000001, 1.0))
     data.addAxis(ba.FixedBinAxis("axis1", 3, -4.0, 5.0))
     fill_data(data)
     ba.IntensityDataIOFactory.writeOutputData(data, "tmp.int")
     newdata = ba.IntensityDataIOFactory.readOutputData("tmp.int")
     self.assertTrue(is_the_same_data(data, newdata))
Beispiel #2
0
    def test_SaveToTiff(self):
        data = ba.IntensityData()
        data.addAxis(ba.FixedBinAxis("x", 10, 0.0, 10.0))
        data.addAxis(ba.FixedBinAxis("y", 5, 0.0, 5.0))
        fill_data(data)

        ba.IntensityDataIOFactory.writeOutputData(data, "tmp.tif")
        newdata = ba.IntensityDataIOFactory.readOutputData("tmp.tif")
        self.assertTrue(is_the_same_data(data, newdata))

        ba.IntensityDataIOFactory.writeOutputData(data, "tmp.tif.gz")
        newdata = ba.IntensityDataIOFactory.readOutputData("tmp.tif.gz")
        self.assertTrue(is_the_same_data(data, newdata))

        ba.IntensityDataIOFactory.writeOutputData(data, "tmp.tif.bz2")
        newdata = ba.IntensityDataIOFactory.readOutputData("tmp.tif.bz2")
        self.assertTrue(is_the_same_data(data, newdata))
Beispiel #3
0
 def test_create_1d_object(self):
     axis0 = ba.FixedBinAxis("angle", 20, 0.0, 20.)
     self.assertEqual(20, axis0.size())
     self.assertEqual(0.0, axis0.getMin())
     self.assertEqual(20.0, axis0.getMax())
     data = ba.IntensityData()
     data.addAxis(axis0)
     self.assertEqual(20, data.getAllocatedSize())
     self.assertEqual(1, data.getRank())
     self.assertEqual(0, data.totalSum())
Beispiel #4
0
 def test_06_VariableAndFixedMix(self):
     data = ba.IntensityData()
     data.addAxis(ba.FixedBinAxis("axis0", 10, -5.0, 5.0))
     data.addAxis(
         ba.VariableBinAxis("axis1", 3,
                            get_boundaries_flat_in_sin(3, 0.0, 2.0)))
     fill_data(data)
     ba.IntensityDataIOFactory.writeOutputData(data, "tmp.int")
     newdata = ba.IntensityDataIOFactory.readOutputData("tmp.int")
     self.assertTrue(is_the_same_data(data, newdata))