name of pp variable can be provided
This commit is contained in:
parent
1909cd8119
commit
fe004f2b38
|
|
@ -320,9 +320,9 @@ class Trajectories:
|
||||||
return self._slice(slice_part=sl[0],slice_time=sl[1])
|
return self._slice(slice_part=sl[0],slice_time=sl[1])
|
||||||
|
|
||||||
@classmethod
|
@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
|
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)
|
col,time,ccinfo = load_mat(file,['colpy','time','ccinfo'],cast_integer=True)
|
||||||
period = [None,None,None]
|
period = [None,None,None]
|
||||||
if bool(ccinfo['xperiodic']): period[0]=ccinfo['b']
|
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]
|
L = bounds[2*axis+1]
|
||||||
keys = ('x','y','z')
|
keys = ('x','y','z')
|
||||||
pp[col[keys[axis]],:,:] = (pp[col[keys[axis]],:,:]+translation)%L
|
pp[col[keys[axis]],:,:] = (pp[col[keys[axis]],:,:]+translation)%L
|
||||||
return pp
|
return pp
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue