From b7b250ca5f37d7a695888cee9e77add4f9d69c38 Mon Sep 17 00:00:00 2001 From: Michael Krayer Date: Thu, 16 Dec 2021 10:26:19 +0100 Subject: [PATCH] initialize particles directly from standalone ucf file --- particle.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/particle.py b/particle.py index 5774f9c..c214e69 100644 --- a/particle.py +++ b/particle.py @@ -61,6 +61,12 @@ class Particles: for key in col: col[key]-=1 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 def from_position(cls,x,y,z,time,period):