Skip to content

Commit a84625b

Browse files
committed
Update the attributes of HDF5 file in SGT database.
1 parent ccbacbc commit a84625b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

DSEM_Utils/merge_strainfield.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'nstep',
3333
'nforce',
3434
'nparas',
35+
'dt',
3536
]
3637

3738

@@ -71,7 +72,7 @@ def DCheck_valid_step(dir_array, str_processor, step0, step1, dstep):
7172
return valid_step_array
7273

7374
def DMerge_and_Compress_SGT(dir_array, str_processor, NSPEC, names_GLL_arr, index_GLL_arr,
74-
step0, step1, dstep, save_dir, n_dim=3, n_paras=6, encoding_level=8):
75+
step0, step1, dstep, save_dir, dt, n_dim=3, n_paras=6, encoding_level=8):
7576
'''
7677
* Merge the SGT in global with encoding, and compression,
7778
* according to the selected GLL points indicated by the 'names_GLL_arr' and 'index_GLL_arr'
@@ -96,6 +97,7 @@ def DMerge_and_Compress_SGT(dir_array, str_processor, NSPEC, names_GLL_arr, inde
9697
:param step1: The ending step, not in second. (int), eg: 6000
9798
:param dstep: The interval of the time step, not in second. (int), eg: 10
9899
:param save_dir: The output directory for saving the bin and info file.
100+
:param save_dir: The time interval of the SGT data.
99101
:param n_dim: The number of Unit forces, which is restricted to 3.
100102
:param n_paras: The number of the components in each SGT, which is restricted to 6.
101103
:param encoding_level: The encoding level. To convert the float to INT.
@@ -221,6 +223,8 @@ def DMerge_and_Compress_SGT(dir_array, str_processor, NSPEC, names_GLL_arr, inde
221223
f.attrs[SGT_ATTRS[1]] = n_step
222224
f.attrs[SGT_ATTRS[2]] = n_dim
223225
f.attrs[SGT_ATTRS[3]] = n_paras
226+
f.attrs[SGT_ATTRS[4]] = dt
227+
f.attrs['version']='v1.0'
224228

225229
return True
226230

0 commit comments

Comments
 (0)