def para_init(sigma,deltax,deltay,dx,dy,m,n,Nod_num,N,ki_mean): L1=generateL(sigma,deltax,deltay,dx,dy,m,n) ran=np.random.standard_normal((Nod_num,N)) ##如果是产生真实参数场的话,那么这里的N就是1 lnpara=np.dot(L1,ran) mean=np.log(ki_mean) lnpara=lnpara+mean np.savetxt('para_initial.txt',lnpara) return lnpara
def generate_para_true(sigma,deltax,deltay,dx,dy,m,n,ki_mean,root_directory): L1=generateL(sigma,deltax,deltay,dx,dy,m,n) ran=np.random.normal(0,1,size=Nod_num) ran=ran.reshape(Nod_num,1) lnpara=np.dot(L1,ran) mean=np.log(ki_mean) lnpara=lnpara+mean para=np.array(lnpara) para=para.reshape(Nod_num,) return para