def process_nexus_tile()

in sdap/processors/deleteunitaxis.py [0:0]


    def process_nexus_tile(self, nexus_tile):
        axis = [x.split(':')[0] for x in nexus_tile.summary.section_spec.split(',')].index(self.dimension)

        the_tile_type = nexus_tile.tile.WhichOneof("tile_type")

        the_tile_data = getattr(nexus_tile.tile, the_tile_type)

        var_data = from_shaped_array(the_tile_data.variable_data)

        if numpy.size(var_data, axis) == 1:
            the_tile_data.variable_data.CopyFrom(to_shaped_array(numpy.squeeze(var_data, axis=axis)))
        else:
            raise RuntimeError("Cannot delete axis for dimension %s because length is not 1." % self.dimension)

        yield nexus_tile