Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
theme: jekyll-theme-cayman
title: [MNHPy]
description: [Gallery from MNHPy library.]
42 changes: 42 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset="UTF-8">

{% seo %}
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap" as="style" type="text/css" crossorigin>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
{% include head-custom.html %}
</head>
<body>
<a id="skip-to-content" href="#content">Skip to the content.</a>

<header class="page-header" role="banner">
<h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
<h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
<a href="/{{ site.github.repository_name }}" class="btn">Home</a>
{% if site.github.is_project_page %}
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
{% endif %}
{% if site.show_downloads %}
<a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
<a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
{% endif %}
</header>

<main id="content" class="main-content" role="main">
{{ content }}

<footer class="site-footer">
{% if site.github.is_project_page %}
<span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
{% endif %}
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</main>
</body>
</html>
Binary file added gallery/figures/3D_mayavi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/XY_budget_terms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/XY_lines_001_2Drelief.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/XY_multisimple_GABLS1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/histogramm_009ICARTT_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/horizontal_oasis_coupling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/sectionH_004_Reunion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/sectionH_2dom_front_AZF_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/sectionH_OCEAN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/sectionV_KW78_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/sectionV_Reunion_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/figures/timeseries_FIRE_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions gallery/view/3D_mayavi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## Plot 2

![3D_mayavi.png](../figures/3D_mayavi.png)

````python
# --------------------------------------------------------
#
# G. Feger ( 06/02/2024 )
#
# ~~~~~~~~~~~~~~~
# Script used to visualize aerosol cloud interaction
# in the case of a dusty Saharan Air Layer at Cape Verde
# ~~~~~~~~~~~~~~~
#
# --------------------------------------------------------

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import matplotlib as mpl ; import matplotlib.pyplot as plt
from matplotlib import cm ; from matplotlib.colors import ListedColormap
import numpy as np ; import pandas as pd
import cartopy ; import cartopy.feature as cfeature
import xarray as xr ; import math ; import numpy.ma as ma
import datetime ; from netCDF4 import Dataset
import cftime ; import os
import datetime ; import cartopy.crs as ccrs
import scipy ; from scipy.stats import gmean
import fct ; from scipy.interpolate import interpn
import PyQt5 ; import mayavi ; from mayavi import mlab
import metpy ; import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.interpolate import cross_section
from mpl_toolkits.basemap import Basemap, shiftgrid
import pandas as pd
from IPython.display import display, HTML
display(HTML("<style>.container { width:80% !important; }</style>"))

# MAYAVI 3D plot
%gui qt
# lecture fichier méso-nh
def process_data(directory, pattern, endwith):
nc_files = [os.path.join(directory, filename) for filename in os.listdir(directory) if filename.endswith(endwith) and filename.startswith(pattern)]
datasets = [xr.open_mfdataset(file,combine='by_coords') for file in nc_files]
ho = xr.concat(datasets, dim='time', join='override')
ho = ho.sortby('time')
ho = ho.assign_coords(nj=('nj', ho.latitude[:,0].values), ni=('ni', ho.longitude[0,:].values), nj_u=('nj_u', ho.latitude[:,0].values), ni_u=('ni_u', ho.longitude[0,:].values)).rename({'ni': 'lon', 'nj': 'lat', 'ni_u': 'lon_u', 'nj_u': 'lat_u'})
return ho
m1 = process_data('.' , 'CMS01.1.SEG01.OUT.012', '.nc')
pgd = process_data('.' , 'AFCAV', '.nc')

# prepare le domaine 3d
step = 0
lon = m1.lon.values
lat = m1.lat.values
alt = m1.level_w.values/1000 # en km
topo = pgd.CLAY[0,:,:].values/1000
Z_plot = 10 # Z_plot = alt[-1] si on veut visu tout le domaine sans zoomer
alt_reg = np.linspace(0,Z_plot,101) # altitude dz fixe pour interpolation et plot
x, y, z = np.meshgrid(lon, lat, alt_reg, indexing='ij') # grille 3D : dx dy dz constant
# selection des variables
var1 = m1.WT[step, :, :,:].values
var2 = m1.NIF01[step, :, :,:].values
var1 = np.transpose(var1, (2, 1, 0)) # Z en 3e position
var2 = np.transpose(var2, (2, 1, 0)) # Z en 3e position
var1 = interpn((lon, lat, alt), var1, (x, y, z), method='linear', bounds_error=False, fill_value=0) # interp variables sur domaine régulier
var2 = interpn((lon, lat, alt), var2, (x, y, z), method='linear', bounds_error=False, fill_value=0)

# -- Figure --
fig = mlab.figure(bgcolor=(1,1,1), fgcolor=(0.,0.,0.))
ratio=2
pltextent = (lon[0], lon[-1], lat[0], lat[-1], alt[0]/ratio, Z_plot/ratio) # rapport d'aspect de la fig pour lisibilité
contour1 = mlab.contour3d(x,y,z/ratio,var1, vmin=2, vmax=10 , contours=[2,5,10], transparent=True,opacity=0.7)
contour2 = mlab.contour3d(x,y,z/ratio,var2, vmin=20,vmax=40, contours=[20,30,40], transparent=False,opacity=0.99,colormap='Reds')
mlab.imshow(topo.T, colormap='gist_gray',figure=fig, extent=[lon[0], lon[-1], lat[0], lat[-1], alt[0]/ratio, alt[1]/ratio], opacity=0.5)
#mlab.surf(lon, lat, topo.T/ratio, colormap='gist_gray',figure=fig,opacity=0.7, vmin=alt[0]/ratio)
# setup figure
mlab.outline(contour1, color=(.1, .7, .7), extent=pltextent)
mlab.axes(xlabel='Lon', ylabel='Lat', zlabel='Alt (km)')
mlab.axes(nb_labels=5,ranges=(lon[0], lon[-1], lat[0], lat[-1], alt[0], Z_plot)) # valeurs reelles des coordonnees
mlab.gcf().scene.parallel_projection = True
mlab.orientation_axes()
mlab.colorbar(object=contour2, nb_colors=3, nb_labels=3, orientation='vertical', title='IFN FREE (#/cm3)')
mlab.title('Simulation Méso-NH', line_width=2.0, size=4, figure=fig)
mlab.text3d(lon[-104],lat[-44],alt[26]/ratio, 'Saharan air layer', scale=0.4, color=(0.6,0,0.3))
````
49 changes: 49 additions & 0 deletions gallery/view/XY_budget_terms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Plot 2

![XY_budget_terms.png](../figures/XY_budget_terms.png)

````python
Panel = PanelPlot(2,2, [20,20],'COPT81 avec Mask', titlepad=11, minmaxpad=1.04, timepad=-0.07, colorbarpad=0.03, labelcolorbarpad = 13, colorbaraspect=40)

# Budget of potential temperature
nmask=0 #Convective mask, criteria in set_mask.f90
ntime=7 # 8th hour

Lplot = [Dvar['f1'][('/Budgets/TH','SFR')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','DEPS')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','DEPG')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','REVA')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','DEPI')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','IMLT')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','GMLT')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','DRYG')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','ACC')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','RIM')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','BERFI')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','CFRZ')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','WETG')][nmask,ntime,:]
]
LaxeZ = [Dvar['f1']['mask_level']]*len(Lplot)
Ltitle = ['Bilan température potentielle : partie convective - MASK1']*len(Lplot)
Llinelabel = ['SFR','DEPS','DEPG','REVA','DEPI','IMLT','GMLT','DRYG','ACC','RIM','BERFI','CFRZ','WETG']
Lxlim = [(-0.7E-2, 0.7E-2)]*len(Lplot)
Lxlab = ['Terme du bilan (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,12000.0)]*len(Lplot)
LaxisColor = ['black']*len(Lplot)
Llinewidth = [3]*len(Lplot)
LfacconvX=[1]*len(Lplot)
Llinecolor = ['red','green','blue','cyan','indigo','bisque','brown','orange','yellow',
'magenta','gray','lightblue','black']

fig = Panel.pXY_lines(Lxx=Lplot, Lyy=LaxeZ, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Llinewidth=Llinewidth, LfacconvX=LfacconvX,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor,
ax=fig.axes)

nmask=1 #Convective mask, criteria in set_mask.f90
Lplot = [Dvar['f1'][('/Budgets/TH','SFR')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','DEPS')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','DEPG')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','REVA')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','DEPI')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','IMLT')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','GMLT')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','DRYG')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','ACC')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','RIM')][nmask,ntime,:],
Dvar['f1'][('/Budgets/TH','BERFI')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','CFRZ')][nmask,ntime,:], Dvar['f1'][('/Budgets/TH','WETG')][nmask,ntime,:]
]
Lxlim = [(-0.7E-3, 0.7E-3)]*len(Lplot)
Ltitle = ['Bilan température potentielle : partie stratiforme - MASK2']*len(Lplot)

fig = Panel.pXY_lines(Lxx=Lplot, Lyy=LaxeZ, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Llinewidth=Llinewidth, LfacconvX=LfacconvX,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor,
ax=fig.axes)
Panel.save_graph(1,fig)
````
35 changes: 35 additions & 0 deletions gallery/view/XY_lines_001_2Drelief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Plot 2

![XY_lines_001_2Drelief.png](../figures/XY_lines_001_2Drelief.png)

````python
Panel6 = PanelPlot(2,2, [20,20],'Profiles at the center (top of the topography)')

Lplot = [ Dvar['f1']['WT'][:,127]]
LaxeZ = [Dvar['f1']['altitude'][:,127]]*len(Lplot)
Ltitle = ['WT and THT-LSTHM']*len(Lplot)
Llinelabel = ['WT']
Lxlab = ['velocity (m/s)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.3,0.3)]
Llinecolor = ['r']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
Ltime = [Dvar['f1']['time']]
fig6 = Panel6.pXY_lines(Lyy=LaxeZ, Lxx=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel,
Llinecolor=Llinecolor, LaxisColor=LaxisColor, Ltime=Ltime)

Lplot = [ Dvar['f1']['THT-LSTHM'][:,127]]
Ltitle = []
Llinelabel = ['THT - LSTHM ']
Lxlab = ['theta perturb (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,15000.1)]*len(Lplot)
Lxlim = [(-0.8,0.1)]
Llinecolor = ['g']
LaxisColor = Llinecolor
Llvl = [0]*len(Lplot)
fig7 = Panel6.pXY_lines(Lyy=LaxeZ, Lxx=Lplot, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle,ax=fig6.axes, id_overlap=1,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor, Ltime=Ltime)
````
61 changes: 61 additions & 0 deletions gallery/view/XY_lines_tseries_aircraft_AZF2M.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Plot 2

![XY_lines_tseries_aircraft_AZF2M.png](../figures/XY_lines_tseries_aircraft_AZF2M.png)

````python
Panel = PanelPlot(8,2, [14,20],'Time series from Aircraft', titlepad=25, minmaxpad=1.04, timepad=-0.07, colorbarpad=0.03, labelcolorbarpad = 13, colorbaraspect=18)

Lplot = [ Dvar['f13'][(LG_AVIONT,'ZS')]]
Ltime = [Dvar['f13'][(LG_AVION,'time_flyer')]/3600.0]
Ltitle = ['Orography']
Lxlab = ['Time (h)']
Lylab = ['ZS (m)']
Lylim = [(0, 350)]
Lxlim = [(9.0, 9.2)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim)

Lplot = [ Dvar['f13'][(LG_AVIONT,'P')]]
Ltitle = ['Pressure']
Lylab = ['P (Pa)']
Lylim = [(0, 95000)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

Lplot = [ Dvar['f13'][(LG_AVIONT,'LON')]]
Ltitle = ['Longitude']
Lylab = ['Longitude']
Lylim = [(0, 2.5)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

Lplot = [ Dvar['f13'][(LG_AVIONT,'ZON_WIND')]]
Ltitle = ['Zonal wind']
Lylab = ['u (m/s)']
Lylim = [(-1, 11)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

Lplot = [ Dvar['f13'][(LG_AVIONT,'MER_WIND')]]
Ltitle = ['Meridional wind']
Lylab = ['v (m/s)']
Lylim = [(-3, 3)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

Lplot = [ Dvar['f13'][(LG_AVIONT,'W')]]
Ltitle = ['Vertical velocity']
Lylab = ['w (m/s)']
Lylim = [(-0.1, 0.1)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

Lplot = [ Dvar['f13'][(LG_AVIONT,'Th')]]
Ltitle = ['Potential Temperature']
Lylab = [r'$\theta$ (K)']
Lylim = [(290, 305)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

Lplot = [ Dvar['f13'][(LG_AVIONT,'Rv')]]
Ltitle = ['Water vapor mixing ratio']
Lylab = ['Rv (kg/kg))']
Lylim = [(0, 0.01)]
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=Ltime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Lylim=Lylim, Lxlim=Lxlim, ax=fig.axes)

fig.tight_layout()
Panel.save_graph(1,fig)
````
40 changes: 40 additions & 0 deletions gallery/view/XY_multisimple_GABLS1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Plot 2

![XY_multisimple_GABLS1.png](../figures/XY_multisimple_GABLS1.png)

````python
Panel = PanelPlot(3,3, [25,25],'8-9h time averaged vertical profiles', titlepad=11, minmaxpad=1.04, timepad=-0.07, colorbarpad=0.03, labelcolorbarpad = 13, colorbaraspect=40)

Lplot = [np.mean(Dvar['f1'][(LG_MEAN,'MEAN_TH')][:,t_beg:t_end],axis=1), np.mean(Dvar['f2'][(LG_MEAN,'MEAN_TH')][:,t_beg:t_end],axis=1),
np.mean(Dvar['f3'][(LG_MEAN,'MEAN_TH')][:,t_beg:t_end],axis=1)]
LaxeZ = [Dvar['f1']['level_les'], Dvar['f2']['level_les'], Dvar['f3']['level_les']]
Ltitle = ['MEAN_TH']*len(Lplot)
Llinelabel = ['1D BL89','1D RM17', 'LES']
Lxlab = ['theta (K)']*len(Lplot)
Lylab = ['altitude (m)']*len(Lplot)
Lylim = [(0,400.1)]*len(Lplot)
Lxlim = [(262, 268)]*len(Lplot)
Llinecolor = ['red','blue', 'black']
LaxisColor = ['black']*len(Lplot)
Llinewidth = [3]*len(Lplot)
fig = Panel.pXY_lines(Lxx=Lplot, Lyy=LaxeZ, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, Llinewidth=Llinewidth,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor)

Lplot = [np.mean(Dvar['f1']['WIND'][:,t_beg:t_end],axis=1), np.mean(Dvar['f2']['WIND'][:,t_beg:t_end],axis=1), np.mean(Dvar['f3']['WIND'][:,t_beg:t_end],axis=1)]
Ltitle = ['Wind speed']*len(Lplot)
Lxlab = ['Wind speed (m/s)']*len(Lplot)
Lxlim = [(0, 11)]*len(Lplot)
fig = Panel.pXY_lines(Lxx=Lplot, Lyy=LaxeZ, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, ax=fig.axes, Llinewidth=Llinewidth,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor)

Lplot = [Dvar['f1']['SBL_H'][:], Dvar['f2']['SBL_H'][:], Dvar['f3']['SBL_H'][:]]

Ltitle = ['Boundary layer height']*len(Lplot)
LaxeTime = [Dvar['f1']['time_les']/3600.0, Dvar['f2']['time_les']/3600.0, Dvar['f3']['time_les']/3600.0]
Lxlab = ['Time (h)']*len(Lplot)
Lxlim = [(0, 9)]*len(Lplot)
Lylim = [(0, 300.1)]*len(Lplot)
fig = Panel.pXY_lines(Lyy=Lplot, Lxx=LaxeTime, Lxlab=Lxlab, Lylab=Lylab, Ltitle=Ltitle, ax=fig.axes,Llinewidth=Llinewidth,
Lylim=Lylim, Lxlim=Lxlim, Llinelabel=Llinelabel, Llinecolor=Llinecolor,LaxisColor=LaxisColor)
Panel.save_graph(1,fig)
````
22 changes: 22 additions & 0 deletions gallery/view/diachronic_file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Read diachronic file

````python
LnameFiles = ['RBL89.1.ECH01.000.nc','GABL1.1.ECH01.000.nc']
LG_MEAN = '/LES_budgets/Mean/Cartesian/Not_time_averaged/Not_normalized/cart/'
LG_SBG = '/LES_budgets/Subgrid/Cartesian/Not_time_averaged/Not_normalized/cart/'
LG_RES = '/LES_budgets/Resolved/Cartesian/Not_time_averaged/Not_normalized/cart/'

Dvar_input = {
'f1':[(LG_SBG,'SBG_TKE'),(LG_SBG,'SBG_WU'),(LG_SBG,'SBG_WV'),(LG_SBG,'SBG_KM'),(LG_SBG,'SBG_KH'),(LG_SBG,'SBG_WTHL'),(LG_SBG,'SBG_THL2'),
(LG_MEAN,'MEAN_U'),(LG_MEAN,'MEAN_V'),(LG_MEAN,'MEAN_TH'),
'time_les','level_les'],
'f2':[(LG_SBG,'SBG_TKE'),(LG_SBG,'SBG_WU'),(LG_SBG,'SBG_WV'),(LG_SBG,'SBG_KM'),(LG_SBG,'SBG_KH'),(LG_SBG,'SBG_WTHL'),(LG_SBG,'SBG_THL2'),
(LG_RES,'RES_KE'),(LG_RES,'RES_WU'),(LG_RES,'RES_WV'),(LG_RES,'RES_WTH'),(LG_RES,'RES_TH2'),
(LG_MEAN,'MEAN_U'),(LG_MEAN,'MEAN_V'),(LG_MEAN,'MEAN_TH'),
'time_les','level_les']
}

# Read the variables in the files
Dvar = {}
Dvar = read_netcdf(LnameFiles, Dvar_input, path=path, removeHALO=False)
````
43 changes: 43 additions & 0 deletions gallery/view/full_doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Full documentation

````python
def read_netcdf(LnameFiles, Dvar_input, path='.', get_data_only=True, del_empty_dim=True, removeHALO=True):
"""Read a netCDF4 Meso-NH file
For each file, call functions to read diachronic or synchronous file

Parameters
----------
LnameFiles : list of str
list of Meso-NH netCDF4 file (diachronic or synchronous)

Dvar_input : Dict{'fileNumber' : 'var_name',('group_name','var_name')}
where
'fileNumber' is a str corresponding to 'f' + the file number in LnameFiles (by order)
'var_name' is the exact str of the netCDF4 variable name
('group_name','var_name') is the exact tuple of the (sub-)groups name and the netCDF4 variable name
e.g. : {'f1':['ZS', 'WT','ni', 'level'],
'f2':[('/LES_budgets/Cartesian/Not_time_averaged/Not_normalized/cart/',MEAN_TH'),('/Budgets/RI','AVEF')]
}

path : str
unique path of the files

get_data_only : bool, default: True
if True, the function returns Dvar as masked_array (only data)
if False, the function returns Dvar as netCDF4._netCDF4.Variable

del_empty_dim : bool, default: True
if get_data_only=True and del_empty_dim=True, returns Dvar as an array without dimensions with size 1 and 0
e.g. : an array of dimensions (time_budget, cart_level, cart_nj, cart_ni) with shape (180,1,50,1) is returned (180,50)

removeHALO : bool, default: True
if True, remove first and last (NHALO=1) point [1:-1] if get_data_only=True on each
level, level_w, ni, ni_u, ni_v, nj, nj_u, nj_v dimensions

Returns
-------
Dvar : Dict
Dvar[ifile]['var_name'] if the group contains only one variable
Dvar[ifile][('group_name','var_name')] if the group contains more than one variable
"""
````
Loading