You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I tried to install and use cosmic_profile on my Gadget-4 simulation but get the following error :
File "/automnt/data77/stahl/Scale/analysis/WDM/profiles/script.py", line 91, in <module>
HDF5Ex()
File "/automnt/data77/stahl/Scale/analysis/WDM/profiles/script.py", line 47, in HDF5Ex
cprofiles = DensShapeProfsGadget(SNAP_DEST, GROUP_DEST, OBJ_TYPE, SNAP, VIZ_DEST, CAT_DEST, RVIR_OR_R200 = RVIR_OR_R200, MIN_NUMBER_PTCS = MIN_NUMBER_PTCS, CENTER = CENTER)
File "cosmic_profiles/shape_profs/shape_profs_classes.pyx", line 573, in cosmic_profiles.shape_profs.shape_profs_classes.DensShapeProfsGadget.__init__
File "/home/stahl/.local/lib/python3.9/site-packages/cosmic_profiles/gadget/readgadget.py", line 131, in read_block
head = header(filename)
File "/home/stahl/.local/lib/python3.9/site-packages/cosmic_profiles/gadget/readgadget.py", line 45, in __init__
self.omega_m = f['Header'].attrs[u'Omega0']
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/home/stahl/.local/lib/python3.9/site-packages/h5py/_hl/attrs.py", line 56, in __getitem__
attr = h5a.open(self._id, self._e(name))
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5a.pyx", line 80, in h5py.h5a.open
KeyError: "Can't open attribute (can't locate attribute: 'Omega0')"
I guess it comes from the format of my files, as the 'Header' in my snapshot_000.hdf5 does not contain Omega0 anymore : Attributes in 'Header': ['BoxSize', 'Git_commit', 'Git_date', 'MassTable', 'NumFilesPerSnapshot', 'NumPart_ThisFile', 'NumPart_Total', 'Redshift', 'Time']
These are the attribute of my file <KeysViewHDF5 ['Config', 'Header', 'Parameters', 'PartType1']>
and I think what you are trying to look for in line 45 of gadget/readgadget.py is now located in 'Parameters' : <KeysViewHDF5 ['ActivePartFracForNewDomainDecomp', 'ActivePartFracForPMinsteadOfEwald', 'ArtBulkViscConst', 'BoxSize', 'ComovingIntegrationOn', 'CourantFac', 'CpuTimeBetRestartFile', 'DesLinkNgb', 'DesNumNgb', 'ErrTolForceAcc', 'ErrTolIntAccuracy', 'ErrTolTheta', 'ErrTolThetaMax', 'GravityConstantInternal', 'Hubble', 'HubbleParam', 'ICFormat', 'InitCondFile', 'InitGasTemp', 'MaxFilesWithConcurrentIO', 'MaxMemSize', 'MaxNumNgbDeviation', 'MaxSizeTimestep', 'MinEgySpec', 'MinSizeTimestep', 'NumFilesPerSnapshot', 'Omega0', 'OmegaBaryon', 'OmegaLambda', 'OutputDir', 'OutputListFilename', 'OutputListOn', 'SnapFormat', 'SnapshotFileBase', 'SofteningClassOfPartType0', 'SofteningClassOfPartType1', 'SofteningClassOfPartType2', 'SofteningClassOfPartType3', 'SofteningClassOfPartType4', 'SofteningClassOfPartType5', 'SofteningComovingClass0', 'SofteningMaxPhysClass0', 'TimeBegin', 'TimeBetSnapshot', 'TimeBetStatistics', 'TimeLimitCPU', 'TimeMax', 'TimeOfFirstSnapshot', 'TopNodeFactor', 'TypeOfOpeningCriterion', 'UnitLength_in_cm', 'UnitMass_in_g', 'UnitVelocity_in_cm_per_s']>
The text was updated successfully, but these errors were encountered:
Hello,
I tried to install and use cosmic_profile on my Gadget-4 simulation but get the following error :
I guess it comes from the format of my files, as the 'Header' in my snapshot_000.hdf5 does not contain Omega0 anymore :
Attributes in 'Header': ['BoxSize', 'Git_commit', 'Git_date', 'MassTable', 'NumFilesPerSnapshot', 'NumPart_ThisFile', 'NumPart_Total', 'Redshift', 'Time']
These are the attribute of my file
<KeysViewHDF5 ['Config', 'Header', 'Parameters', 'PartType1']>
and I think what you are trying to look for in line 45 of gadget/readgadget.py is now located in 'Parameters' :
<KeysViewHDF5 ['ActivePartFracForNewDomainDecomp', 'ActivePartFracForPMinsteadOfEwald', 'ArtBulkViscConst', 'BoxSize', 'ComovingIntegrationOn', 'CourantFac', 'CpuTimeBetRestartFile', 'DesLinkNgb', 'DesNumNgb', 'ErrTolForceAcc', 'ErrTolIntAccuracy', 'ErrTolTheta', 'ErrTolThetaMax', 'GravityConstantInternal', 'Hubble', 'HubbleParam', 'ICFormat', 'InitCondFile', 'InitGasTemp', 'MaxFilesWithConcurrentIO', 'MaxMemSize', 'MaxNumNgbDeviation', 'MaxSizeTimestep', 'MinEgySpec', 'MinSizeTimestep', 'NumFilesPerSnapshot', 'Omega0', 'OmegaBaryon', 'OmegaLambda', 'OutputDir', 'OutputListFilename', 'OutputListOn', 'SnapFormat', 'SnapshotFileBase', 'SofteningClassOfPartType0', 'SofteningClassOfPartType1', 'SofteningClassOfPartType2', 'SofteningClassOfPartType3', 'SofteningClassOfPartType4', 'SofteningClassOfPartType5', 'SofteningComovingClass0', 'SofteningMaxPhysClass0', 'TimeBegin', 'TimeBetSnapshot', 'TimeBetStatistics', 'TimeLimitCPU', 'TimeMax', 'TimeOfFirstSnapshot', 'TopNodeFactor', 'TypeOfOpeningCriterion', 'UnitLength_in_cm', 'UnitMass_in_g', 'UnitVelocity_in_cm_per_s']>
The text was updated successfully, but these errors were encountered: