Step-by-step guide
Suppose the we have a GRIB file, and we want to use some NumPy routines to manipulate the data values, and then write the result back to a GRIB file. The following Python code shows how to do this:
Code Block |
---|
|
import metview as mv
import numpy as np
g = mv.read("mydata.grib")[0] # work on the first field only
vals = np.reciprocal(g.values())
g = g.set_values(vals)
mv.write('recip.grib', g) |
Related articles
Content by Label |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | UDOC |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label = "metview-faqs" and type = "page" and space = "UDOC" |
---|
labels | kb-how-to-article |
---|
|