Skip to content

Commit

Permalink
fix old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JoranAngevaare committed Jul 3, 2023
1 parent a4e2cad commit 0db46a7
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions optim_esm_tools/analyze/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ def load_glob(
return xr.open_mfdataset(pattern, **kw)


def _interp_nominal_lon_new(lon_1d):
from optim_esm_tools.config import get_logger

get_logger().debug('Using altered version _interp_nominal_lon_new')
x = np.arange(len(lon_1d))
idx = np.isnan(lon_1d)
# TODO assume that longitudes are cyclic see https://github.com/jbusecke/xMIP/issues/299
ret = np.interp(x, x[~idx], lon_1d[~idx], period=len(lon_1d))
return ret


def recast(data_set):
from xmip.preprocessing import (
promote_empty_dims,
Expand Down Expand Up @@ -95,8 +84,17 @@ def recast(data_set):
return ds


# Keeping this arround for sake of the old times
# def _interp_nominal_lon_new(lon_1d):
# from optim_esm_tools.config import get_logger
# get_logger().debug('Using altered version _interp_nominal_lon_new')
# x = np.arange(len(lon_1d))
# idx = np.isnan(lon_1d)
# # TODO assume that longitudes are cyclic see https://github.com/jbusecke/xMIP/issues/299
# ret = np.interp(x, x[~idx], lon_1d[~idx], period=len(lon_1d))
# return ret

# def recast(data_set):
# Keeping this arround for sake of the old times
# from xmip.preprocessing import (
# promote_empty_dims,
# replace_x_y_nominal_lat_lon,
Expand Down

0 comments on commit 0db46a7

Please sign in to comment.