From 5b5c9186a14d444f494cabceb3dd1a2301b79125 Mon Sep 17 00:00:00 2001 From: voigta80 <aiko.voigt@univie.ac.at> Date: Thu, 16 Sep 2021 15:25:52 +0200 Subject: [PATCH] Changed format of field_cube from int to byte to save memory --- tricco/prepare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tricco/prepare.py b/tricco/prepare.py index 3001b6b..ccd7a86 100644 --- a/tricco/prepare.py +++ b/tricco/prepare.py @@ -81,7 +81,7 @@ def __field_icon(path, file, var, threshold, cubulation): array_size=array_size+1 # need to add one as cubulation indices start with 1 instead of 0 # map field from triangular grid to field on cubic grid - field_cube = np.zeros((array_size, array_size, array_size), dtype = 'int') + field_cube = np.zeros((array_size, array_size, array_size), dtype = 'byte') for entry in cubulation: triangle = entry[0] # index of triangle cube = entry[1] # cube coordinate @@ -109,7 +109,7 @@ def __field_icon_lev(path, file, var, threshold, cubulation): array_size=array_size+1 # need to add one as cubulation indices start with 1 instead of 0 # map field from triangular grid to field on nlev x cubic grid - field_cube = np.zeros((nlev, array_size, array_size, array_size), dtype = 'int') + field_cube = np.zeros((nlev, array_size, array_size, array_size), dtype = 'byte') for lev in range(nlev): for entry in cubulation: triangle = entry[0] # index of triangle -- GitLab