Exemplo n.º 1
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
Exemplo n.º 2
0
# -*- coding: utf8 -*-
# Lecture du niveau de la mer
import cdms2
from vacumm.config import data_sample
f = cdms2.open(data_sample('tide.sealevel.BREST.mars.nc'))
sea_level = f('sea_level', time=('2006-10', '2006-10-07'))
f.close()

# Initialisation de l'objet marégraphique
from vacumm.tide.marigraph import Marigraph
mg = Marigraph(sea_level, verbose=True)

# Extraction du signal de maree
tide = mg.tide(tide_filter='demerliac')

# On peut aussi specifier le filtre avec :
mg.set_tide_filter('demerliac') # On peut aussi choisir 'godin'

# Calcul surcotes/decotes
cotes = mg.cotes()

# Calcul des pleines et basses mers
ref = 'mean' 
highs = mg.highs(ref=ref)
lows = mg.lows(ref=ref)
zeros = mg.zeros(ref=ref)

# On plot
import pylab as P
P.rc('font', size=10)
P.figure(figsize=(5, 5))
Exemplo n.º 3
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
Exemplo n.º 4
0
# -*- coding: utf8 -*-
# Lecture du niveau de la mer
import cdms2
from vacumm.config import data_sample
f = cdms2.open(data_sample('tide.sealevel.BREST.mars.nc'))
sea_level = f('sea_level', time=('2006-10', '2006-10-07'))
f.close()

# Initialisation de l'objet marégraphique
from vacumm.tide.marigraph import Marigraph
mg = Marigraph(sea_level, verbose=True)

# Extraction du signal de maree
tide = mg.tide(tide_filter='demerliac')

# On peut aussi specifier le filtre avec :
mg.set_tide_filter('demerliac')  # On peut aussi choisir 'godin'

# Calcul surcotes/decotes
cotes = mg.cotes()

# Calcul des pleines et basses mers
ref = 'mean'
highs = mg.highs(ref=ref)
lows = mg.lows(ref=ref)
zeros = mg.zeros(ref=ref)

# On plot
import pylab as P
P.rc('font', size=10)
P.figure(figsize=(5, 5))