From e65999901ec20117cb067a8c01480f38d8b2b57e Mon Sep 17 00:00:00 2001 From: David Minton Date: Tue, 19 Jul 2022 11:39:58 -0400 Subject: [PATCH] Added optional kind parameter to linked list binary reader in order to select the appropriate CTEM data type --- python/ctem/ctem/util.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/ctem/ctem/util.py b/python/ctem/ctem/util.py index 070ed3f3..da9d0b8b 100644 --- a/python/ctem/ctem/util.py +++ b/python/ctem/ctem/util.py @@ -281,12 +281,20 @@ def read_unformatted_binary(filename, gridsize, kind='DP'): return data -def read_linked_list_binary(filename, gridsize): +def read_linked_list_binary(filename, gridsize, kind='DP'): + if kind == 'DP': + dt = np.dtype('f8') + elif kind == 'SP': + dt = np.dtype('f4') + elif kind == 'I4B': + dt = np.dtype('