示例#1
0
# -*- coding: utf8 -*-
# Lecture d'une serie 1D de niveau de la mer du modele
import cdms2
from vacumm.config import data_sample
f = cdms2.open(data_sample('tide.sealevel.BREST.mars.nc'))
sea_level = f('sea_level', ('2006-10-01', '2006-10-02'))[1::4] # Toutes les heures
f.close()

# Recuperation des pleines mers, basses mers et zeros
from vacumm.tide.filters import extrema, zeros
bm, pm = extrema(sea_level, spline=True, reference='mean')
zz = zeros(sea_level, ref='mean')

# Plots
from vacumm.misc.plot import curve2 as curve
curve(sea_level, 'ko', markersize=3, figsize=(6, 4), show=False)
curve(zz, 'go', linewidth=0, show=False, xstrict=False)
curve(pm, 'ro', linewidth=0, show=False, xstrict=False)
curve(bm, 'bo', linewidth=0, xstrict=False, title="Niveau de la mer",
   savefigs=__file__, savefigs_pdf=True, show=False, close=True)
示例#2
0
# -*- coding: utf8 -*-
# Lecture d'une serie 1D de niveau de la mer du modele
import cdms2
from vacumm.config import data_sample
f = cdms2.open(data_sample('tide.sealevel.BREST.mars.nc'))
sea_level = f('sea_level', ('2006-10-01', '2006-10-02'))[1::4] # Toutes les heures
f.close()

# Recuperation des pleines mers, basses mers et zeros
from vacumm.tide.filters import extrema, zeros
bm, pm = extrema(sea_level, spline=True, reference='mean')
zz = zeros(sea_level, ref='mean')

# Plots
from vacumm.misc.plot import curve2 as curve
curve(sea_level, 'ko', markersize=3, figsize=(6, 4), show=False)
curve(zz, 'go', linewidth=0, show=False, xstrict=False)
curve(pm, 'ro', linewidth=0, show=False, xstrict=False)
curve(bm, 'bo', linewidth=0, xstrict=False, title="Niveau de la mer", 
   savefigs=__file__, savefigs_pdf=True, show=False)
示例#3
0
print station.attributes()
print station.name, station.longitude
print 'Niveau moyen a Brest:', station.nm

# Read sea level at Brest
f = cdms2.open(data_sample("tide.sealevel.BREST.mars.nc"))
sea_level = f('sea_level')
f.close()

# Surcotes/decotes
cotes, tide = demerliac(sea_level, get_tide=True)  # -> ESSAYER GODIN
kwp = dict(date_fmt='%b', date_locator='month')
curve2(sea_level, 'b', show=False, figsize=(15, 4), **kwp)
curve2(tide, 'r', **kwp)
curve2(cotes, figsize=(15, 4), **kwp)

# Extremas
slzoom1 = sea_level(('2006-10-01', '2006-10-02'))[::4]  # Toutes les heures
bm, pm = extrema(slzoom1, spline=True, ref='mean')  # -> SANS SPLINES
zz = zeros(slzoom1, ref='mean')  # -> AUTRES REFERENCE ?
curve2(slzoom1, 'ko', markersize=3, figsize=(6, 4), show=False)
curve2(zz, 'go', linewidth=0, show=False, xstrict=False)
curve2(pm, 'ro', linewidth=0, show=False, xstrict=False)
curve2(bm, 'bo', linewidth=0, xstrict=False, title="Niveau de la mer")

# Outil marégraphique
slzoom2 = sea_level(('2006-10', '2006-11'))[::4]  # Toutes les heures
mg = Marigraph(slzoom2, verbose=True)
tide = mg.tide(tide_filter='demerliac')  # -> ESSAYER COTES/HIGH...
mg.plot()  # -> SELECTION
示例#4
0
# Read sea level at Brest
f = cdms2.open(data_sample("tide.sealevel.BREST.mars.nc"))
sea_level = f('sea_level')
f.close()


# Surcotes/decotes
cotes, tide = demerliac(sea_level, get_tide=True)            # -> ESSAYER GODIN
kwp = dict(date_fmt='%b', date_locator='month')
curve2(sea_level, 'b', show=False, figsize=(15, 4), **kwp)
curve2(tide, 'r', **kwp)
curve2(cotes, figsize=(15, 4), **kwp)


# Extremas
slzoom1 = sea_level(('2006-10-01', '2006-10-02'))[::4] # Toutes les heures
bm, pm = extrema(slzoom1, spline=True, ref='mean')           # -> SANS SPLINES
zz = zeros(slzoom1, ref='mean')                              # -> AUTRES REFERENCE ?
curve2(slzoom1, 'ko', markersize=3, figsize=(6, 4), show=False)
curve2(zz, 'go', linewidth=0, show=False, xstrict=False)
curve2(pm, 'ro', linewidth=0, show=False, xstrict=False)
curve2(bm, 'bo', linewidth=0, xstrict=False, title="Niveau de la mer")


# Outil marégraphique
slzoom2 = sea_level(('2006-10', '2006-11'))[::4] # Toutes les heures
mg = Marigraph(slzoom2, verbose=True)
tide = mg.tide(tide_filter='demerliac')                     # -> ESSAYER COTES/HIGH...
mg.plot()                                                   # -> SELECTION