Versions Compared

Key

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

...

Variable types

When calling Macro functions from Python, variables passed as input to or output from those functions undergo a conversion as described in this table:

...

Any Metview function that normally returns a vector will return a numPy array when called from Python. For example, the follownig fieldset functions return numPy arrays:

Code Block
a = mv.read('my_data.grib') # returns a Fieldset
lats = mv.latitudes(a)      # returns a numPy array
lons = mv.longitudes(a)     # returns a numPy array
vals = mv.values(a)         # returns a numPy array

Pandas Dataframes

The Geopoints data type as an additional function, to_dataframe(), which can be used as shown:

...