Versions Compared

Key

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

...

Code Block
languagepy
lsm = read('land_sea_mask.grib')
lsm = (lsm >= 0.5>5)

The variable lsm has been replaced with a stricter mask. Applying boolean operators such as < and > returns a result consisting entirely of 1s (where the grid values pass the test) and 0s (where the grid values fail the test). Visualise the result to confirm this change.

Now we want to read t2m.grib and 'deactivate' the points where the land-sea mask is 0 (the sea points).

Info

When performing computations between two fields, they must be on the same grid, with the same number of points. If this is not the case, you will need to use interpolation to transform one field onto the other's grid. See Processing Data.

 

One way to do this could be to simply multiply