6 def validfile(filename):
7 f = h5py.File(filename)
8 if (list(f.attrs.keys()).count(
"target.Lambda")):
9 Lambda = f.attrs[
"target.Lambda"][0]
12 nactus = f[
"noise"][:].shape[0]
13 niter = f[
"noise"][:].shape[1]
16 data = np.zeros((nmodes, niter))
18 "noise",
"aliasing",
"tomography",
"filtered modes",
"bandwidth",
23 data += np.dot(P, f[i][:])
25 data = np.var(data, axis=1)
27 data = np.exp(-data * (2 * np.pi / Lambda)**2)
28 data *= np.exp(-f[
"fitting"].value)
33 if (np.abs(data - SR) < 0.05
or np.abs(data - SR2) < 0.05):
34 f.attrs[
"validity"] =
True