Transposing an array
Added by Felix Meissner about 3 years ago
Hello everybody,
I'm searching for a possibility to transpose an array.
In my case I'm dealing with a 1x1200 array and I want to end up with an 1200x1 array since the further processing of the data requires this form.
Is there an easy way to achieve this with CDO or do I have to take another route here?
I hope I provided all necessary informations and am very happy about any help or advice.
Cheers Felix
Replies (6)
RE: Transposing an array - Added by Karin Meier-Fleischer about 3 years ago
Hi Felix,
in general, you can use NCO's ncpdp routine to transpose dimensions, e.g.
ncpdq -a y,x infile.nc outfile.nc
-Karin
RE: Transposing an array - Added by Felix Meissner about 3 years ago
Thank you Karin, this works perfectly for me.
Really appreciate the help.
@Ralf Thehos Yes I'm serious, thanks for your contribution.
RE: Transposing an array - Added by Ralf Mueller about 3 years ago
hi Felix!
No offense, but there are bots using the forum every now and then. Maybe I was too picky, but IMO your post was too general to be seriously linked to CDO. CDO does not work on arrays, arrays are a term from programming and not for CDO since it works on files. yes, internally you can say there are arrays, but here you did not provide which dimensions are represented as 1200x1 (time,level,lon,lat,y,z). so it is pretty hard to give an adequate answer.
All of this is very typical for a bot.
cheers
ralf
RE: Transposing an array - Added by Felix Meissner about 3 years ago
Oh, I understand. Thanks for clearing this up. I will keep this in mind and will try to be more precise in future questions.
Cheers
Felix