# Covariance matrix for a 2D state vector

I'm performing Optimal Interpolation (which in fact is a simplified Kalman filter with constant $$\mathbf{K}$$). My state variable is a 2D concentration field with a size of 370 x 400 on which I try to assimilate several (approximately tens) measurement stations results. In order to perform calculations, I transform it into a column vector of dimension 148000 x 1. My background covariance matrix $$\mathbf{B}$$ has a dimension of 148000 x 148000, which is still feasible to handle with Scipy sparse matrix representation. Later on, I use it to calculate Kalman gain as follows: $$\mathbf{K=BH^T(HBH^T+R)^{-1}}$$

My problem is: during matrix flatting, I loose the 'neighbourhood information'. Hence, my background correlation $$\mathbf{B}$$ represents only correlation in one direction (horizontal or vertical), which results in strips instead of circles as assimilation results. So the question is: shall I still use matrix flatting and construct $$\mathbf{B}$$ in another way? or shall I avoid flatting and using a column vector as state representation?

Concentration map before assimilation Concentration map after assimilation, horizontal strips represent assimilated data A top-left section of background covariance matrix $$\mathbf{B}$$