def batch_filter(self, Zs, Rs=None, update_first=False):

        n = np.size(Zs,0)
        if Rs is None:
            Rs = [None]*n

        # mean estimates from Kalman Filter
        means = zeros((n,self.dim_x,1))

        # state covariances from Kalman Filter
        covariances = zeros((n,self.dim_x,self.dim_x))

        if update_first:
            for i,(z,r) in enumerate(zip(Zs,Rs)):
                self.update(z,r)
                means[i,:] = self.x
                covariances[i,:,:] = self.P
                self.predict()
        else:
            for i,(z,r) in enumerate(zip(Zs,Rs)):
                self.predict()
                self.update(z,r)

                means[i,:] = self.x
                covariances[i,:,:] = self.P

        return (means, covariances)
Write the package file.
dataset/ETHPy150Open rlabbe/filterpy/filterpy/hinfinity/hinfinity_filter.py/HInfinityFilter.batch_filter--crossover with--dataset/ETHPy150Open modflowpy/flopy/flopy/modflow/mfsfr2.py/ModflowSfr2.write_file