Ensure dimensionality in reading/processing W-files
Former-commit-id: e7daf090afa430d87418091df2f10eaf5da943bf
This commit is contained in:
parent
a5bff23b0e
commit
044dd9bdd7
|
@ -805,9 +805,7 @@ def processWfiles_sameKs(freqfilenames, destfilename, nparticles = 2, lMax = Non
|
||||||
|
|
||||||
#Check the first file to get the "constants" set
|
#Check the first file to get the "constants" set
|
||||||
filename = freqfilenames[0]
|
filename = freqfilenames[0]
|
||||||
data = np.loadtxt(filename)
|
data = np.loadtxt(filename, ndmin = 2)
|
||||||
if len(data.shape) == 1:
|
|
||||||
data = np.reshape(data, (1,) + data.shape)
|
|
||||||
nk_muster = data.shape[0]
|
nk_muster = data.shape[0]
|
||||||
Wdata = data[...,5:]
|
Wdata = data[...,5:]
|
||||||
|
|
||||||
|
@ -835,9 +833,7 @@ def processWfiles_sameKs(freqfilenames, destfilename, nparticles = 2, lMax = Non
|
||||||
succread = 0
|
succread = 0
|
||||||
|
|
||||||
for filename in freqfilenames:
|
for filename in freqfilenames:
|
||||||
data = np.loadtxt(filename)
|
data = np.loadtxt(filename, ndmin=2)
|
||||||
if len(data.shape) == 1:
|
|
||||||
data = np.reshape(data, (1,) + data.shape)
|
|
||||||
if data.shape[0] != nk_muster:
|
if data.shape[0] != nk_muster:
|
||||||
raise ValueError("%s contains different number of lines than %s"%(filename, freqfilenames[0]))
|
raise ValueError("%s contains different number of lines than %s"%(filename, freqfilenames[0]))
|
||||||
ks_current = np.array(data[:,3:5])
|
ks_current = np.array(data[:,3:5])
|
||||||
|
|
Loading…
Reference in New Issue