Project

General

Profile

Is it possible to concatenate multiple time series columnwise into a matrix in CDO?

Added by Mikhail Latonin almost 4 years ago

Hello,

I have multiple time series of a characteristic over the same time period stored in separate netCDF files, and I would like to store these time series in a matrix accessible from one netCDF file. So, I would like to transform the data from the vectors in multiple files to the matrix in one file.

I have found that standard CDO commands for merging the files are not appropriate in this case. For example, if there are two time series, the operators 'mergetime' or 'cat' append the second time series to the first one, whereas I need to concatenate them in the matrix form, i.e., columnwise.

Best wishes,
Mikhail


Replies (7)

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Ralf Mueller almost 4 years ago

hi Mikhail!

could you upload at least 2 of them? I don't understand you 'matrix' approach to be honest. timeseries for different variables are stored into different netCDF-variables in a CF-conform file. In case you want to store all timeseries into one array and access them via an index, then this output file is not CD-conform anymore. Of course this is possible with netCDF, but not using CDO. I think you have to use NCO for this.

hth
ralf

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Mikhail Latonin almost 4 years ago

Hi, Ralf!

Thank you for the quick reply and your advice. I have the same variable, but its different realizations. Please find attached two files. I will try using NCO for this task as well.

Best,
Mikhail

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Ralf Mueller almost 4 years ago

you could put the time series on different lon/lat positions and use mergegrid. but this just emulates what you want to do I think.

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Brendan DeTracey almost 4 years ago

I have not used it, but I believe nco (http://nco.sourceforge.net/) has this functionality (http://nco.sourceforge.net/nco.html#ncecat-netCDF-Ensemble-Concatenator) but it may not be giving you exactly what you want. cdo does have ensemble operators that will work on your realization files.

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Mikhail Latonin almost 4 years ago

Thank you, Brendan. This task is resolved with NCO using ncecat *nc -O merged.nc.

Mikhail

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Luz Dixon over 3 years ago

Brendan DeTracey wrote:

I have not used it, but I believe nco (http://nco.sourceforge.net/) has this functionality (http://nco.sourceforge.net/nco.html#ncecat-netCDF-Ensemble-Concatenator https://happywheels2.io ) but it may not be giving you exactly what you want. cdo does have ensemble operators that will work on your realization files.

In any case thank you for helping me.

RE: Is it possible to concatenate multiple time series columnwise into a matrix in CDO? - Added by Brendan DeTracey over 3 years ago

You could thank me, mister robot, by not inserting a malicious url when quoting me.

    (1-7/7)