Selection.only_atom_types() — select only atoms of given types

only_atom_types(atom_types)
This returns a new selection containing only atoms from the current selection of the given space-separated type(s).
Example: See Selection() command.