@classmethod<EOL><INDENT>def select(cls, dataset, selection_mask=None, **selection):<DEDENT>
import iris<EOL>constraint = cls.select_to_constraint(dataset, selection)<EOL>pre_dim_coords = [c.name() for c in dataset.data.dim_coords]<EOL>indexed = cls.indexed(dataset, selection)<EOL>extracted = dataset.data.extract(constraint)<EOL>if indexed and not extracted.dim_coords:<EOL><INDENT>return extracted.data.item()<EOL><DEDENT>post_dim_coords = [c.name() for c in extracted.dim_coords]<EOL>dropped = [c for c in pre_dim_coords if c not in post_dim_coords]<EOL>for d in dropped:<EOL><INDENT>extracted = iris.util.new_axis(extracted, d)<EOL><DEDENT>return extracted<EOL>
Apply a selection to the data.