Versions Compared

Key

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

...

Code Block
languagepy
result = integrate(....)
if result = nil then
    print('No valid data points')
else
    print('Mean value: ', result)
end if

...

Missing values in geopoints

Make a copy of your macro and this time convert the masked t2m field to geopoints:

Code Block
languagepy
geo = grib_to_geo(data: t2m)
return geo

If you examine the result, you will see that there are missing value indicators in much of the file. Metview will respect these, and computations performed on the geopoints will exclude these points. In fact, to make things more efficient, you can remove these points entirely from the geopoints. Try the following:

Code Block
geo = grib_to_geo(data: t2m)
print(count(geo))
geo = remove_missing_values(geo)
print(count(geo))

Extra Work

Computing different means

...