column map converter
This commit is contained in:
parent
261f685463
commit
e05dcdc34b
|
|
@ -0,0 +1,24 @@
|
||||||
|
function [pp2] = convert_particles_array_colmap(pp1,col1,col2)
|
||||||
|
% [pp2] = convert_particles_array_colmap(pp1,col1,col2)
|
||||||
|
% Converts particle array data with colmap 1 to array with colmap 2
|
||||||
|
% Input
|
||||||
|
% pp1 original particle data in 'array' format
|
||||||
|
% col1 column map of pp1
|
||||||
|
% col2 new column map
|
||||||
|
% Output
|
||||||
|
% pp2 particle data with column map col2
|
||||||
|
ncol2 = col2.Count;
|
||||||
|
np = size(pp1,2);
|
||||||
|
nt = size(pp1,3);
|
||||||
|
pp2 = zeros(ncol2,np,nt);
|
||||||
|
|
||||||
|
col2keys = col2.keys;
|
||||||
|
for it=1:nt
|
||||||
|
for icol=1:ncol2
|
||||||
|
key = col2keys{icol};
|
||||||
|
if col1.isKey(key)
|
||||||
|
pp2(icol,:,it) = pp1(col1(key),:,it);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue