track

class aims3.track.Track(*args)

An object representing information about a sequence of Models. A Track 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 of ints to point to where each model starts and ends in modes.

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 degree l and radial order n, with NaN 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 of Models or the arrays for the data, modes and indices idx indicating the start and end of each model but you’ll usually obtaining a track by loading a grid.

append(model)

Extend the track by the single given Model.

extend(models)

Extend the track by the given Track or list of Models.

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

Model