hetland / octant

Ocean C-grid model setup and analysis tools, for the numerical mariner.
Other
33 stars 25 forks source link

nanmask #8

Open tompc35 opened 8 years ago

tompc35 commented 8 years ago

First of all, thank you for providing these very useful tools. I would just like to suggest a very minor change to the nanmask function in octant/tools.py. When I run the following commands,

import octant.tools
import numpy as np
a = np.array([np.nan,2,3,4])
amsk = octant.tools.nanmask(a)

I receive an error message:

Traceback (most recent call last): File "", line 1, in File "/Users/tompc/programs/anaconda/lib/python2.7/site-packages/octant/tools.py", line 35, in nanmask return np.ma.masked_where(isnan(a), a) NameError: global name 'isnan' is not defined*

I think that line 35 of tools.py,

return np.ma.masked_where(isnan(a), a)

should be changed to:

return np.ma.masked_where(np.isnan(a), a)