Versions Compared

Key

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

...

MacroPythonNotes
numbernumber
stringstring
listlistCan also pass a tuple to Macro, and it will be converted to a Macro list
fieldsetFieldsetLightweight wrapper class in Meview-Python
geopointsGeopointsLightweight wrapper class in Meview-Python
observationsBufrLightweight wrapper class in Meview-Python
netcdfNetCDFLightweight wrapper class in Meview-Python
odbOdbLightweight wrapper class in Meview-Python
tableTableLightweight wrapper class in Meview-Python
vectornumPy array
datedatetimeCan also pass a date or a datetime64 to Macro
definitiondictionary
nilNone

Icon functions

Macro functions which correspond to icons, such as retrieve(), which corresponds to the Mars Retrieval icon, can take their arguments in a number of ways:

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

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

Combination

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

Object-oriented calling

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
fs = mv.retrieve(grid = [1,1])
locs = mv.find(fs, 273.15)
fs = mv.retrieve(grid = [1,1])
locs = fs.find(273.15)