Commit fbb7201e authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Limit the number of read coefficients.

parent df9110ae
......@@ -149,8 +149,10 @@ def file2splines(fname):
input_array = np.fromstring(input_string, dtype=float, sep=' ')
# get the relevant quantities from the array
l_max, _, n_spl = map(int, input_array[:3])
# read the appropriate number of knots
knots = input_array[3:n_spl+4+3]
coeffs = input_array[n_spl+4+3:]
# read the appropriate number of coefficients
coeffs = input_array[n_spl+4+3:n_spl*(lmax2N(l_max)+1)+4+3]
coeffs = coeffs.reshape(n_spl, lmax2N(l_max))
# initialize the BSpline object
c_splines = BSpline(knots, coeffs, 3)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment