model

aims3.model.get_mode_loader(mode_format)

Get a mode loader for Grid.load_text_grid() that reads files in one of AIMS’s standard formats (see Real data for details).

Parameters

mode_format (str) –

case-insensitive insensitive format identifier; one of

  • 'simple' or 'cles'

  • 'cles_mode'

  • 'plato'

  • 'gyre'

  • 'agsm'

Returns

mode_loader – a function that takes a filename as an argument and returns a structured NumPy array with columns 'l', 'n', 'freq' and 'inertia', preferably using the dtype aims3.model.mode_dtype

Return type

function(str)

class aims3.model.Model(data, modes)

An object representing information about a single stellar model, currently comprising a single row record array data and a mode array modes.

Mode data should be sorted by (l,n) (e.g. (0,10),(0,11),(1,10),…) but the constructor doesn’t enforce this.

You can add models together or multiply them by a constant, as a convenience for the linear interpolation routines. These operations are defined so that the frequencies are interpolated as dimensionless frequencies, so the behaviour is possibly not well-defined (and not tested) for weights outside the interval (0, 1].

You can also access elements with [...] indexing in a number of ways.

  • An integer, slice, or list of integers returns the corresponding rows of the mode data.

  • A string returns either corresponding single non-seismic data value (e.g. ['R'] for radius) or that column of the mode data (e.g. ['l'] returns the angular degrees).

  • A tuple of two ints (l,n) returns the mode with the corresponding angular degree l and radial order n.

  • If not part of the data, rho returns the mean density in solar units by computing M/R**3 and logg returns the surface gravity assuming a solar value of 4.438.

  • If not part of the data, numax or nuac can be \(\nu_\mathrm{max}\) (in μHz) or \(\nu_\mathrm{ac}\) (i.e. the acoustic cutoff frequency, in μHz), both derived from scaling relations.

copy()

Return a copy of the model to avoid aliasing errors.

intersect_modes(other, assume_unique=True)

Get the indices of the modes that occur both in this model (i.e. self) and some other object other that has an attribute modes with integer columns l and n. This includes other Model objects but can also be abused to compute the intersection with other objects.

Parameters
  • other (an AIMS3 Model) – the model for which to return matching modes

  • assume_unique (bool) – if True (the default), assume there are no modes with the same n and l.

Returns

I, J – the indices of the matching modes in self and other

Return type

two arrays of ints

get_surface_correction(name, free, fixed=None)

Compute the surface correction of the kind named by name using free or fixed parameters in free or fixed. Also returns the Jacobian matrix of the frequency difference with respect to the parameters so that the parameter values can be efficiently optimised.

Parameters
  • name (str) –

    name of the surface correction to use, one of

    • '': no correction

    • 'Ball2014': the one-term (or cubic) correction by Ball & Gizon (2014)

    • 'Ball2014_2': the two-term (or combined) correction by Ball & Gizon (2014)

    • 'Kjeldsen2008'

    • 'Kjeldsen2008_scaling'

    • 'Kjeldsen2008_2'

    • 'Sonoi2015'

    • 'Sonoi2015_scaling'

    • 'Sonoi2015_2'

  • free (iterable of floats) – the free parameters for the named surface correction

  • fixed (iterable of floats) – the fixed parameter for the named surface correction

Returns

  • dfreq (array of floats) – the surface correction, which should be added to the raw model frequencies

  • J (2-d array of floats) – the Jacobian matrix of the frequency differences with respect to the free parameters

property b_Kjeldsen2008

Return the exponent for the Kjeldsen et al. (2008) surface correction based on the scaling relation by Sonoi et al. (2015).

property beta_Sonoi2015

Return the exponent for the Sonoi et al. (2015) surface correction based on the scaling relation by Sonoi et al. (2015).