function ipr = rgbipr_select(ipr, set)
    % keep only particles from a given set
    n_part      = size(ipr.re_part,2);
    fields      = fieldnames(ipr);
    for f = 1 : n_fields
        if size(ipr.(fields{f}), 2) == n_part
            ipr.(fields{f}) = ipr.(fields{f})(:, set);
        end
    end
    ipr.n_part  = size(ipr.re_part, 2);
end