forked from illustristng/illustris_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.py
More file actions
22 lines (19 loc) · 868 Bytes
/
util.py
File metadata and controls
22 lines (19 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
""" Illustris Simulation: Public Data Release.
util.py: Various helper functions. """
def partTypeNum(partType):
""" Mapping between common names and numeric particle types. """
if str(partType).isdigit():
return int(partType)
if str(partType).lower() in ['gas','cells']:
return 0
if str(partType).lower() in ['dm','darkmatter']:
return 1
if str(partType).lower() in ['tracer','tracers','tracermc','trmc']:
return 3
if str(partType).lower() in ['star','stars','stellar']:
return 4 # only those with GFM_StellarFormationTime>0
if str(partType).lower() in ['wind']:
return 4 # only those with GFM_StellarFormationTime<0
if str(partType).lower() in ['bh','bhs','blackhole','blackholes']:
return 5
raise Exception("Unknown particle type name.")