asap - Assisted Scattering Angle Interpolation model

class runmacs.spec.retrieval.cloudside.asap.LUTInterpolator(bins)[source]

Linear interpolation in multidimensional Look-Up Table

Parameters:bins – Sequence of number of bins for each dimension of the LUT.
locate_in_lut(fields)[source]

Find location in LUT according to the interpolation options.

In the following, N is the number of dimensions in the LUT.

Parameters:fields – N-element sequence of positions along LUT axes to search for. Each element of the sequence can either be a number or an arbitrary dimensional numpy array. If they are numpy arrays, the results will have the axes of these arrays as additional axes (according to numpy broadcasting rules).
Returns:2-tuple containing indexes and weights.
  • The 0th axis of indexes will specify the LUT-dimension.
  • The axes 1…N axes of indexes specify multiple samples to take from the LUT in order to interpolate later.
  • The axes 0…N-1 of weights contain the interpolation weights for the samples taken with indexes.
  • The following axes are the sames as from the input.

This method can be used as follows (assuming 2D LUT):

indexes, weights = interpolator.locate_in_lut([1.7, 4.2])
result = lut.get_from_lut(*indexes)
result_interpolated = np.einsum('ij...,ij...->...', result, weights)

result_interpolated will now contain the interpolated value at the location \((1.7, 4.2)\) of the Look-Up Table.

The interpolator can also be used with less dimensions than the dimension of the LUT. Naturally, the result of the lookup will be an array containing the remaining dimensions. The user will be responsible to add missing axes for the einsum above as needed.

setup(**kwargs)[source]

Setup of interpolation options.

The arguments have to be a sequene of values. Each sequence must contain one value for each LUT dimension.

Parameters:
  • outliers – If True: look-ups outside of the table will be extrapolated. Values will be set to NAN otherwise. Default is False.
  • interpol – If True: interpolate, if False: use nearest neighbor. Default is True.
class runmacs.spec.retrieval.cloudside.asap.MYSTICrun[source]

Class describing MYSTIC output with auxiliary information

calc_aux()[source]

Read MYSTIC Output