...
| Macro | Python | Notes |
|---|---|---|
| number | number | |
| string | string | |
| list | list | Can also pass a tuple to Macro, and it will be converted to a Macro list |
| fieldset | Fieldset | Lightweight wrapper class in Meview-Python |
| geopoints | Geopoints | Lightweight wrapper class in Meview-Python |
| observations | Bufr | Lightweight wrapper class in Meview-Python |
| netcdf | NetCDF | Lightweight wrapper class in Meview-Python |
| odb | Odb | Lightweight wrapper class in Meview-Python |
| table | Table | Lightweight wrapper class in Meview-Python |
| vector | numPy array | |
| date | datetime | Can also pass a date or a datetime64 to Macro |
| definition | dictionary | |
| nil | None |
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:
| Method | Example |
|---|---|
| Named arguments | a = mv.retrieve(type = 'fc', date = -5) |
| Dictionary |
|
| Combination |
|
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:
| Function | Object method |
|---|---|
| fs = mv.retrieve(grid = [1,1]) locs = mv.find(fs, 273.15) | fs = mv.retrieve(grid = [1,1]) locs = fs.find(273.15) |