<commit_before>import numpy as np
from matplotlib import pyplot as plt

import kid_readout.analysis.demodulate_rtl
reload(kid_readout.analysis.demodulate_rtl)
import kid_readout.analysis.fit_pulses
import kid_readout.analysis.fitter
import copy
import scipy.signal
from kid_readout.utils.fftfilt import fftfilt
import pandas as pd
try:
    import kid_readout.utils.starcryo_temps
    import kid_readout.utils.hpd_temps
except ImportError:
    print "no temperatures available"
import kid_readout.analysis.resources.experiments

def process_time_constant_rtl_file(filename,pulse_period=None,debug=False,filter_cutoff=200e3,fine_fold=False,
                                   cryostat=None):
    result = {}
    tau,fit,t,folded = get_time_constant_from_file(filename,pulse_period=pulse_period, debug=debug,filter_cutoff=filter_cutoff,
                                                   fine_fold=fine_fold)
    d = np.load(filename)
    for k in d.keys():
        if k not in ['data']:
            if len(d[k].shape) == 0:
                result[k] = [d[k][()]] # unpack zero length arrays
            else:
                result[k] = [d[k]]
    d.close()
    for k,v in fit.result.params.items():<commit_msg>fix small bug<commit_after>import numpy as np
from matplotlib import pyplot as plt

import kid_readout.analysis.demodulate_rtl
reload(kid_readout.analysis.demodulate_rtl)
import kid_readout.analysis.fit_pulses
import kid_readout.analysis.fitter
import copy
import scipy.signal
from kid_readout.utils.fftfilt import fftfilt
import pandas as pd
import kid_readout.utils.starcryo_temps
try:
    import kid_readout.utils.hpd_temps
except ImportError:
    print "no temperatures available"
import kid_readout.analysis.resources.experiments

def process_time_constant_rtl_file(filename,pulse_period=None,debug=False,filter_cutoff=200e3,fine_fold=False,
                                   cryostat=None):
    result = {}
    tau,fit,t,folded = get_time_constant_from_file(filename,pulse_period=pulse_period, debug=debug,filter_cutoff=filter_cutoff,
                                                   fine_fold=fine_fold)
    d = np.load(filename)
    for k in d.keys():
        if k not in ['data']:
            if len(d[k].shape) == 0:
                result[k] = [d[k][()]] # unpack zero length arrays
            else:
                result[k] = [d[k]]
    d.close()
    for k,v in fit.result.params.items():
{'fraction_non_alphanumeric': 0.08947804473902236, 'fraction_numerical': 0.004142502071251036, 'mean_word_length': 3.0588235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2758568', 'n_tokens_mistral': 794, 'n_tokens_neox': 755, 'n_words': 157}