... | ... | @@ -2090,3 +2090,16 @@ dhw_cube = dhw(cube,mmm_climatology,years_over_which_to_calculate_dhw) |
|
|
## Example of adding some of the bells and whistles to a simple map plot
|
|
|
|
|
|
https://github.com/PaulHalloran/Jupiter_notebooks_halloran/blob/master/arushi_plotting.ipynb
|
|
|
|
|
|
### Changing some value in a cube to a different value, e.g. setting zeros to NaNs
|
|
|
Assuming input data is in an iris cube called 'cube' and you want the output data to overwrite this so the final data is in the same cube.
|
|
|
```
|
|
|
import numpy as np
|
|
|
|
|
|
value_to_select = 0
|
|
|
value_to_replace_with = np.nan
|
|
|
|
|
|
data = cube.data
|
|
|
data[np.where(data == value_to_select)] = value_to_replace_with
|
|
|
cube.data = data
|
|
|
``` |
|
|
\ No newline at end of file |