ACID_code.LineList

class ACID_code.LineList(ll: dict)[source]

A class to expose the linelist when called in Data. Has validation methods and easy indexing for plotting and other uses.

ll
static validate_linelist(linelist) tuple[ndarray, ndarray][source]

Validates the linelist according to the description in Acid, and returns the linelist wavelengths and depths as numpy arrays. This is used internally in the set_linelist method.

Parameters:

linelist (str, dict, LineList, list, or np.ndarray) – See Acid.

Returns:

The validated linelist wavelengths and depths as numpy arrays.

Return type:

tuple[np.ndarray, np.ndarray]

static drop_invalid_lines(wavelengths: ACID_code.Array1D, depths: ACID_code.Array1D, return_mask: bool = False, verbose: IntLike | bool | str = None) tuple[source]

Removes NaN, non-finite, negative, and greater than 1 values from the wavelengths and depths arrays. This is used internally in the set_linelist method.

Parameters:
  • wavelengths (np.ndarray) – The array of linelist wavelengths.

  • depths (np.ndarray) – The array of linelist depths.

  • return_mask (bool, optional) – If True, also returns the boolean mask of valid lines. Default is False.

  • verbose (int, bool, or str, optional) – The verbosity level for printing warnings about dropped lines. Same format as Acid. Default is 2 as per config defaults.

Returns:

If return_mask is True, returns a tuple of (wavelengths, depths, mask). Otherwise, returns a tuple of (wavelengths, depths) with invalid lines removed.

Return type:

tuple or np.ndarray