nansencenter / DAPPER

Data Assimilation with Python: a Package for Experimental Research

Home Page:https://nansencenter.github.io/DAPPER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QG Model Observation Vector / State Vector Relative Indexing

cgrudz opened this issue · comments

I'm working on a simulation built around the idea of the demo.py in the QG model where I'd like to visualize the time series of the truth twin and the associated observations of the truth twin from Sakov2008, plotted side-by-side on the same relative state vector 2D grid. Extracting the relative indices during run-time in the HMM.simulate seems like a reasonable approach, as these indices are defined with a random offset. However, before I do anything too invasive I wanted to check about the proposed approach. The end goal is just to get an intuitive visualization of the truth-twin and the noisy, limited observations of the truth twin as the observation operator sweeps the 2D grid in real time, to better understand both processes.

Not sure I understand. You want to visualize the time series of the obs or a given part of the state? Or how would you plot the whole state together with scalar time series of obs? As for the indices of the obs, I think you might be able to get them directly from dapper/mods/QG/sakov2008.py by duplicating or extracting the mechanism generating them. Not sure if it helps, hope so.

I'm thinking of a side-by-side plot where the observation vector is plotted on the same 2D grid as is done with \psi and q in demo.py. In this sense, I would want to create a vector with dummy NaN values for unobserved positions while the observed indices are filled with the observation vector. I think that could work, as you say, just replicating the index process, thought the seed management might be difficult as the random offset would be affected by the observation noise realizations.

The plot I'd like would be left-hand-side, \psi, right-hand-side, \mathbb{H}\psi + noise, on the same parent 2D grid of the state vector plot.

I guess you could from dapper.mods.QG.sakov2008 import obs_inds, right?

Make sure you're also able to try examples/basic_1.py with from dapper.mods.QG.sakov2008 import HMM with liveplotting just to get a sense of the satellite tracks.

Yeah the visualization in the video is the right sort of idea -- I want to make a demonstration of the observation generating process and the observations themselves to show relative sparsity / noise in the observation retrieval for the HMM, without necessarily performing an actual DA experiment. basic_1.py worked well with the from dapper.mods.QG.sakov2008 import HMM , this is also very nice demonstration of the model. I missed this

rstream.seed(int(t/model.prms['dtout']*100))

earlier in my inspection -- this says that the random offset is handled with a separate time-dependent seeding so the positions are reproducible from obs_inds(t) alone then?

so the positions are reproducible from obs_inds(t) alone then

Yes

Seems like you're on the right path with the PR so I'll close this discussion.