Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MethodExample
Named argumentsa = mv.retrieve(type = 'fc', date = -5)
Dictionary

params = {'type' : 'fc', 'date' : -5}
a = mv.retrieve(aparams)

Combination

common_params = {'type' : 'fc'}
a = mv.retrieve(common_params, date = -5)

...

Metview's Python interface also provides a more object-oriented way of using the wrapper classes such as Fieldset. The following two snippets of code are equivalent:

FunctionObject method

# find the locations where t is > 310K

t

fs

= mv.retrieve(param = 't', grid = [1,1])
hot = t > 310
locs =

mv.

find(

fs

hot,

273.15)

1)

# find the locations where t is > 310K

t

fs

= mv.retrieve(param = 't', grid = [1,1])
hot = t > 310
locs =

fs

hot.find(

273.15

1)