diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index 0bbbe371b01e359e381e43239412d77bf53fb1fb..e9dd4bf9bc661e0507bbe65a4c089f5b1de8f64d 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -1,5 +1,86 @@ { - "cells": [], + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Un nouveau document, base sur mes calculs en *line tracing*" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction\n", + "Je commence déjà par charger les bibliothèques nécessaires. Je définis également un certain nombre de fonction qui seront utiles pour la suite des calculs et des rendus." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import sys\n", + "import os\n", + "\n", + "pi = np.pi" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "def centrifugal_lat(r,t,p):\n", + " # ----------------------------------------------\n", + " # Centrifugal latitude in Jovian magnetosphere\n", + " # coefficient from Phipps & Bagenal (2021)\n", + " #\n", + " # Input : \n", + " # R [Rj]\n", + " # theta (colatitude) [°]\n", + " # phi (longitude in S3RH) [°]\n", + " # ----------------------------------------------\n", + " a = 1.66 # [°]\n", + " b = 0.131 # \n", + " c = 1.62\n", + " d = 7.76 # [°]\n", + " e = 249 # [°]\n", + " cent_eq = (a*np.tanh(b*r-c)+d) * (np.sin(np.radians(p-e)))\n", + " \n", + " jov_lat = 90 - t\n", + " cent_lat = jov_lat - cent_eq\n", + " \n", + " return cent_lat\n", + "\n", + "def extractfilelines(filename: str, titlemarker=\"#\"):\n", + " # -----------------------------------------------\n", + " # This function converts a text file (at location specified by filename)\n", + " # into a list of its lines in text format\n", + " # -----------------------------------------------\n", + " with open(filename, \"r\") as f:\n", + " # read title\n", + " line = f.readline()\n", + " while line.startswith(titlemarker):\n", + " line = f.readline()\n", + "\n", + " lines = [line] + f.readlines()\n", + "\n", + " return lines" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], "metadata": { "kernelspec": { "display_name": "Python 3", @@ -16,10 +97,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.3" + "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 2 } -