CCI-Tools / cate

ESA CCI Toolbox (Cate)
MIT License
51 stars 15 forks source link

normalize parameter has no effect in open_dataset #717

Closed JanisGailis closed 6 years ago

JanisGailis commented 6 years ago

Larger 0..360 datasets yield a MemoryError #716.

It seems that the normalize parameter of ops.open_dataset does nothing. Both code snippets yield the same result:

import cate.ops
import xarray as xr
esa_seawater_temperature = cate.ops.open_dataset("local.esa_msla_ext")
import cate.ops
import xarray as xr
esa_seawater_temperature = cate.ops.open_dataset("local.esa_msla_ext", normalize=False)
JanisGailis commented 6 years ago

Assigning @forman to make sure this doesn't disappear in noise.

forman commented 6 years ago

@JanisGailis Normalize only has an effect, if there is something to normalize. Please reopen, once you provide an example (e.g. unit-test!) that proves that it never has an effect.

JanisGailis commented 6 years ago

You misunderstand the issue. esa_msla_ext has 0..360 longitude, which is then attempted to be converted to -180..180. Setting normalize=False should result in no normalization being attempted and 'just' creating a dataset with 0..360 longitude. This is not the case, as normalize_impl is called somewhere down the line in ds anyway, irrespective of what the operation parameters are.