deftrans4_3(tt,ll,mm,ii):#4-d transform to 3-d
N=[np.zeros(shape=(tt,ll,mm),dtype=int)foriinrange(4)]N[0][:,:,:]=np.array([tfortinrange(tt)])[:,None,None]N[1][:,:,:]=np.array([kforkinrange(ll)])[None,:,None]N[2][:,:,:]=ii[0][None,None,:]N[3][:,:,:]=ii[1][None,None,:]forninrange(4):N[n]=N[n].flatten()returnN