OpenDA-Association / OpenDA

Open data assimilation toolbox
GNU Lesser General Public License v3.0
87 stars 31 forks source link

Allow overwriting in noise model for analysis step #223

Open erikpelgrim opened 1 year ago

erikpelgrim commented 1 year ago

In BBStochModelInstance there is a restriction which prevents noise being set multiple times for the same time step.

However according to Julius Sumihar, Martin Verlaan & Tammo Zijlker this should be possible for an analysis step.

If there are 2 run periods

and on day 3 there is an analysis step, then for both run periods it should be allowed to set noise to the same exchange item for day 3, forecast noise should be overwritten with analysis noise.

For this a configurable option: allowOverwriteForecastWithAnalysisNoise="true" is added. Currently this is only allowed to combine with option transformation="set" because the noise should be overwritten. If for instance "add" or "multiply" is being used noise will not be overwritten but applied on top of.

transformation="set" has also been implemented in the code, this was not yet the case.

If there are any data assimilation related questions about overwriting forecast noise with analysis noise then it is probably best to include Julius Sumihar, Martin Verlaan & Tammo Zijlker

erikpelgrim commented 1 year ago

Example config:

        <noiseModel className="org.openda.noiseModels.MapsNoiseModelFactory" id="boundaryNoiseModel" workingDirectory=".">
            <configFile>2DPressureNoise.xml</configFile>
            <exchangeItems>
                <exchangeItem id="2DPressureNoise" allowOverwriteForecastWithAnalysisNoise="true" transformation="set">
                    <modelExchangeItem id="p"/>
                </exchangeItem>
            </exchangeItems>
        </noiseModel>
nilsvanvelzen commented 1 year ago

I see that the tests are failing. I suppose you try fix that first.

erikpelgrim commented 1 year ago

Yes, indeed, strange, I do not see any changes related to that, will investigate further.

erikpelgrim commented 1 year ago

Reopen for simplification. New option allowOverwriteForecastWithAnalysisNoise is not needed. Because it can only be used in combination with operation="set", operation="set" is enough to allow overwriting forecast noise with analysis noise.