Browse Source

More informative warning if gap frames encountered and filled with np.nan

feature/load_slices
unknown 5 years ago
parent
commit
54fd7253b6
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      nd2reader/parser.py

+ 1
- 1
nd2reader/parser.py View File

@ -288,7 +288,7 @@ class Parser(object):
# errors with ND2-files with missing frames. Array is filled with nan to reflect that data is missing. # errors with ND2-files with missing frames. Array is filled with nan to reflect that data is missing.
else: else:
empty_frame = np.full((height, width), np.nan) empty_frame = np.full((height, width), np.nan)
warnings.warn('ND2 file contains gap frames which are represented by np.nan-filled arrays')
warnings.warn('ND2 file contains gap frames which are represented by np.nan-filled arrays; to convert to zeros use e.g. np.nan_to_num(array)')
return timestamp, Frame(empty_frame, metadata=self._get_frame_metadata()) return timestamp, Frame(empty_frame, metadata=self._get_frame_metadata())
def _get_frame_metadata(self): def _get_frame_metadata(self):


Loading…
Cancel
Save