check that files exist powerspectrum

This commit is contained in:
Mayeul Aubin 2025-05-21 10:56:20 +02:00
parent dbc3c408a3
commit 4fa6ccc842

View file

@ -1,4 +1,5 @@
import numpy as np
import os
kmin = 1e-1
kmax = 2e0
@ -287,6 +288,10 @@ if __name__ == "__main__":
print('You must choose between power_spectrum and cross_correlation.')
exit()
for _k,f in enumerate(args.filenames):
if not os.path.exists(args.directory+f):
raise FileNotFoundError(f"File {args.directory+f} does not exist.")
if args.reference is not None:
from pysbmy.field import read_field
F_ref = read_field(args.directory+args.reference)