track
¶
-
class
aims3.track.
Track
(*args)¶ An object representing information about a sequence of
Model
s. ATrack
would be a list of Models but the overhead of having an object for each model is large enough to make us store:data
, an array of variables with one row per model;modes
, a record array of all the modes, with column names'l'
,'n'
,'freq'
and'inertia'
;and
idx
, an array ofint
s to point to where each model starts and ends inmodes
.
You can access elements with
[...]
indexing in a number of ways.An integer
n
returns the single n-th model in the track.A slice or list of integers returns a new
Track
containing the corresponding models.A string returns a list or array of the corresponding keys in each model.
A tuple of two ints
(l,n)
returns the frequency of the mode with the corresponding angular degreel
and radial ordern
, withNaN
if the model doesn’t have that mode.
A by-product of the indexing is that you can iterate over the models in a track. i.e.,
for model in track: ...
will work.A
Track
can be constructed by passing either a list ofModel
s or the arrays for thedata
,modes
and indicesidx
indicating the start and end of each model but you’ll usually obtaining a track by loading a grid.-
interpolate
(t, age_name='t', weight_tol=1e-08)¶ Interpolates a model linearly along the track at the given value of the age parameter.
- Parameters
t (float) – the value of the age parameter at which to interpolate
age_name (str) – the column name of the the age parameter (default=’t’)
weight_tol (float) – if either weight in the linear interpolation is less than
weight_tol
, treat it as zero
- Returns
model – the model interpolated at
t
- Return type