def parse_input(input, inflv, starttime, endtime):
    'Read simulations data from input file.\n\n    Arguments:\n    input -- prefix of file containing neutrino fluxes\n    inflv -- neutrino flavor to consider\n    starttime -- start time set by user via command line option (or None)\n    endtime -- end time set by user via command line option (or None)\n    '
    f = h5py.File(input, 'r')
    for (t, r) in f['sim_data']['shock_radius']:
        if (r > 1):
            tbounce = (t * 1000)
            break
    starttime = get_starttime(starttime, ((1000 * f['sim_data']['shock_radius'][0][0]) - tbounce))
    endtime = get_endtime(endtime, ((1000 * f['sim_data']['shock_radius'][(- 1)][0]) - tbounce))
    global flux
    flux = {}
    path = {'e': 'nue_data', 'eb': 'nuae_data', 'x': 'nux_data', 'xb': 'nux_data'}[inflv]
    for (i, (t, lum)) in enumerate(f[path]['lum']):
        t = ((1000 * t) - tbounce)
        if ((t < (starttime - 30)) or (t > (endtime + 30))):
            continue
        lum *= (1e+51 * 624.151)
        mean_e = f[path]['avg_energy'][i][1]
        mean_e_sq = (f[path]['rms_energy'][i][1] ** 2)
        flux[t] = (mean_e, mean_e_sq, lum)
    f.close()
    return (starttime, endtime, sorted(flux.keys()))
Read simulations data from input file.

Arguments:
input -- prefix of file containing neutrino fluxes
inflv -- neutrino flavor to consider
starttime -- start time set by user via command line option (or None)
endtime -- end time set by user via command line option (or None)
def parse_input(input, inflv, starttime, endtime):
    'Read simulations data from input file.\n\n    Arguments:\n    input -- prefix of file containing neutrino fluxes\n    inflv -- neutrino flavor to consider\n    starttime -- start time set by user via command line option (or None)\n    endtime -- end time set by user via command line option (or None)\n    '
    f = h5py.File(input, 'r')
    for (t, r) in f['sim_data']['shock_radius']:
        if (r > 1):
            tbounce = (t * 1000)
            break
    starttime = get_starttime(starttime, ((1000 * f['sim_data']['shock_radius'][0][0]) - tbounce))
    endtime = get_endtime(endtime, ((1000 * f['sim_data']['shock_radius'][(- 1)][0]) - tbounce))
    global flux
    flux = {}
    path = {'e': 'nue_data', 'eb': 'nuae_data', 'x': 'nux_data', 'xb': 'nux_data'}[inflv]
    for (i, (t, lum)) in enumerate(f[path]['lum']):
        t = ((1000 * t) - tbounce)
        if ((t < (starttime - 30)) or (t > (endtime + 30))):
            continue
        lum *= (1e+51 * 624.151)
        mean_e = f[path]['avg_energy'][i][1]
        mean_e_sq = (f[path]['rms_energy'][i][1] ** 2)
        flux[t] = (mean_e, mean_e_sq, lum)
    f.close()
    return (starttime, endtime, sorted(flux.keys()))