From d5752f163331bd330eb38806e0c1ec1c6d7466b1 Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Fri, 16 Jun 2017 15:11:23 +0200 Subject: [PATCH] Also get sampling interval when dAvgPeriodDiff is not set --- nd2reader/raw_metadata.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nd2reader/raw_metadata.py b/nd2reader/raw_metadata.py index d729135..cc79d58 100644 --- a/nd2reader/raw_metadata.py +++ b/nd2reader/raw_metadata.py @@ -350,7 +350,10 @@ class RawMetadata(object): is_stimulation = get_from_dict_if_exists('uiLoopType', loop) == 6 # sampling interval in ms - interval = get_from_dict_if_exists('dAvgPeriodDiff', loop) + interval = get_from_dict_if_exists('dPeriod', loop) + + if interval is None or interval <= 0: + interval = get_from_dict_if_exists('dAvgPeriodDiff', loop) parsed_loop = { 'start': time_offset,