#Purpose#

The three python scripts provided



```python
kn_calc_functions.py
get_matrixes.py
constants.py
```

can be used to compute the Love number *k* for a planet given its density profile.
The details of the calculation can be found in:

Padovan S. et al., Matrix-propagator approach to compute fluid Love numbers and applicability 
to extrasolar planets, *Astronomy & Astrophysics*, 2018. *Accepted.*

---

## Usage

In your python script or notebook insert the following line:
 

```python
import kn_calc_functions as knf
```

Given your spherically symmetric planetary interior model, 
you can obtain the Love number *k* of order *n* with the following call:


```python
kn = knf.calc_kn(n,r,d)
```
where *n* is the degree of the Love number, *r* is the array with the radius, and *d* the density.
Note that:

1.	The planet interior model is made up of a series of concentric spherical shell. Each shell has a constant density;
2.	The radial array contains the *outer* boundary of each shell, starting with the central shell. Thus, 
	the first entry is the radius of the central shell, the last the radius of the planet 
	(the radial array, thus, _must not start with 0_);
3.	Similarly, the density array is ordered from the center to the surface;
4.	The degree *n* is an integer larger or equal than 2;
5.	The value of *k* for *n=2* must be between 0 and 1.5 for gravitationally stable planets, where density 
	decreases with radius.

---

## Examples

The folder scripts/ contains a python notebook with two worked examples:

1.	The computation of the Love numbers k_n for a homogeneous planet;
2.	The retrieval of the PREM data and the computation of k_2 for the Earth.

From a terminal in the folder where you dowload the notebook and the scripts, run the command 


```shell
> jupyter notebook
```

Basic workflow in a jupyter notebook can be found, e.g., here:
https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html#executing-a-notebook
