ndio/remote/data.py
def post_cutout(self, token, channel,
                    x_start,
                    y_start,
                    z_start,
                    data,
                    resolution=0):
        """
        Post a cutout to the server.

        Arguments:
            token (str)
            channel (str)
            x_start (int)
            y_start (int)
            z_start (int)
            data (numpy.ndarray): A numpy array of data. Pass in (x, y, z)
            resolution (int : 0): Resolution at which to insert the data

        Returns:
            bool: True on success

        Raises:
            RemoteDataUploadError: if there's an issue during upload.
        """
        datatype = self.get_proj_info(token)['channels'][channel]['datatype']
        if data.dtype.name != datatype:
            data = data.astype(datatype)

        data = numpy.rollaxis(data, 1)
        data = numpy.rollaxis(data, 2)

        if six.PY3 or data.nbytes > 1.5e9:
            ul_func = self._post_cutout_no_chunking_npz
        else:
            ul_func = self._post_cutout_no_chunking_blosc

        if data.size < self._chunk_threshold:
            return ul_func(token, channel, x_start,
                           y_start, z_start, data,
                           resolution)

        return self._post_cutout_with_chunking(token, channel,
                                               x_start, y_start, z_start, data,
                                               resolution, ul_func)
def post_cutout(self, token, channel,
                    x_start,
                    y_start,
                    z_start,
                    data,
                    resolution=0):
        """
        Post a cutout to the server.

        Arguments:
            token (str)
            channel (str)
            x_start (int)
            y_start (int)
            z_start (int)
            data (numpy.ndarray): A numpy array of data. Pass in (x, y, z)
            resolution (int : 0): Resolution at which to insert the data

        Returns:
            bool: True on success

        Raises:
            RemoteDataUploadError: if there's an issue during upload.
        """
        datatype = self.get_proj_info(token)['channels'][channel]['datatype']
        if data.dtype.name != datatype:
            data = data.astype(datatype)

        data = numpy.rollaxis(data, 1)
        data = numpy.rollaxis(data, 2)

        if six.PY3 or data.nbytes > 1.5e9:
            ul_func = self._post_cutout_no_chunking_npz
        else:
            ul_func = self._post_cutout_no_chunking_blosc

        if data.size < self._chunk_threshold:
            return ul_func(token, channel, x_start,
                           y_start, z_start, data,
                           resolution)

        return self._post_cutout_with_chunking(token, channel,
                                               x_start, y_start, z_start, data,
                                               resolution, ul_func)
def post_cutout ( self , token , channel , x_start , y_start , z_start , data , resolution = 0 ) : datatype = self . get_proj_info ( token ) [ 'channels' ] [ channel ] [ 'datatype' ] if data . dtype . name != datatype : data = data . astype ( datatype ) data = numpy . rollaxis ( data , 1 ) data = numpy . rollaxis ( data , 2 ) if six . PY3 or data . nbytes > 1.5e9 : ul_func = self . _post_cutout_no_chunking_npz else : ul_func = self . _post_cutout_no_chunking_blosc if data . size < self . _chunk_threshold : return ul_func ( token , channel , x_start , y_start , z_start , data , resolution ) return self . _post_cutout_with_chunking ( token , channel , x_start , y_start , z_start , data , resolution , ul_func )
Post a cutout to the server.

        Arguments:
            token (str)
            channel (str)
            x_start (int)
            y_start (int)
            z_start (int)
            data (numpy.ndarray): A numpy array of data. Pass in (x, y, z)
            resolution (int : 0): Resolution at which to insert the data

        Returns:
            bool: True on success

        Raises:
            RemoteDataUploadError: if there's an issue during upload.
Post a cutout to the server .