Closed-form conditional diffusion models for data assimilation