CCI-Tools / cate

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

Coregistration fails with one of the SST datasets #714

Closed JanisGailis closed 6 years ago

JanisGailis commented 6 years ago

Steps to reproduce the problem

import cate.ops
-# Step 1
esa_seawater_temperature = cate.ops.open_dataset(ds_id="local.esa_sst_ext")
-# Step 2
esa_mean_sea_level_anom = cate.ops.open_dataset(ds_id="local.esa_msla_ext")
-# Step 3
mean_sst = cate.ops.select_var(ds=esa_seawater_temperature, var="mean_sst")
-# Step 4
mean_sla = cate.ops.select_var(ds=esa_mean_sea_level_anom, var="sla")
-# Step 5
mean_sst_temp_sub = cate.ops.subset_temporal(ds=mean_sst, time_range="1993-01-15, 2010-12-16T23:59:59")
-# Step 6
mean_msla_temp_sub = cate.ops.subset_temporal(ds=mean_sla, time_range="1993-01-15, 2010-12-15T23:59:59")
-# Step 7
sst_spat_temp_sub = cate.ops.subset_spatial(ds=mean_sst_temp_sub, region="-80,-40,60,80")
-# Step 8
msla_spat_temp_sub = cate.ops.subset_spatial(ds=mean_msla_temp_sub, region="-80,-40,60,80")

Error message

---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
<ipython-input-86-ef59c63a2ff1> in <module>()
----> 1 msla_coreg = cate.ops.coregister(sst_spat_temp_sub, msla_spat_temp_sub)

C:\cate\cate\core\op.py in __call__(self, monitor, *args, **kwargs)
    214
    215         # call the callable
--> 216         return_value = self._wrapped_op(**input_values)
    217
    218         if self.op_meta_info.has_named_outputs:

C:\cate\cate\ops\coregistration.py in coregister(ds_master, ds_slave, method_us, method_ds, monitor)
    126             raise ValidationError('The {} dataset grid is not'
    127                                   ' equidistant, can not perform'
--> 128                                   ' coregistration'.format(array[0]))
    129
    130         if not _is_pixel_registered(array[1], array[2]):

ValidationError: The master dataset grid is not equidistant, can not perform coregistration

Specifications

cate 2.0.0-dev15

JanisGailis commented 6 years ago

This dataset fails the 'equidistant' check. However, upon closer inspection it becomes clear that the data is in fact both 'equidistant' and 'pixel-registered', but features some small floating point errors.

JanisGailis commented 6 years ago

@Evadzi, this should now be fixed. That is, the two datasets can be coregistered. For me it only worked with a significantly smaller region (5 deg each dimension), otherwise it would run into a memory error though. Please re-open if you're not able to do coregistration still with these datasets.