mon premier essai Jupyter

parent e391755a
{ {
"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": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3",
...@@ -16,10 +97,9 @@ ...@@ -16,10 +97,9 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.3" "version": "3.6.4"
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 2
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment