@@ -141,7 +141,9 @@ def _register_metadata(self, handle: h5py.File):
141141 """
142142 metadata = handle [self .name ].attrs
143143 factor = (
144- metadata ["Conversion factor to CGS (including cosmological corrections)" ][0 ]
144+ metadata [
145+ "Conversion factor to physical CGS (including cosmological corrections)"
146+ ][0 ]
145147 * unyt .A ** metadata ["U_I exponent" ][0 ]
146148 * unyt .cm ** metadata ["U_L exponent" ][0 ]
147149 * unyt .g ** metadata ["U_M exponent" ][0 ]
@@ -374,6 +376,8 @@ def _register_elements(self, handle: h5py.File):
374376 """
375377 h5group = handle [self .name ] if self .name != "" else handle ["/" ]
376378 for (key , h5obj ) in h5group .items ():
379+ if key == "Cells" :
380+ continue
377381 if isinstance (h5obj , h5py .Group ):
378382 el = CatalogueGroup (self .file_name , f"{ self .name } /{ key } " , handle )
379383 dynamically_register_properties (el )
@@ -526,22 +530,21 @@ def _register_quantities(self):
526530 """
527531 with h5py .File (self .file_name , "r" ) as handle :
528532 self .root = CatalogueGroup (self .file_name , "" , handle )
529- cosmology = handle ["SWIFT/ Cosmology" ].attrs
533+ cosmology = handle ["Cosmology" ].attrs
530534 # set up a dummy units object for compatibility with the old VR API
531535 self .units = SimpleNamespace ()
532536 self .a = cosmology ["Scale-factor" ][0 ]
533537 self .units .scale_factor = cosmology ["Scale-factor" ][0 ]
534538 self .z = cosmology ["Redshift" ][0 ]
535539 self .units .redshift = cosmology ["Redshift" ][0 ]
536540
537- swift_units = SWIFTUnitsMockup (dict (handle ["SWIFT/ Units" ].attrs ))
541+ swift_units = SWIFTUnitsMockup (dict (handle ["Units" ].attrs ))
538542 self .cosmology = swift_cosmology_to_astropy (dict (cosmology ), swift_units )
539543
540544 # get the box size and length unit from the SWIFT header and unit metadata
541545 boxsize = handle ["SWIFT/Header" ].attrs ["BoxSize" ][0 ]
542546 boxsize_unit = (
543- handle ["SWIFT/InternalCodeUnits" ].attrs ["Unit length in cgs (U_L)" ][0 ]
544- * unyt .cm
547+ handle ["Units" ].attrs ["Unit length in cgs (U_L)" ][0 ] * unyt .cm
545548 ).in_base ("galactic" )
546549 boxsize *= boxsize_unit
547550 physical_boxsize = self .a * boxsize
0 commit comments