Skip to content
Snippets Groups Projects
Commit 5b5c9186 authored by Aiko Voigt's avatar Aiko Voigt
Browse files

Changed format of field_cube from int to byte to save memory

parent b6b0b5dd
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ def __field_icon(path, file, var, threshold, cubulation): ...@@ -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 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 # 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: for entry in cubulation:
triangle = entry[0] # index of triangle triangle = entry[0] # index of triangle
cube = entry[1] # cube coordinate cube = entry[1] # cube coordinate
...@@ -109,7 +109,7 @@ def __field_icon_lev(path, file, var, threshold, cubulation): ...@@ -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 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 # 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 lev in range(nlev):
for entry in cubulation: for entry in cubulation:
triangle = entry[0] # index of triangle triangle = entry[0] # index of triangle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment