pydevices/HtsDevices/acq400_hapi/acq400.py
def read(self, ndata, data_size=2, maxbuf=0x400000):
        """read ndata from channel data server, return as np array.
        Args:
            ndata (int): number of elements

            data_size : 2|4 short or int

            maxbuf=4096 : max bytes to read per packet

        Returns:
            np: data array

        * TODO buffer +=

         this is probably horribly inefficient probably better::

          retbuf = np.array(dtype, ndata)
          retbuf[cursor].

        """
        _dtype = np.dtype('i4' if data_size == 4 else 'i2')
        total_buffer = buffer = self.sock.recv(maxbuf)

        if int(ndata) == 0 or int(ndata) == -1:
            while True:
                buffer = self.sock.recv(maxbuf)
                if not buffer:
                    return np.frombuffer(total_buffer, dtype=_dtype, count=-1)
                total_buffer += buffer

        while len(buffer) < ndata*data_size:
            buffer += self.sock.recv(maxbuf)

        return np.frombuffer(buffer, dtype=_dtype, count=ndata)
read ndata from channel data server, return as np array.
        Args:
            ndata (int): number of elements

            data_size : 2|4 short or int

            maxbuf=4096 : max bytes to read per packet

        Returns:
            np: data array

        * TODO buffer +=

         this is probably horribly inefficient probably better::

          retbuf = np.array(dtype, ndata)
          retbuf[cursor].

        
read ndata from channel data server, return as np array.
read ndata from channel data server return as np array .
def read(self, ndata, data_size=2, maxbuf=0x400000):
        _dtype = np.dtype('i4' if data_size == 4 else 'i2')
        total_buffer = buffer = self.sock.recv(maxbuf)
        if int(ndata) == 0 or int(ndata) == -1:
            while True:
                buffer = self.sock.recv(maxbuf)
                if not buffer:
                    return np.frombuffer(total_buffer, dtype=_dtype, count=-1)
                total_buffer += buffer
        while len(buffer) < ndata*data_size:
            buffer += self.sock.recv(maxbuf)
        return np.frombuffer(buffer, dtype=_dtype, count=ndata)
def read ( self , ndata , data_size = 2 , maxbuf = 0x400000 ) : _dtype = np . dtype ( 'i4' if data_size == 4 else 'i2' ) total_buffer = buffer = self . sock . recv ( maxbuf ) if int ( ndata ) == 0 or int ( ndata ) == - 1 : while True : buffer = self . sock . recv ( maxbuf ) if not buffer : return np . frombuffer ( total_buffer , dtype = _dtype , count = - 1 ) total_buffer += buffer while len ( buffer ) < ndata * data_size : buffer += self . sock . recv ( maxbuf ) return np . frombuffer ( buffer , dtype = _dtype , count = ndata )
read ndata from channel data server, return as np array.
read ndata from channel data server return as np array .
"""read ndata from channel data server, return as np array.
        Args:
            ndata (int): number of elements

            data_size : 2|4 short or int

            maxbuf=4096 : max bytes to read per packet

        Returns:
            np: data array

        * TODO buffer +=

         this is probably horribly inefficient probably better::

          retbuf = np.array(dtype, ndata)
          retbuf[cursor].

        """
None
np
self
ndata
number of elements
number of elements
data_size
maxbuf
data_size 
2|4 short or int
2|4 short or int
maxbuf=4096 
max bytes to read per packet
max bytes to read per packet