示例#1
0
    def prepOutfile(self,
                    filename,
                    updates=None,
                    nbits=None,
                    back_compatible=True):
        """Prepare a file to have sigproc format data written to it.

        Parameters
        ----------
        filename : str
            name of new file
        updates : dict, optional
            values to overide existing header values, by default None
        nbits : int, optional
            the bitsize of data points that will written to this file (1,2,4,8,32),
            by default None
        back_compatible : bool, optional
            flag for making file Sigproc compatible, by default True

        Returns
        -------
        :class:`~sigpyproc.Utils.File`
            a prepared file
        """
        self.updateHeader()
        if nbits is None:
            nbits = self.nbits
        out_file = File(filename, "w+", nbits)
        new = self.newHeader(updates)
        new["nbits"] = nbits
        out_file.write(new.SPPHeader(back_compatible=back_compatible))
        return out_file
示例#2
0
    def prepOutfile(self,filename,updates=None,nbits=None,back_compatible=True):
        """Prepare a file to have sigproc format data written to it.

        :param filename: filename of new file
        :type filename: string
        
        :param updates: values to overide existing header values
        :type updates: dict
        
        :param nbits: the bitsize of data points that will written to this file (1,2,4,8,32)
        :type nbits: int
        
        :param back_compatible: flag for making file Sigproc compatible
        :type back_compatible: bool
        
        :returns: a prepared file
        :rtype: :class:`~sigpyproc.Utils.File`        
        """
        self.updateHeader()
        if nbits is None: nbits = self.nbits
        out_file = File(filename,"w+",nbits)
        new = self.newHeader(updates)
        new["nbits"] = nbits
        out_file.write(new.SPPHeader(back_compatible=back_compatible))
        return out_file
示例#3
0
    def prepOutfile(self,filename,updates=None,nbits=None,back_compatible=True):
        """Prepare a file to have sigproc format data written to it.

        :param filename: filename of new file
        :type filename: string
        
        :param updates: values to overide existing header values
        :type updates: dict
        
        :param nbits: the bitsize of data points that will written to this file (1,2,4,8,32)
        :type nbits: int
        
        :param back_compatible: flag for making file Sigproc compatible
        :type back_compatible: bool
        
        :returns: a prepared file
        :rtype: :class:`~sigpyproc.Utils.File`        
        """
        self.updateHeader()
        if nbits is None: nbits = self.nbits
        out_file = File(filename,"w+",nbits)
        new = self.newHeader(updates)
        new["nbits"] = nbits
        out_file.write(new.SPPHeader(back_compatible=back_compatible))
        return out_file