Source code for pyLOM.DMD.utils
#!/usr/bin/env python
#
# pyLOM - Python Low Order Modeling.
#
# DMD general utilities.
#
# Last rev: 27/01/2023
from __future__ import print_function, division
import numpy as np
from ..utils.gpu import cp
from .. import inp_out as io
from ..utils import cr_nvtx as cr, gpu_to_cpu
[docs]
@cr('DMD.save',color='blue')
def save(fname,muReal,muImag,Phi,bJov,ptable,nvars=1,pointData=True,mode='w'):
'''
Store DMD variables in serial or parallel
according to the partition used to compute the DMD.
'''
io.h5_save_DMD(fname,gpu_to_cpu(muReal),gpu_to_cpu(muImag),gpu_to_cpu(Phi),gpu_to_cpu(bJov),ptable,nvars=nvars,pointData=pointData,mode=mode)
[docs]
@cr('DMD.load',color='blue')
def load(fname,vars=['Phi','mu','bJov','delta','omega'],nmod=-1,ptable=None):
'''
Load DMD variables in serial or parallel
according to the partition used to compute the DMD.
'''
return io.h5_load_DMD(fname,vars,nmod,ptable)