diff options
Diffstat (limited to 'qolab/data')
-rw-r--r-- | qolab/data/trace.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qolab/data/trace.py b/qolab/data/trace.py index e81cced..d0d069f 100644 --- a/qolab/data/trace.py +++ b/qolab/data/trace.py @@ -35,8 +35,15 @@ class Trace: def getHeader(self, prefix=''): return headerFronDictionary(self.getConfig(), prefix='') - def save(self, fname, item_format='e', **kwargs): - fname = save_table_with_header(fname, self.getData(), self.getHeader(), item_format=item_format, **kwargs) + def save(self, fname, item_format='e', last_saved_pos=None, skip_headers_if_file_exist=False, **kwargs): + if last_saved_pos is None: + last_saved_pos = self.last_saved_pos + data = self.getData() + if last_saved_pos > 0: + skip_headers_if_file_exist=True + print(skip_headers_if_file_exist) + fname = save_table_with_header(fname, data[last_saved_pos:,:], self.getHeader(), item_format=item_format, skip_headers_if_file_exist=skip_headers_if_file_exist, **kwargs) + self.last_saved_pos = data.shape[0] return(fname) def addPoint(self, val): |