mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 22:38:03 +00:00
fix mass dtypev2
This commit is contained in:
parent
c0947c8a4a
commit
f8756059d0
1 changed files with 3 additions and 3 deletions
|
@ -117,9 +117,9 @@ def read_sp(dtype, partfile):
|
||||||
simpath : str
|
simpath : str
|
||||||
The complete path to the CSiBORG simulation.
|
The complete path to the CSiBORG simulation.
|
||||||
"""
|
"""
|
||||||
if dtype in ["float16", "float32", "float64"]:
|
if dtype in [F16, F32, F64]:
|
||||||
return partfile.read_reals('d')
|
return partfile.read_reals('d')
|
||||||
elif dtype in ["int32", "int64"]:
|
elif dtype in [INT32]:
|
||||||
return partfile.read_ints()
|
return partfile.read_ints()
|
||||||
else:
|
else:
|
||||||
raise TypeError("Unexpected dtype `{}`.".format(dtype))
|
raise TypeError("Unexpected dtype `{}`.".format(dtype))
|
||||||
|
@ -182,7 +182,7 @@ def read_particle(pars_extract, n, simpath, verbose=True):
|
||||||
|
|
||||||
npart_tot = numpy.sum(nparts)
|
npart_tot = numpy.sum(nparts)
|
||||||
# A dummy array is necessary for reading the fortran files.
|
# 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
|
# These are the data we read along with types
|
||||||
dtype = {"names": pars_extract,
|
dtype = {"names": pars_extract,
|
||||||
"formats": [forder[fnames.index(p)][1] for p in pars_extract]}
|
"formats": [forder[fnames.index(p)][1] for p in pars_extract]}
|
||||||
|
|
Loading…
Reference in a new issue