def METHOD_NAME(self):
    try:
        dg = self.create_data_group("irradiation_%d")
        while True:
            self.log("opening shutter")
            self.shutter.open_shutter()
            self.wait_or_stop(self.irradiation_time)
            self.shutter.close_shutter()
            self.log("closed shutter")
            self.wait_or_stop(self.wait_time)
            spectrum = self.spectrometer.read_spectrum(bundle_metadata=True)
            dg.create_dataset("spectrum_%d", data=spectrum)
    except ExperimentStopped:
        pass #don't raise an error if we just clicked "stop"
    finally:
        self.shutter.close_shutter() #close the shutter, important if we abort