Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Fidle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Slim Karkar
Fidle
Commits
09dd340e
Commit
09dd340e
authored
5 years ago
by
Jean-Luc.Parouty@grenoble-inp.fr
Browse files
Options
Downloads
Patches
Plain Diff
SYNOP tests
parent
76481f3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GTSRB/07-Full-convolutions-reports.ipynb
+310
-208
310 additions, 208 deletions
GTSRB/07-Full-convolutions-reports.ipynb
SYNOP/01-Deep-weather.ipynb
+344
-0
344 additions, 0 deletions
SYNOP/01-Deep-weather.ipynb
with
654 additions
and
208 deletions
GTSRB/07-Full-convolutions-reports.ipynb
+
310
−
208
View file @
09dd340e
This diff is collapsed.
Click to expand it.
SYNOP/01-Deep-weather.ipynb
0 → 100644
+
344
−
0
View file @
09dd340e
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img width=\"800px\" src=\"../fidle/img/00-Fidle-header-01.svg\"></img>\n",
"\n",
"# <!-- TITLE --> [TIMS1] - Time serie with RNN\n",
"<!-- DESC --> Time serie prediction with RNN\n",
"<!-- AUTHOR : Jean-Luc Parouty (CNRS/SIMaP) -->\n",
"\n",
"## Objectives :\n",
" - Objectif \n",
" - Objectif_pédagogique \n",
"\n",
"\n",
"SYNOP meteorological data, available at: https://public.opendatasoft.com\n",
"\n",
"## What we're going to do :\n",
"\n",
" - Ceci\n",
" - Cela\n",
"\n",
"## Step 1 - Import and init\n",
"### 1.1 - Python"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style>\n",
"\n",
"div.warn { \n",
" background-color: #fcf2f2;\n",
" border-color: #dFb5b4;\n",
" border-left: 5px solid #dfb5b4;\n",
" padding: 0.5em;\n",
" font-weight: bold;\n",
" font-size: 1.1em;;\n",
" }\n",
"\n",
"\n",
"\n",
"div.nota { \n",
" background-color: #DAFFDE;\n",
" border-left: 5px solid #92CC99;\n",
" padding: 0.5em;\n",
" }\n",
"\n",
"div.todo:before { content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1My44OTEyIiBoZWlnaHQ9IjE0My4zOTAyIiB2aWV3Qm94PSIwIDAgNTMuODkxMiAxNDMuMzkwMiI+PHRpdGxlPjAwLUJvYi10b2RvPC90aXRsZT48cGF0aCBkPSJNMjMuNDU2OCwxMTQuMzAxNmExLjgwNjMsMS44MDYzLDAsMSwxLDEuODE1NywxLjgyNEExLjgyMDksMS44MjA5LDAsMCwxLDIzLjQ1NjgsMTE0LjMwMTZabS0xMC42NjEyLDEuODIyQTEuODI3MiwxLjgyNzIsMCwxLDAsMTAuOTgsMTE0LjMsMS44MiwxLjgyLDAsMCwwLDEyLjc5NTYsMTE2LjEyMzZabS03LjcwNyw0LjU4NzR2LTVzLjQ4NjMtOS4xMjIzLDguMDIxNS0xMS45Njc1YTE5LjIwODIsMTkuMjA4MiwwLDAsMSw2LjA0ODYtMS4yNDU0LDE5LjE3NzgsMTkuMTc3OCwwLDAsMSw2LjA0ODcsMS4yNDc1YzcuNTM1MSwyLjgzNDcsOC4wMTc0LDExLjk2NzQsOC4wMTc0LDExLjk2NzR2NS4wMjM0bC4wMDQyLDcuNjgydjIuNGMuMDE2Ny4xOTkyLjAzMzYuMzkyMS4wMzM2LjU4NzEsMCwuMjEzOC0uMDE2OC40MTA5L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OS40MTMgMzQuNzU3IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojOTk5O3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO3N0cm9rZS13aWR0aDowLjMwODg1NDQ1MDU2MDE2MThweDtmaWxsLXJ1bGU6ZXZlbm9kZCIvPjwvc3ZnPg==);\n",
" float:left;\n",
" margin-right:20px;\n",
" margin-top:-20px;\n",
" margin-bottom:20px;\n",
"}\n",
"div.todo{\n",
" font-weight: bold;\n",
" font-size: 1.1em;\n",
" margin-top:40px;\n",
"}\n",
"div.todo ul{\n",
" margin: 0.2em;\n",
"}\n",
"div.todo li{\n",
" margin-left:60px;\n",
" margin-top:0;\n",
" margin-bottom:0;\n",
"}\n",
"\n",
"\n",
"</style>\n",
"\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"FIDLE 2020 - Practical Work Module\n",
"Version : 0.4.3\n",
"Run time : Friday 28 February 2020, 22:08:24\n",
"TensorFlow version : 2.0.0\n",
"Keras version : 2.2.4-tf\n"
]
}
],
"source": [
"import tensorflow as tf\n",
"from tensorflow import keras\n",
"from tensorflow.keras.callbacks import TensorBoard\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import pandas as pd\n",
"import h5py, json\n",
"import os,time,sys\n",
"\n",
"from importlib import reload\n",
"\n",
"sys.path.append('..')\n",
"import fidle.pwk as ooo\n",
"\n",
"ooo.init()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1.2 - Where are we ? "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Well, we should be at GRICAD !\n",
"We are going to use: /bettik/PROJECTS/pr-fidle/datasets/SYNOP\n"
]
}
],
"source": [
"place, dataset_dir = ooo.good_place( { 'GRICAD' : f'{os.getenv(\"SCRATCH_DIR\",\"\")}/PROJECTS/pr-fidle/datasets/SYNOP',\n",
" 'IDRIS' : f'{os.getenv(\"WORK\",\"\")}/datasets/SYNOP',\n",
" 'HOME' : f'{os.getenv(\"HOME\",\"\")}/datasets/SYNOP'} )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 2 - Read the data"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"data_filename = 'donnees-synop-essentielles-omm-LYS.csv'\n",
"schema_filename = 'schema.json'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2.1 - Read columns code"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"with open(f'{dataset_dir}/{schema_filename}','r') as json_file:\n",
" schema = json.load(json_file)\n",
"\n",
"column_codes=list( schema['definitions']['donnees-synop-essentielles-omm_records']['properties']['fields']['properties'].keys() )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2.2 - Read data"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"#### Code - description"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"numer_sta : ID OMM station : 0\n",
"date : Date : 0\n",
"pmer : Pression au niveau mer : 17\n",
"tend : Variation de pression en 3 heures : 2\n",
"cod_tend : Type de tendance barométrique : 2\n",
"dd : Direction du vent moyen 10 mn : 3\n",
"ff : Vitesse du vent moyen 10 mn : 2\n",
"t : Température : 14\n",
"td : Point de rosée : 17\n",
"u : Humidité : 17\n",
"vv : Visibilité horizontale : 31\n",
"ww : Temps présent : 1\n",
"w1 : Temps passé 1 : 542\n",
"w2 : Temps passé 2 : 552\n",
"n : Nebulosité totale : 801\n",
"nbas : Nébulosité des nuages de l' étage inférieur : 2381\n",
"hbas : Hauteur de la base des nuages de l'étage inférieur : 8861\n",
"cl : Type des nuages de l'étage inférieur : 3377\n",
"cm : Type des nuages de l'étage moyen : 6912\n",
"ch : Type des nuages de l'étage supérieur : 8494\n",
"pres : Pression station : 0\n",
"niv_bar : Niveau barométrique : 29165\n",
"geop : Géopotentiel : 29165\n",
"tend24 : Variation de pression en 24 heures : 14443\n",
"tn12 : Température minimale sur 12 heures : 21883\n",
"tn24 : Température minimale sur 24 heures : 29165\n",
"tx12 : Température maximale sur 12 heures : 21883\n",
"tx24 : Température maximale sur 24 heures : 29165\n",
"tminsol : Température minimale du sol sur 12 heures : 27364\n",
"sw : Méthode de mesure Température du thermomètre mouillé : 29165\n",
"tw : Température du thermomètre mouillé : 29165\n",
"raf10 : Rafale sur les 10 dernières minutes : 14127\n",
"rafper : Rafales sur une période : 9\n",
"per : Periode de mesure de la rafale : 8\n",
"etat_sol : Etat du sol : 12278\n",
"ht_neige : Hauteur totale de la couche de neige, glace, autre au sol : 12083\n",
"ssfrai : Hauteur de la neige fraîche : 2914\n",
"perssfrai : Periode de mesure de la neige fraiche : 4489\n",
"rr1 : Précipitations dans la dernière heure : 95\n",
"rr3 : Précipitations dans les 3 dernières heures : 73\n",
"rr6 : Précipitations dans les 6 dernières heures : 10869\n",
"rr12 : Précipitations dans les 12 dernières heures : 10919\n",
"rr24 : Précipitations dans les 24 dernières heures : 12730\n",
"phenspe1 : Phénomène spécial 1 : 14818\n",
"phenspe2 : Phénomène spécial 2 : 14826\n",
"phenspe3 : Phénomène spécial 3 : 15515\n",
"phenspe4 : Phénomène spécial 4 : 28869\n",
"nnuage1 : Nébulosité couche nuageuse 1 : 4753\n",
"ctype1 : Type nuage 1 : 5699\n",
"hnuage1 : Hauteur de base 1 : 5439\n",
"nnuage2 : Nébulosité couche nuageuse 2 : 16112\n",
"ctype2 : Type nuage 2 : 16643\n",
"hnuage2 : Hauteur de base 2 : 16317\n",
"nnuage3 : Nébulosité couche nuageuse 3 : 25387\n",
"ctype3 : Type nuage 3 : 25642\n",
"hnuage3 : Hauteur de base 3 : 25431\n",
"nnuage4 : Nébulosité couche nuageuse 4 : 28850\n",
"ctype4 : Type nuage 4 : 28780\n",
"hnuage4 : Hauteur de base 4 : 28850\n",
"coordonnees : Coordonnees : 0\n",
"nom : Nom : 0\n",
"type_de_tendance_barometrique : Type de tendance barométrique.1 : 2\n",
"temps_passe_1 : Temps passé 1.1 : 542\n",
"temps_present : Temps présent.1 : 1\n",
"tc : Température (°C) : 14\n",
"tn12c : Température minimale sur 12 heures (°C) : 21883\n",
"tn24c : Température minimale sur 24 heures (°C) : 29165\n",
"tx12c : Température maximale sur 12 heures (°C) : 21883\n",
"tx24c : Température maximale sur 24 heures (°C) : 29165\n",
"tminsolc : Température minimale du sol sur 12 heures (en °C) : 27364\n",
"altitude : Altitude : 0\n",
"longitude : Longitude : 0\n",
"latitude : Latitude : 0\n",
"libgeo : communes (name) : 0\n",
"codegeo : communes (code) : 0\n",
"nom_epci : EPCI (name) : 0\n",
"code_epci : EPCI (code) : 0\n",
"nom_dept : department (name) : 0\n",
"code_dep : department (code) : 0\n",
"nom_reg : region (name) : 0\n",
"code_reg : region (code) : 0\n",
"Données manquantes : 805133 Shape is : (29165, 81)\n"
]
}
],
"source": [
"df = pd.read_csv(f'{dataset_dir}/{data_filename}', header=0, sep=';')\n",
"\n",
"columns_desc = list(df.columns)\n",
"code2desc = dict(zip(column_codes, columns_desc))\n",
"df.columns = column_codes\n",
"\n",
"ooo.display_md('#### Code - description')\n",
"i=0\n",
"for code,desc in code2desc.items():\n",
" na = df[code].isna().sum()\n",
" print(f'{code:24} : {desc:60} : {na}')\n",
"\n",
"\n",
"# display(data.head(5))\n",
"print('Données manquantes : ',data.isna().sum().sum(), ' Shape is : ', data.shape)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"<img width=\"80px\" src=\"../fidle/img/00-Fidle-logo-01.svg\"></img>"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
%% Cell type:markdown id: tags:
<img
width=
"800px"
src=
"../fidle/img/00-Fidle-header-01.svg"
></img>
# <!-- TITLE --> [TIMS1] - Time serie with RNN
<!-- DESC -->
Time serie prediction with RNN
<!-- AUTHOR : Jean-Luc Parouty (CNRS/SIMaP) -->
## Objectives :
-
Objectif
-
Objectif_pédagogique
SYNOP meteorological data, available at: https://public.opendatasoft.com
## What we're going to do :
-
Ceci
-
Cela
## Step 1 - Import and init
### 1.1 - Python
%% Cell type:code id: tags:
```
python
import
tensorflow
as
tf
from
tensorflow
import
keras
from
tensorflow.keras.callbacks
import
TensorBoard
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
import
h5py
,
json
import
os
,
time
,
sys
from
importlib
import
reload
sys
.
path
.
append
(
'
..
'
)
import
fidle.pwk
as
ooo
ooo
.
init
()
```
%% Output
FIDLE 2020 - Practical Work Module
Version : 0.4.3
Run time : Friday 28 February 2020, 22:08:24
TensorFlow version : 2.0.0
Keras version : 2.2.4-tf
%% Cell type:markdown id: tags:
### 1.2 - Where are we ?
%% Cell type:code id: tags:
```
python
place
,
dataset_dir
=
ooo
.
good_place
(
{
'
GRICAD
'
:
f
'
{
os
.
getenv
(
"
SCRATCH_DIR
"
,
""
)
}
/PROJECTS/pr-fidle/datasets/SYNOP
'
,
'
IDRIS
'
:
f
'
{
os
.
getenv
(
"
WORK
"
,
""
)
}
/datasets/SYNOP
'
,
'
HOME
'
:
f
'
{
os
.
getenv
(
"
HOME
"
,
""
)
}
/datasets/SYNOP
'
}
)
```
%% Output
Well, we should be at GRICAD !
We are going to use: /bettik/PROJECTS/pr-fidle/datasets/SYNOP
%% Cell type:markdown id: tags:
## Step 2 - Read the data
%% Cell type:code id: tags:
```
python
data_filename
=
'
donnees-synop-essentielles-omm-LYS.csv
'
schema_filename
=
'
schema.json
'
```
%% Cell type:markdown id: tags:
### 2.1 - Read columns code
%% Cell type:code id: tags:
```
python
with
open
(
f
'
{
dataset_dir
}
/
{
schema_filename
}
'
,
'
r
'
)
as
json_file
:
schema
=
json
.
load
(
json_file
)
column_codes
=
list
(
schema
[
'
definitions
'
][
'
donnees-synop-essentielles-omm_records
'
][
'
properties
'
][
'
fields
'
][
'
properties
'
].
keys
()
)
```
%% Cell type:markdown id: tags:
### 2.2 - Read data
%% Cell type:code id: tags:
```
python
df
=
pd
.
read_csv
(
f
'
{
dataset_dir
}
/
{
data_filename
}
'
,
header
=
0
,
sep
=
'
;
'
)
columns_desc
=
list
(
df
.
columns
)
code2desc
=
dict
(
zip
(
column_codes
,
columns_desc
))
df
.
columns
=
column_codes
ooo
.
display_md
(
'
#### Code - description
'
)
i
=
0
for
code
,
desc
in
code2desc
.
items
():
na
=
df
[
code
].
isna
().
sum
()
print
(
f
'
{
code
:
24
}
:
{
desc
:
60
}
:
{
na
}
'
)
# display(data.head(5))
print
(
'
Données manquantes :
'
,
data
.
isna
().
sum
().
sum
(),
'
Shape is :
'
,
data
.
shape
)
```
%% Output
#### Code - description
numer_sta : ID OMM station : 0
date : Date : 0
pmer : Pression au niveau mer : 17
tend : Variation de pression en 3 heures : 2
cod_tend : Type de tendance barométrique : 2
dd : Direction du vent moyen 10 mn : 3
ff : Vitesse du vent moyen 10 mn : 2
t : Température : 14
td : Point de rosée : 17
u : Humidité : 17
vv : Visibilité horizontale : 31
ww : Temps présent : 1
w1 : Temps passé 1 : 542
w2 : Temps passé 2 : 552
n : Nebulosité totale : 801
nbas : Nébulosité des nuages de l' étage inférieur : 2381
hbas : Hauteur de la base des nuages de l'étage inférieur : 8861
cl : Type des nuages de l'étage inférieur : 3377
cm : Type des nuages de l'étage moyen : 6912
ch : Type des nuages de l'étage supérieur : 8494
pres : Pression station : 0
niv_bar : Niveau barométrique : 29165
geop : Géopotentiel : 29165
tend24 : Variation de pression en 24 heures : 14443
tn12 : Température minimale sur 12 heures : 21883
tn24 : Température minimale sur 24 heures : 29165
tx12 : Température maximale sur 12 heures : 21883
tx24 : Température maximale sur 24 heures : 29165
tminsol : Température minimale du sol sur 12 heures : 27364
sw : Méthode de mesure Température du thermomètre mouillé : 29165
tw : Température du thermomètre mouillé : 29165
raf10 : Rafale sur les 10 dernières minutes : 14127
rafper : Rafales sur une période : 9
per : Periode de mesure de la rafale : 8
etat_sol : Etat du sol : 12278
ht_neige : Hauteur totale de la couche de neige, glace, autre au sol : 12083
ssfrai : Hauteur de la neige fraîche : 2914
perssfrai : Periode de mesure de la neige fraiche : 4489
rr1 : Précipitations dans la dernière heure : 95
rr3 : Précipitations dans les 3 dernières heures : 73
rr6 : Précipitations dans les 6 dernières heures : 10869
rr12 : Précipitations dans les 12 dernières heures : 10919
rr24 : Précipitations dans les 24 dernières heures : 12730
phenspe1 : Phénomène spécial 1 : 14818
phenspe2 : Phénomène spécial 2 : 14826
phenspe3 : Phénomène spécial 3 : 15515
phenspe4 : Phénomène spécial 4 : 28869
nnuage1 : Nébulosité couche nuageuse 1 : 4753
ctype1 : Type nuage 1 : 5699
hnuage1 : Hauteur de base 1 : 5439
nnuage2 : Nébulosité couche nuageuse 2 : 16112
ctype2 : Type nuage 2 : 16643
hnuage2 : Hauteur de base 2 : 16317
nnuage3 : Nébulosité couche nuageuse 3 : 25387
ctype3 : Type nuage 3 : 25642
hnuage3 : Hauteur de base 3 : 25431
nnuage4 : Nébulosité couche nuageuse 4 : 28850
ctype4 : Type nuage 4 : 28780
hnuage4 : Hauteur de base 4 : 28850
coordonnees : Coordonnees : 0
nom : Nom : 0
type_de_tendance_barometrique : Type de tendance barométrique.1 : 2
temps_passe_1 : Temps passé 1.1 : 542
temps_present : Temps présent.1 : 1
tc : Température (°C) : 14
tn12c : Température minimale sur 12 heures (°C) : 21883
tn24c : Température minimale sur 24 heures (°C) : 29165
tx12c : Température maximale sur 12 heures (°C) : 21883
tx24c : Température maximale sur 24 heures (°C) : 29165
tminsolc : Température minimale du sol sur 12 heures (en °C) : 27364
altitude : Altitude : 0
longitude : Longitude : 0
latitude : Latitude : 0
libgeo : communes (name) : 0
codegeo : communes (code) : 0
nom_epci : EPCI (name) : 0
code_epci : EPCI (code) : 0
nom_dept : department (name) : 0
code_dep : department (code) : 0
nom_reg : region (name) : 0
code_reg : region (code) : 0
Données manquantes : 805133 Shape is : (29165, 81)
%% Cell type:markdown id: tags:
---
<img
width=
"80px"
src=
"../fidle/img/00-Fidle-logo-01.svg"
></img>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment