@@ -91,9 +91,9 @@ def write_init_results(self):
9191 )
9292 trg = f"/entry{ self .config ['entry_id' ]} /config"
9393 grp = h5w .create_group (trg )
94- grp .attrs ["NX_class" ] = "NXserialized "
94+ grp .attrs ["NX_class" ] = "NXnote "
9595 dst = h5w .create_dataset (f"{ trg } /type" , data = "file" )
96- dst = h5w .create_dataset (f"{ trg } /path " , data = self .config ["config_file_path" ])
96+ dst = h5w .create_dataset (f"{ trg } /file_name " , data = self .config ["config_file_path" ])
9797 dst = h5w .create_dataset (f"{ trg } /checksum" , data = get_sha256 (self .config ["config_file_path" ]))
9898 dst = h5w .create_dataset (f"{ trg } /algorithm" , data = "sha256" )
9999
@@ -237,12 +237,12 @@ def write_voxelization_grid_info(self):
237237 )
238238 dst .attrs ["units" ] = "nm"
239239 dst = h5w .create_dataset (f"{ trg } /extent" , data = self .extent )
240- identifier_offset = 0 # we count cells starting from this value
240+ index_offset = 0 # we count cells starting from this value
241241 dst = h5w .create_dataset (
242- f"{ trg } /identifier_offset " , data = np .uint64 (identifier_offset )
242+ f"{ trg } /index_offset " , data = np .uint64 (index_offset )
243243 )
244244
245- voxel_id = identifier_offset
245+ voxel_id = index_offset
246246 position = np .zeros ([c , 3 ], np .float64 )
247247 for k in np .arange (0 , self .extent [2 ]):
248248 z = self .aabb3d [2 , 0 ] + (0.5 + k ) * dedge
@@ -258,7 +258,7 @@ def write_voxelization_grid_info(self):
258258 dst .attrs ["units" ] = "nm"
259259 del position
260260
261- voxel_id = identifier_offset
261+ voxel_id = index_offset
262262 coordinate = np .zeros ([c , 3 ], np .uint64 )
263263 for k in np .arange (0 , self .extent [2 ]):
264264 for j in np .arange (0 , self .extent [1 ]):
@@ -295,7 +295,7 @@ def write_voxelization_results(self):
295295 h5w = h5py .File (self .config ["results_file_path" ], "a" )
296296 trg = f"/entry{ self .config ['entry_id' ]} /voxelization/cg_grid"
297297 dst = h5w .create_dataset (
298- f"{ trg } /voxel_identifier " ,
298+ f"{ trg } /indices_voxel " ,
299299 compression = "gzip" ,
300300 compression_opts = 1 ,
301301 data = self .voxel_identifier ,
@@ -345,14 +345,15 @@ def write_voxelization_results(self):
345345 )
346346
347347 # specimen group
348- trg = f"/entry{ self .config ['entry_id' ]} /specimen"
349- grp = h5w .create_group (f"{ trg } " )
350- grp .attrs ["NX_class" ] = "NXsample"
351- if str (self .config ["specimen/type" ]) in ["experiment" , "simulation" ]:
352- dst = h5w .create_dataset (f"{ trg } /type" , data = str (self .config ["specimen/type" ]))
353- else :
354- dst = h5w .create_dataset (f"{ trg } /type" , data = "unknown" )
355- dst = h5w .create_dataset (f"{ trg } /atom_types" , data = str (", " .join (list (atom_types ))))
348+ if "specimen/is_simulation" in self .config :
349+ trg = f"/entry{ self .config ['entry_id' ]} /specimen"
350+ grp = h5w .create_group (f"{ trg } " )
351+ grp .attrs ["NX_class" ] = "NXsample"
352+ if self .config ["specimen/is_simulation" ] is True :
353+ dst = h5w .create_dataset (f"{ trg } /is_simulation" , data = True )
354+ else :
355+ dst = h5w .create_dataset (f"{ trg } /is_simulation" , data = False )
356+ dst = h5w .create_dataset (f"{ trg } /atom_types" , data = str (", " .join (list (atom_types ))))
356357 h5w .close ()
357358
358359 def run (self , recon_file_path : str , range_file_path : str ):
0 commit comments