In [1]:
import datetime
from metno import bdiana, plotcommands
from metno.ipython_extensions import embed
In [2]:
b = bdiana.BDiana()
b.setup()
In [4]:
b.addModel("baltic_sea_ice_thickness", "http://thredds.met.no/thredds/dodsC/myocean/siw-tac/siw-fmi-baltic/2013/03/ice_thic_baltic_201303311400.nc", clear = True)
In [5]:
models = list(b.getModels())
models.sort()
models
In [6]:
fields = list(b.getFields(models[0]))
fields.sort()
fields
In [7]:
a = plotcommands.Area(name = "Europa")
m = plotcommands.Map(map = "Gshhs-Auto", backcolour = "white", land = "on")
m.setOption("land.colour", "flesh")
f = plotcommands.Field(model = models[0], plot = fields[1], plottype = "fill_cell")
times = b.getFieldTimes(models[0], fields[1])
times
In [8]:
b.setPlotCommands([a.text(), m.text(), f.text()])
if times:
b.setPlotTime(times[-1])
else:
b.setPlotTime(datetime.datetime.now())
In [9]:
im = b.plotImage(500, 500)
In [10]:
embed(im)
In [ ]: