JGCRI / fldgen

Given a global mean temperature pathway, generate random global climate fields consistent with it and with spatial and temporal correlation derived from an ESM
https://jgcri.github.io/fldgen/
GNU General Public License v2.0
13 stars 6 forks source link

Handle multiple input time series #1

Closed rplzzz closed 6 years ago

rplzzz commented 6 years ago

Update the code to handle multiple input time series. For the mean field model and the EOF decomposition, this is trivial; both of those algorithms operate on the rows of the input data independently, so you can just concatenate the data sets and pass them to the relevant functions.

For the power spectrum analysis, you have to do each Fourier transform individually and average the magnitudes of the power spectra found from each time series. That introduces some minor complications because you need to keep a record of which rows in the grand data matrix correspond to which input time series. It’s important to do the bookkeeping in a way that doesn’t result in a lot of data copying.

CLynchy commented 6 years ago

I think this was discussed on Slack? Is the idea to use multiple realizations from 1 model to use as the 'training' data for the pattern? Otherwise, can a loop be created to pull in data and put it into an array? Then do the calculations over all dimensions?

rplzzz commented 6 years ago

That's the gist of it. I've written functions to handle the multi-run data, but I've still got to write a function to compute the estimate of the power spectrum from the multiple runs, and then I'll need to test the whole thing too.

rplzzz commented 6 years ago

Done.