############################################# First inversion with the toy-gaussian model ############################################# .. role:: bash(code) :language: bash After running a :doc:`first forward run<../first-simu/index>` with perturbed outputs from known emissions with the :doc:`the Toy Gaussian Model`, it is possible to carry out an academic inversion using these "true" observations. Below are the steps to run a variational inversion with the minimizer :bash:`M1QN3`: 1. Copy the :bash:`obsvect` repository from the :bash:`workdir` your first forward simulation to :bash:`outdir`; rename it to :bash:`ref_obsvect` 2. Set up a Yaml configuration: - copy the content of the reference Yaml file available :doc:`here` to a directory of your choice - modify paths to fit your own configuration: - :bash:`rootdir`: path where the CIF sources are - :bash:`outdir`: where the outputs will be generated please note that they should be consistent with the parameters used in :doc:`first forward run<../first-simu/index>` as the :bash:`obsvect` with perturbed observations is retrieved from the forward 3. Run pyCIF based on your Yaml file: .. code-block:: bash python -m pycif path-to-your-yaml 4. Explore the results in :bash:`workdir`: - :bash:`$workdir/controlvect/fluxes/controlvect_fluxes_CH4.nc`: the optimized fluxes - :bash:`$workdir/controlvect/simulator/cost.txt`: the value of the cost function at each iteration - :bash:`$workdir/controlvect/simulator/gradcost.txt`: the norm of the gradient of the cost function at each iteration You just carried out an inversion using the minimizer :bash:`M1QN3`. The configuration set-up used a Monte-Carlo approach to compute posterior uncertainties, this can be switched off by commenting the line :bash:`mode/montecarlo` .. note:: It is very likely that your inversion did not succeed in capturing the target text to retrieve. You can play with the number of stations to test how many are needed to retrieve the 'truth' with a very bad prior.