Exemplo n.º 1
0
 def readData(self):
     if (not self._cschema.dtype().is_number()):
         print("Not a dataset, return ")
         return None
     if self._dataSet is None:
         self._dataSet = scirados.RadosDataSet(self._name, self._pool_name)
     return self._dataSet.readData()
Exemplo n.º 2
0
 def writeBox(self, data, slicex, slicey=None):
     if (not self._cschema.dtype().is_number()):
         print("Not a dataset, return ")
         return None
     if self._dataSet is None:
         self._dataSet = scirados.RadosDataSet(self._name, self._pool_name)
     if slicey is None:
         data = self._dataSet.writeBox(data, xslice=slicex)
     else:
         data = self._dataSet.writeBox(data, xslice=slicex, yslice=slicey)
     return data
Exemplo n.º 3
0
 def writeData(self, data):
     new = self._cschema.dtype()
     new.set(data.dtype.name, data.size, 0, data.dtype.itemsize,
             data.dtype.itemsize)
     self._parent._cschema[
         self.
         _basename] = new  #self._cschema.dtset(conduit.Schema(str(new)))
     if self._dataSet is None:
         self._dataSet = scirados.RadosDataSet(self._name, self._pool_name)
     self._dataSet.writeData(data)
     self.modified = False
     self._root.modified = True
Exemplo n.º 4
0
    def delete(self):

        if self._radosSchema is not None:
            self._cschema = conduit.Schema(self._radosSchema.getSchema())

        print(self)
        if self._cschema.dtype().is_number():
            if self._dataSet is None:
                self._dataSet = scirados.RadosDataSet(self._name,
                                                      self._pool_name)
            self._dataSet.remove()
        else:
            for k in self.keys():
                self[str(k)].delete()
            if self._radosSchema is not None:
                self._radosSchema.remove()
Exemplo n.º 5
0
import scirados
import numpy as np
print(dir(scirados))
test = scirados.RadosDataSet("TestDataSet", "image_cache")

test2d = scirados.RadosDataSet("TestDataSet2D", "image_cache")

data = np.array([123.42, 42, 42, 3, 534.5344, 432], dtype=np.float64)
data2d = np.array(
    [[123.42, 42, 42, 3, 534.5344, 432], [1.2342, 4.322, 4.2, 3, 32.422, 23]],
    dtype=np.float64)
data2 = np.array([32.3, 3.2], dtype=np.float64)
data22d = np.array([[0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]],
                   dtype=np.float64)

#print(data.dtype)
test.writeData(data)

test2d.writeData(data2d)

#test.writeBox(data2, xstart=2)
print(data22d[1:3, 0:2])
test2d.writeBox(data22d[1:3, 0:2], xstart=2, ystart=0)
#test.writeData("test", data2)
#print("here\n")
test_data = test.readData()
#print(test_data)
print(test2d.readData())
#test_data2 = test.readData("test2")
print(test2d.readBox(xslice=slice(0, 2), ystart=1))
print(test2d.getDims())