function ipr = select(ipr, index)
    % keep only particles from a given set
    n_part = ipr.count();
	for f = 1 : length(ipr.pprops)
        field       = ipr.pprops{f};
		assert(isreal(ipr.(field)), '%s is not real', field);
		if size(ipr.(field),2) == n_part
			ipr.(field) = ipr.(field)(:,index);
		end
	end
end