diff --git a/src/lasp/lasp_record.py b/src/lasp/lasp_record.py index f3086dc..158665b 100644 --- a/src/lasp/lasp_record.py +++ b/src/lasp/lasp_record.py @@ -85,6 +85,7 @@ class Recording: try: # Open the file self.f = h5py.File(self.fn, "w", 'stdio') + self.f.flush() except Exception as e: logging.error(f'Error creating measurement file {e}') raise @@ -151,6 +152,7 @@ class Recording: # Measured physical quantity metadata # This was how it was in LASP version < 1.0 # f.attrs['qtys'] = [ch.qty.to_json() for ch in in_ch] + f.flush() def firstFrames(self, adata): """ @@ -227,10 +229,12 @@ class Recording: # instantaneously. For which we have to implement extra mutex # guards in this class del self.indh + self.indh = None # Remove handle to dataset otherwise the h5 file is not closed # properly. del self.ad + self.ad = None try: # Close the recording file