Beispiel #1
0
print ds.dataset


# Logging
ds.info('Pratique')                                 # -> ESSAYER WARNING
ds.set_loglevel('debug')


# Coordonnees
lon = ds.get_lon()                                  # -> ESSAYER AU POINT U
grid = ds.get_grid()


# Variables
temp = ds.get_temp(level=slice(-1, None), squeeze=True)
sst = ds.get_sst(squeeze=True)                      # -> VERIFIER ATTRIBUTS
ds.info('Plot SST')
map2(sst)
sal = ds.get_sal(lon=(4., 4.5))
print temp.shape, sal.shape

# Generique
ds2 = DS(data_sample('mfs.nc'), 'nemo', lon=(4, 5), lat=(42.5, 43.5))
sst2 = ds2.get_sst(squeeze=True)                      # -> VERIFIER ATTRIBUTS

# Plus evolue
depth = ds.get_depth() # sigma
print depth.shape
mld = ds.get_mld()
ds.plot_transect('temp', lons=(4.1, 4.9), lats=(43.3, 42.6), figsize=(12, 6)) # -> OUTAXIS=
Beispiel #2
0
"""Test :func:`~vacumm.diag.thermdyn.mixed_layer_depth` on MENOR"""

# Inits
ncfile = "menor.nc"

# Imports
from vcmq import DS, data_sample, mixed_layer_depth, rc, map2, os, code_file_name

# Read data
ds = DS(data_sample(ncfile),'mars', logger_level='critical')
temp = ds.get_temp(squeeze=True)
sal = ds.get_sal(squeeze=True)
depth = ds.get_depth(squeeze=True)
kz = ds.get_kz(squeeze=True)

# Compute MLD
kw = dict(depth=depth, format_axes=True)
mld = {}
mld['deltatemp'] = mixed_layer_depth(temp, mode='deltatemp',**kw)
mld['deltadens'] = mixed_layer_depth((temp,sal), mode='deltadens', **kw)
mld['kz'] = mixed_layer_depth(kz, mode='kz', **kw)
vmin = min([v.min() for v in mld.values()])
vmax = max([v.max() for v in mld.values()])

# Plot it
rc('font', size=8)
for i,(mode, var) in enumerate(mld.items()):
    m = map2(var, fill='pcolormesh', nmax=20, vmin=vmin, vmax=vmax,
        subplot=(len(mld),1,i+1), figsize=(4.1,8),
        contour_linewidths=0.7, cmap='vacumm_rnb2_hymex', hspace=0.25, bottom=0.08,
        title='%%(long_name)s: mode = "%s"'%mode, show=False)
Beispiel #3
0
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""Diagnostics thermodynamiques et dynamiques (:mod:`vacumm.diag.thermdyn` et :mod:`vacumm.diag.dynamics`)"""

from vcmq import DS, data_sample, map2, density, mixed_layer_depth,  barotropic_geostrophic_velocity, kinetic_energy, shapiro2d

# Lecture des données de base
ds = DS(data_sample('menor.nc'))
temp = ds.get_temp(squeeze=1)
sal = ds.get_sal(squeeze=1)
depth = ds.get_depth(squeeze=1)
ssh = ds.get_ssh(squeeze=1)


# Densité
dens_surf = density(temp[-1], sal[-1])                      # -> CALCULER DENSITE 3D
map2(dens_surf)


# Couche mélangée
mld = mixed_layer_depth((temp, sal), depth, mode='deltadens') # -> ESSAYER AUTRES MODES
map2(mld, vmax=600.)


# Vitesse geostrophique
# - vitesses
ug, vg = barotropic_geostrophic_velocity(ssh)
# - energie cinetique
ke = kinetic_energy((ug, vg))                                 # -> TESTER AVEC SSH
ke.long_name = 'Surface geostrophique kinetic energy'
ke = shapiro2d(ke)