We show how the 3DVAR data assimilation methodology can be used in the astrophysical context of a two-dimensional convection flow. We study the way in which this variational approach finds best estimates of the current state of the flow from a weighted average of model states and observations. We use numerical simulations to generate synthetic observations of a vertical two-dimensional slice of the outer part of the solar convection zone for varying noise levels, and implement 3DVAR when the co-variance matrices are diagonal and proportional to the identity matrix. Our simulation results demonstrate the capability of 3DVAR to produce error estimates of system states that can be more than two orders of magnitude below the original noise level present in the observations. This work illustrates the importance of applying data to obtain accurate model estimates given a set of observations. It also exemplifies how data assimilation techniques can be applied to simulations of stratified convection.