WIP : review of ocean module
Hi @matt_s , I am in the progress of reviewing the ocean module tutorial.
Came upon a minor bug in the bathy_xy
method, which I've fixed.
However, when attempting to run the cell
o = Ocean(load_salinity='hycom', **bounds) # instantiate interpolator with HYCOM salinity data
o.salinity(lat=[47.5, 48.1], lon=[-64, -62.5], depth=[0, 10]) # query interpolator for values at given coordinates
I get the following warnings,
/home/oliskir/src/anaconda3/envs/kadlu_env/lib/python3.6/site-packages/scipy/interpolate/interpolate.py:2537: RuntimeWarning: divide by zero encountered in true_divide
(grid[i + 1] - grid[i]))
/home/oliskir/src/anaconda3/envs/kadlu_env/lib/python3.6/site-packages/scipy/interpolate/interpolate.py:2537: RuntimeWarning: invalid value encountered in true_divide
(grid[i + 1] - grid[i]))
/home/oliskir/src/anaconda3/envs/kadlu_env/lib/python3.6/site-packages/scipy/interpolate/interpolate.py:2515: RuntimeWarning: invalid value encountered in add
values += np.asarray(self.values[edge_indices]) * weight[vslice]
and the result,
array([nan, nan])
Can you reproduce this error at your end?
Also, this reminded me of another issue we've touched previously: Do we want the bathy and bathy_xy methods to return depth (positive) or elevation (negative)? Per discussion with Casey, I think we agreed elevation (i.e. negative values) was more natural ...