name of pp variable can be provided

This commit is contained in:
Michael Krayer 2021-12-03 10:38:48 +01:00
parent 1909cd8119
commit fe004f2b38
1 changed files with 3 additions and 3 deletions

View File

@ -320,9 +320,9 @@ class Trajectories:
return self._slice(slice_part=sl[0],slice_time=sl[1])
@classmethod
def from_mat(cls,file,unraveled=False,select_col=None):
def from_mat(cls,file,unraveled=False,select_col=None,varpp='pp'):
from .helper import load_mat
pp = load_mat(file,'pp',cast_integer=False) # int casting is expensive and useless on potentially large array
pp = load_mat(file,varpp,cast_integer=False) # int casting is expensive and useless on potentially large array
col,time,ccinfo = load_mat(file,['colpy','time','ccinfo'],cast_integer=True)
period = [None,None,None]
if bool(ccinfo['xperiodic']): period[0]=ccinfo['b']
@ -608,4 +608,4 @@ def translate_circular(pp,col,translation,bounds,axis=0):
L = bounds[2*axis+1]
keys = ('x','y','z')
pp[col[keys[axis]],:,:] = (pp[col[keys[axis]],:,:]+translation)%L
return pp
return pp