From ec9c95d408a66fab1faa872872b335ab19cdd1a5 Mon Sep 17 00:00:00 2001 From: Valerio Mariani <valerio.mariani@desy.de> Date: Fri, 18 Aug 2017 14:49:29 +0200 Subject: [PATCH] Added function to recover the number of slices already written to a file --- cfel_cxi.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cfel_cxi.py b/cfel_cxi.py index fc13c46..ebdb5b9 100644 --- a/cfel_cxi.py +++ b/cfel_cxi.py @@ -505,6 +505,20 @@ class CXIWriter: return self._curr_slice >= self._max_num_slices + def num_slices_in_file(selfself): + """Returns the number of slices already written in the file + + Returns the number of slices that have already been written in the file. + + Returns: + + status (num_slices): number of writter slices + """ + + num_slices = self._curr_slice - 1 + + return num_slices + def close_file(self): """Closes the file. -- GitLab