diff --git a/src/toolbox_scs/detectors/hrixs.py b/src/toolbox_scs/detectors/hrixs.py index 2ee5802ffd80e359f2e3d4ece908252fc48d0820..698da4a2b829d34e5c9ef0f4f004dc87569b6eea 100644 --- a/src/toolbox_scs/detectors/hrixs.py +++ b/src/toolbox_scs/detectors/hrixs.py @@ -266,10 +266,14 @@ class hRIXS: 'bins', 'method', 'fields') return {param: getattr(self, param.upper()) for param in params} - def from_run(self, runNB, proposal=None, extra_fields=()): + def from_run(self, runNB, proposal=None, extra_fields=(), drop_first=False): """load a run Load the run `runNB`. A thin wrapper around `toolbox.load`. + Parameters + ---------- + drop_first: bool + if True, the first image in the run is removed from the dataset. Example ------- @@ -284,7 +288,8 @@ class hRIXS: proposal = self.PROPOSAL run, data = tb.load(proposal, runNB=runNB, fields=self.FIELDS + list(extra_fields)) - + if drop_first is True: + data = data.isel(trainId=slice(1, None)) return data def load_dark(self, runNB, proposal=None):