# Path: blimpy/io/sigproc.py
# def len_header(filename):
# def read_next_header_keyword(fh):
# def is_filterbank(filename):
# def read_header(filename, return_idxs=False):
# def fix_header(filename, keyword, new_value):
# def fil_double_to_angle(angle):
# def to_sigproc_keyword(keyword, value=None):
# def generate_sigproc_header(f):
# def to_sigproc_angle(angle_val):
# def calc_n_ints_in_file(filename):
#     GULP = 4096
# 
# Path: blimpy/io/base_reader.py
# GIGA = 1024 ** 3
# HIRES_THRESHOLD = 2**20
# class Reader(object):
#     def __init__(self):
#     def _setup_selection_range(self, f_start=None, f_stop=None, t_start=None, t_stop=None, init=False):
#         def _dump_parms():
#     def _init_empty_selection(self):
#     def _setup_dtype(self):
#     def _calc_selection_size(self):
#     def _calc_selection_shape(self):
#     def _setup_chans(self):
#     def _setup_freqs(self):
#     def populate_timestamps(self,update_header=False):
#     def populate_freqs(self):
#     def adjust_n_coarse_chan(self, n_coarse_chan, nchans):
#     def calc_n_coarse_chan(self, chan_bw=None):
#     def calc_n_blobs(self, blob_dim):
#     def warn_memory(self, name, size):
#     def isheavy(self):


import os
import numpy as np
from blimpy.io import sigproc
from blimpy.io.base_reader import Reader, logger, GIGA
            #Applying data size limit to load.
            if max_load is not None and max_load > 0:
                self.max_data_array_size = max_load * GIGA

            if self.file_size_bytes > self.max_data_array_size:
                self.large_file = True
            else:
                self.large_file = False

            if self.load_data:
                if self.large_file:
                    if self.f_start or self.f_stop or self.t_start or self.t_stop:
                        if self.isheavy():
                            self.warn_memory("Selection", self._calc_selection_size())
                            self._init_empty_selection()
                        else:
                            self.read_data()
                    else:
                        self.warn_memory("File", self.file_size_bytes)
                        self._init_empty_selection()
                else:
                    self.read_data()
            else:
                logger.debug("Skipping loading data ...")
                self._init_empty_selection()
        else:
            raise IOError("Need a file to open, please give me one!")

    def _setup_n_ints_in_file(self):
        """ Calculate the number of integrations in the file. """

# Path: blimpy/io/sigproc.py
# def len_header(filename):
# def read_next_header_keyword(fh):
# def is_filterbank(filename):
# def read_header(filename, return_idxs=False):
# def fix_header(filename, keyword, new_value):
# def fil_double_to_angle(angle):
# def to_sigproc_keyword(keyword, value=None):
# def generate_sigproc_header(f):
# def to_sigproc_angle(angle_val):
# def calc_n_ints_in_file(filename):
#     GULP = 4096
# 
# Path: blimpy/io/base_reader.py
# GIGA = 1024 ** 3
# HIRES_THRESHOLD = 2**20
# class Reader(object):
#     def __init__(self):
#     def _setup_selection_range(self, f_start=None, f_stop=None, t_start=None, t_stop=None, init=False):
#         def _dump_parms():
#     def _init_empty_selection(self):
#     def _setup_dtype(self):
#     def _calc_selection_size(self):
#     def _calc_selection_shape(self):
#     def _setup_chans(self):
#     def _setup_freqs(self):
#     def populate_timestamps(self,update_header=False):
#     def populate_freqs(self):
#     def adjust_n_coarse_chan(self, n_coarse_chan, nchans):
#     def calc_n_coarse_chan(self, chan_bw=None):
#     def calc_n_blobs(self, blob_dim):
#     def warn_memory(self, name, size):
#     def isheavy(self):


# Path: blimpy/io/fil_reader.py
import os
import numpy as np
from blimpy.io import sigproc
from blimpy.io.base_reader import Reader, logger, GIGA

            #Applying data size limit to load.
            if max_load is not None and max_load > 0:
                self.max_data_array_size = max_load * GIGA

            if self.file_size_bytes > self.max_data_array_size:
                self.large_file = True
            else:
                self.large_file = False

            if self.load_data:
                if self.large_file:
                    if self.f_start or self.f_stop or self.t_start or self.t_stop:
                        if self.isheavy():
                            self.warn_memory("Selection", self._calc_selection_size())
                            self._init_empty_selection()
                        else:
                            self.read_data()
                    else:
                        self.warn_memory("File", self.file_size_bytes)
                        self._init_empty_selection()
                else:
                    self.read_data()
            else:
                logger.debug("Skipping loading data ...")
                self._init_empty_selection()
        else:
            raise IOError("Need a file to open, please give me one!")

    def _setup_n_ints_in_file(self):
        """ Calculate the number of integrations in the file. """

        self.n_ints_in_file = sigproc.calc_n_ints_in_file(self.filename)