blimpy/file_wrapper.py
def _setup_chans(self):
        """Setup channel borders
        """

        if self.header[b'foff'] < 0:
            f0 = self.f_end
        else:
            f0 = self.f_begin

        i_start, i_stop = 0, self.n_channels_in_file
        if self.f_start:
            i_start = np.round((self.f_start - f0) / self.header[b'foff'])
        if self.f_stop:
            i_stop  = np.round((self.f_stop - f0)  / self.header[b'foff'])

        #calculate closest true index value
        chan_start_idx = np.int(i_start)
        chan_stop_idx  = np.int(i_stop)

        if chan_stop_idx < chan_start_idx:
            chan_stop_idx, chan_start_idx = chan_start_idx,chan_stop_idx

        self.chan_start_idx =  chan_start_idx
        self.chan_stop_idx = chan_stop_idx
def _setup_chans(self):
        if self.header[b'foff'] < 0:
            f0 = self.f_end
        else:
            f0 = self.f_begin

        i_start, i_stop = 0, self.n_channels_in_file
        if self.f_start:
            i_start = np.round((self.f_start - f0) / self.header[b'foff'])
        if self.f_stop:
            i_stop  = np.round((self.f_stop - f0)  / self.header[b'foff'])

        #calculate closest true index value
        chan_start_idx = np.int(i_start)
        chan_stop_idx  = np.int(i_stop)

        if chan_stop_idx < chan_start_idx:
            chan_stop_idx, chan_start_idx = chan_start_idx,chan_stop_idx

        self.chan_start_idx =  chan_start_idx
        self.chan_stop_idx = chan_stop_idx
def _setup_chans ( self ) : if self . header [ b'foff' ] < 0 : f0 = self . f_end else : f0 = self . f_begin i_start , i_stop = 0 , self . n_channels_in_file if self . f_start : i_start = np . round ( ( self . f_start - f0 ) / self . header [ b'foff' ] ) if self . f_stop : i_stop = np . round ( ( self . f_stop - f0 ) / self . header [ b'foff' ] ) #calculate closest true index value chan_start_idx = np . int ( i_start ) chan_stop_idx = np . int ( i_stop ) if chan_stop_idx < chan_start_idx : chan_stop_idx , chan_start_idx = chan_start_idx , chan_stop_idx self . chan_start_idx = chan_start_idx self . chan_stop_idx = chan_stop_idx
Setup channel borders
Setup channel borders