initialize particles directly from standalone ucf file

This commit is contained in:
Michael Krayer 2021-12-16 10:26:19 +01:00
parent 2465e10b70
commit b7b250ca5f
1 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,12 @@ class Particles:
col[key]-=1 col[key]-=1
return cls.from_array(pp,col,time,period,select_col=select_col) return cls.from_array(pp,col,time,period,select_col=select_col)
@classmethod
def from_ucf(cls,file,period,select_col=None):
from .ucf import read_particles
(pp,col,time) = read_particles(file,step=1,verbosity=False,debug=False)
return cls.from_array(pp,col,time,period,select_col=select_col)
@classmethod @classmethod
def from_position(cls,x,y,z,time,period): def from_position(cls,x,y,z,time,period):
assert x.ndim==1 and y.ndim==1 and z.ndim==1,\ assert x.ndim==1 and y.ndim==1 and z.ndim==1,\