def calc_n_ints_in_file(filename):
<EOL>h = read_header(filename)<EOL>n_bytes  = int(h[b'<STR_LIT>'] / <NUM_LIT:8>)<EOL>n_chans = h[b'<STR_LIT>']<EOL>n_ifs   = h[b'<STR_LIT>']<EOL>idx_data = len_header(filename)<EOL>f = open(filename, '<STR_LIT:rb>')<EOL>f.seek(idx_data)<EOL>filesize = os.path.getsize(filename)<EOL>n_bytes_data = filesize - idx_data<EOL>if h[b'<STR_LIT>'] == <NUM_LIT:2>:<EOL><INDENT>n_ints = int(<NUM_LIT:4> * n_bytes_data / (n_chans * n_ifs))<EOL><DEDENT>else:<EOL><INDENT>n_ints = int(n_bytes_data / (n_bytes * n_chans * n_ifs))<EOL><DEDENT>return n_ints<EOL>
Calculate number of integrations in a given file