fix mass dtypev2

This commit is contained in:
rstiskalek 2022-10-11 13:46:57 +01:00
parent c0947c8a4a
commit f8756059d0

View file

@ -117,9 +117,9 @@ def read_sp(dtype, partfile):
simpath : str
The complete path to the CSiBORG simulation.
"""
if dtype in ["float16", "float32", "float64"]:
if dtype in [F16, F32, F64]:
return partfile.read_reals('d')
elif dtype in ["int32", "int64"]:
elif dtype in [INT32]:
return partfile.read_ints()
else:
raise TypeError("Unexpected dtype `{}`.".format(dtype))
@ -182,7 +182,7 @@ def read_particle(pars_extract, n, simpath, verbose=True):
npart_tot = numpy.sum(nparts)
# A dummy array is necessary for reading the fortran files.
dum = numpy.full(npart_tot, numpy.nan, dtype="float16")
dum = numpy.full(npart_tot, numpy.nan, dtype=F16)
# These are the data we read along with types
dtype = {"names": pars_extract,
"formats": [forder[fnames.index(p)][1] for p in pars_extract]}