diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 2b088172cefc91f927b7ac59bdb98f2f7052a017..0ed00d2cbd532b5aa5c7f0318878e822bdcb96a7 100644 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -510,7 +510,8 @@ class Instrument: but: optional category of noises to keep on ['laser', 'modulation', 'clock', 'pathlength', 'ranging', 'jitters'] """ - if but not in ['laser', 'modulation', 'clock', 'pathlength', 'ranging', 'jitters']: + valid_noises = ['laser', 'modulation', 'clock', 'pathlength', 'ranging', 'jitters'] + if but is not None and but not in valid_noises: raise ValueError(f"unknown noise '{but}'") if but != 'laser':