
fR = [5.3289800E+00, 5.2173600E+00, 5.4527400E+00]
LX = [4.1894300E+01, 4.1796800E+01, 4.2034100E+01]
Zcut = 0
FileName = 'EDGES.h5'

from Run_21cmFAST import *
import numpy as np
import h5py

nf = len(fR)
nx = len(LX)
N = nf*nx
z, T0, Tr0 = Run_21cmFAST(fR[0],LX[0],Zcut)
nz=len(z)

T21_array = np.zeros((N,nz))
Trad_array = np.zeros((N,nz))

idx = 0
for fR_id in np.arange(0,nf,1):
    for LX_id in np.arange(0,nx,1):
        z, T21, Trad = Run_21cmFAST(fR[fR_id],LX[LX_id],Zcut)
        T21_array[idx][:]=T21[:]
        Trad_array[idx][:]=Trad[:]
        idx = idx + 1
        print('Status: ', idx/N)

f = h5py.File(FileName, "w")
f.create_dataset('z',data=z)
f.create_dataset('T21_array',data=T21_array)
f.create_dataset('Trad_array',data=Trad_array)
f.close()
