We present an inversion methodology where acoustic observations of infrasound waves are used to update an atmospheric model. We sought a flexible parameterization that permits to incorporate physical and numerical constraints without the need to reformulate the inversion. On the other hand, the optimization conveys an explicit search over the solution space, making the solver computationally expensive. Nevertheless, through a parallel implementation and the use of tight constraints we demonstrate that the methodology is computationally tractable. Constraints to the solution space are derived from the spread (variance) of ERA5 ensemble reanalysis members, which summarize the best current knowledge of the atmosphere from assimilated measurements and physical models. Similarly, the initial model temperature and winds for the inversion are chosen to be the average of these parameters in the ensemble members. The performance of the inversion is demonstrated with the application to infrasound observations from an explosion generated by the destruction of ammunition at Hukkakero, Finland. The acoustic signals are recorded at an array station located at 178 km range, which is within the classical shadow zone distance. The observed returns are assumed to come from stratospheric reflections. Thus, the reflection altitude is also an inverted parameter.