Package SloppyCell :: Package ReactionNetworks :: Module Trajectory_mod :: Class Trajectory
[hide private]

Class Trajectory

source code

Instance Methods [hide private]
 
__init__(self, net, key_column=None, is_sens=False, holds_dt=False, empty=False, const_vals=None) source code
 
__len__(self) source code
 
__getitem__(self, this_slice) source code
 
time_slice(self, start, stop, eps=1e-6)
Return a new trajectory containing only times from start to stop.
source code
 
keys(self) source code
 
get_times(self) source code
 
add_event_info(self, net, eventinfo, time_traj_ended, include_extra_event_info=False)
Add information about the network state at each event execution
source code
 
append(self, other) source code
 
get_var_typical_val(self, id) source code
 
get_var_traj(self, id) source code
 
_get_time_index(self, time, eps=1e-6)
Return the index of the stored value closest to the requested time.
source code
 
get_var_vals(self, time, eps=1e-6)
Return a KeyedList of the values of the trajectory's variables at the given time.
source code
 
get_var_val(self, var_id, time, eps=1e-6)
Return the value of the given variable at the given time.
source code
 
get_var_vals_index(self, index)
Return a KeyedList of the values of the trajectory's variables at the given index.
source code
 
get_var_val_index(self, var_id, index)
Return the value of the given variable at the given index.
source code
 
get_dynvar_vals_index(self, index)
Return a KeyedList of the values of the trajectory's dynamic variables at the given index.
source code
 
get_dynvar_vals(self, time, eps=1e-6)
Return a KeyedList of the values of the trajectory's dynamic variables at the given time.
source code
 
_make__assignment(self, net) source code
 
_make__sens_assignment(self, net) source code
 
appendFromODEINT(self, timepoints, odeint_array, holds_dt=False) source code
 
appendSensFromODEINT(self, timepoints, odeint_array, holds_dt=False) source code
 
copy_subset(self, keys=None)
Return a copy of this trajectory containing only the variables specified in keys.
source code
 
__getstate__(self) source code
 
__setstate__(self, newdict) source code
 
_sub_var_names(self, input) source code
 
build_interpolated_traj(self)
Given that a trajectory exists, build_interpolated_traj will create the coefficients for the spline interpolatation.
source code
 
evaluate_interpolated_trajs(self, time, subinterval, der=0)
This is a version of evaluate_interpolated_traj that returns all the...
source code
 
evaluate_interpolated_traj(self, dv_id, time, subinterval=None, der=0)
Needs Trajectory.build_interpolated_traj() to be called first
source code
 
to_file(self, file_name, out_vars=None, separator=', ')
Output the given variables to a file.
source code
 
last_dynamic_var_values(self)
Return a list of the dynamic variable values at the last timepoint in the trajectory.
source code
 
getVariableTrajectory(self, id) source code
Class Variables [hide private]
  _known_structures = []
  _known_function_bodies = []
  _dynamic_funcs = ['_assignment', '_sens_assignment']
  _common_namespace = {'log': scipy.log, 'log10': scipy.log10, '...

Imports: psyco


Method Details [hide private]

_get_time_index(self, time, eps=1e-6)

source code 

Return the index of the stored value closest to the requested time.

Prints a warning if the difference between the requested time and the
stored time is greater than a fraction eps of the trajectory length.

get_var_vals(self, time, eps=1e-6)

source code 

Return a KeyedList of the values of the trajectory's variables at the
given time.

Prints a warning if the difference between the requested time and the
stored time is greater than a fraction eps of the trajectory length.

get_var_val(self, var_id, time, eps=1e-6)

source code 

Return the value of the given variable at the given time.

Prints a warning if the difference between the requested time and the
stored time is greater than a fraction eps of the trajectory length.

get_dynvar_vals(self, time, eps=1e-6)

source code 

Return a KeyedList of the values of the trajectory's dynamic variables
at the given time.

Prints a warning if the difference between the requested time and the
stored time is greater than a fraction eps of the trajectory length.

copy_subset(self, keys=None)

source code 

Return a copy of this trajectory containing only the variables specified
in keys.

If keys is None, all variables are included.

build_interpolated_traj(self)

source code 
Given that a trajectory exists, build_interpolated_traj will create 
the coefficients for the spline interpolatation.
The spline can then be evaluated using 
Trajectory.evaluate_interpolated_traj or
Trajectory.evaluate_interpolated_trajs 

evaluate_interpolated_trajs(self, time, subinterval, der=0)

source code 

This is a version of evaluate_interpolated_traj that returns all the
values of the dynamic variables and requires you to pass in the
appropriate subinterval between events (that can be found in 
Trajectory.tcks.keys() )
Faster than calling evaluate_interpolated_traj repeatedly

evaluate_interpolated_traj(self, dv_id, time, subinterval=None, der=0)

source code 
Needs Trajectory.build_interpolated_traj() to be called first

Arguments:
dvid         the name of the component of the trajectory you wish to 
             evaluate
time         a vector of times or a scalar
subinterval  an optional argument specifying the time interval 
             between events that the time argument lies (but given a 
             valid time, it will be found automatically)
der          the derivative of the spline function you want, the order
             of the derivative will be constrained by the order of the 
             interpolated spline
Outputs:
A single scalar value (if time input is a scalar)
or
(returned_times, interpolated_trajectory at those times) if times is a
vector

Note: It is necessary to have a returned_times argument too, in case 
      the times passed in happens to have a timepoint that corresponds 
      to an event time, which often has two trajectory values associated
      with it.

to_file(self, file_name, out_vars=None, separator=', ')

source code 

Output the given variables to a file.

file_name   Name of the file to use for output (will be overwritten!)
out_vars    List of variable ids ot output. If None, default is
            'time', dynamic variables
separator   The separator to use between columns.


Class Variable Details [hide private]

_common_namespace

Value:
{'log': scipy.log, 'log10': scipy.log10, 'exp': scipy.exp, 'cos': scip\
y.cos, 'sin': scipy.sin, 'tan': scipy.tan, 'acos': scipy.arccos, 'asin\
': scipy.arcsin, 'atan': scipy.arctan, 'cosh': scipy.cosh, 'sinh': sci\
py.sinh, 'tanh': scipy.tanh, 'arccosh': scipy.arccosh, 'arcsinh': scip\
y.arcsinh, 'arctanh': scipy.arctanh, 'pow': scipy.power, 'sqrt': scipy\
.sqrt, 'exponentiale': scipy.e, 'pi': scipy.pi,}