Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Coregistration failure with some Aerosol product types #770

Closed
forman opened this issue Sep 26, 2018 · 0 comments
Closed

Coregistration failure with some Aerosol product types #770

forman opened this issue Sep 26, 2018 · 0 comments
Assignees

Comments

@forman
Copy link
Member

forman commented Sep 26, 2018

Expected behavior

Coregister Aerosol and Cloud CCI products.

Actual behavior

It seems the root cause is that Aerosol CCI products don't have a correct time encoding in Cate (this is another issue, #771). However, users should be notified in a human-readable way (raise ValidationError('Data type mismatch')). Instead they see the following:

image

Job: Executing operation "coregister"
Message: Failed at nopython (nopython frontend)
�[1m�[1mFailed at nopython (nopython frontend)
�[1m�[1mCannot unify array(int32, 2d, C) and array(float64, 2d, C) for 'out', defined at D:\Projects\cate\cate\ops\resampling.py (341)
�[1m
File "D:\Projects\cate\cate\ops\resampling.py", line 341:�[0m
�[1mdef _downsample_2d(src, mask, use_mask, method, fill_value, mode_rank, out):
�[1m    src_w = src.shape[-1]
�[0m    �[1m^�[0m�[0m
�[0m
�[0m�[1m[1] During: typing of assignment at D:\Projects\cate\cate\ops\resampling.py (532)�[0m
�[1m
File "D:\Projects\cate\cate\ops\resampling.py", line 532:�[0m
�[1mdef _downsample_2d(src, mask, use_mask, method, fill_value, mode_rank, out):
    <source elided>
        if method == DS_STD:
�[1m            out = np.sqrt(out)
�[0m            �[1m^�[0m�[0m

�[0m�[1m[1] During: resolving callee type: type(CPUDispatcher(<function _downsample_2d at 0x00000161C5147048>))�[0m
�[0m�[1m[2] During: typing of call at D:\Projects\cate\cate\ops\resampling.py (220)
�[0m
�[1m
File "D:\Projects\cate\cate\ops\resampling.py", line 220:�[0m
�[1mdef _resample_2d(src, mask, use_mask, ds_method, us_method, fill_value, mode_rank, out):
    <source elided>
    if out_w < src_w and out_h < src_h:
�[1m        return _downsample_2d(src, mask, use_mask, ds_method, fill_value, mode_rank, out)
�[0m        �[1m^�[0m�[0m

This is not usually a problem with Numba itself but instead often caused by
the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit:
http://numba.pydata.org/numba-doc/dev/reference/pysupported.html
and
http://numba.pydata.org/numba-doc/dev/reference/numpysupported.html

For more information about typing errors and how to debug them visit:
http://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#my-code-doesn-t-compile

If you think your code should work with Numba, please report the error message
and traceback, along with a minimal reproducer at:
https://github.com/numba/numba/issues/new

Code: -32003
Method: set_workspace_resource
Exception: numba.errors.TypingError

Traceback (most recent call last):
  File "D:\Projects\cate\cate\util\web\jsonrpchandler.py", line 209, in send_service_method_result
    result = future.result()
  File "D:\Miniconda3\envs\cate-env\lib\concurrent\futures\_base.py", line 425, in result
    return self.__get_result()
  File "D:\Miniconda3\envs\cate-env\lib\concurrent\futures\_base.py", line 384, in __get_result
    raise self._exception
  File "D:\Miniconda3\envs\cate-env\lib\concurrent\futures\thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "D:\Projects\cate\cate\util\web\jsonrpchandler.py", line 306, in call_service_method
    result = method(*method_params, monitor=monitor)
  File "D:\Projects\cate\cate\webapi\websocket.py", line 292, in set_workspace_resource
    monitor=monitor)
  File "D:\Projects\cate\cate\core\wsmanag.py", line 320, in set_workspace_resource
    workspace.execute_workflow(res_name=res_name, monitor=monitor)
  File "D:\Projects\cate\cate\core\workspace.py", line 662, in execute_workflow
    self.workflow.invoke_steps(steps, context=self._new_context(), monitor=monitor)
  File "D:\Projects\cate\cate\core\workflow.py", line 632, in invoke_steps
    step.invoke(context=context, monitor=monitor.child(work=1))
  File "D:\Projects\cate\cate\core\workflow.py", line 318, in invoke
    self._invoke_impl(_new_context(context, step=self), monitor=monitor)
  File "D:\Projects\cate\cate\core\workflow.py", line 980, in _invoke_impl
    return_value = self._op(monitor=monitor, **input_values)
  File "D:\Projects\cate\cate\core\op.py", line 216, in __call__
    return_value = self._wrapped_op(**input_values)
  File "D:\Projects\cate\cate\ops\coregistration.py", line 140, in coregister
    return _resample_dataset(ds_master, ds_slave, methods_us[method_us], methods_ds[method_ds], monitor)
  File "D:\Projects\cate\cate\ops\coregistration.py", line 314, in _resample_dataset
    retset = ds_slave.apply(_resample_array, keep_attrs=True, **kwargs)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\core\dataset.py", line 2829, in apply
    for k, v in iteritems(self.data_vars))
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\core\dataset.py", line 2829, in <genexpr>
    for k, v in iteritems(self.data_vars))
  File "D:\Projects\cate\cate\ops\coregistration.py", line 260, in _resample_array
    temp_array = _nested_groupby_apply(array, groupby_list, _resample_slice, kwargs)
  File "D:\Projects\cate\cate\ops\coregistration.py", line 391, in _nested_groupby_apply
    return array.groupby(groupby[0], squeeze=True).apply(apply_fn, **kwargs)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\core\groupby.py", line 516, in apply
    return self._combine(applied, shortcut=shortcut)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\core\groupby.py", line 520, in _combine
    applied_example, applied = peek_at(applied)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\core\utils.py", line 133, in peek_at
    peek = next(gen)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\core\groupby.py", line 515, in <genexpr>
    for arr in grouped)
  File "D:\Projects\cate\cate\ops\coregistration.py", line 215, in _resample_slice
    us_method)
  File "D:\Projects\cate\cate\ops\resampling.py", line 100, in resample_2d
    return _mask_or_not(_resample_2d(src, mask, use_mask, ds_method, us_method, fill_value, mode_rank, out),
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\numba\dispatcher.py", line 349, in _compile_for_args
    error_rewrite(e, 'typing')
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\numba\dispatcher.py", line 316, in error_rewrite
    reraise(type(e), e, None)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\numba\six.py", line 658, in reraise
    raise value.with_traceback(tb)
numba.errors.TypingError: Failed at nopython (nopython frontend)
�[1m�[1mFailed at nopython (nopython frontend)
�[1m�[1mCannot unify array(int32, 2d, C) and array(float64, 2d, C) for 'out', defined at D:\Projects\cate\cate\ops\resampling.py (341)
�[1m
File "D:\Projects\cate\cate\ops\resampling.py", line 341:�[0m
�[1mdef _downsample_2d(src, mask, use_mask, method, fill_value, mode_rank, out):
�[1m    src_w = src.shape[-1]
�[0m    �[1m^�[0m�[0m
�[0m
�[0m�[1m[1] During: typing of assignment at D:\Projects\cate\cate\ops\resampling.py (532)�[0m
�[1m
File "D:\Projects\cate\cate\ops\resampling.py", line 532:�[0m
�[1mdef _downsample_2d(src, mask, use_mask, method, fill_value, mode_rank, out):
    <source elided>
        if method == DS_STD:
�[1m            out = np.sqrt(out)
�[0m            �[1m^�[0m�[0m

�[0m�[1m[1] During: resolving callee type: type(CPUDispatcher(<function _downsample_2d at 0x00000161C5147048>))�[0m
�[0m�[1m[2] During: typing of call at D:\Projects\cate\cate\ops\resampling.py (220)
�[0m
�[1m
File "D:\Projects\cate\cate\ops\resampling.py", line 220:�[0m
�[1mdef _resample_2d(src, mask, use_mask, ds_method, us_method, fill_value, mode_rank, out):
    <source elided>
    if out_w < src_w and out_h < src_h:
�[1m        return _downsample_2d(src, mask, use_mask, ds_method, fill_value, mode_rank, out)
�[0m        �[1m^�[0m�[0m

This is not usually a problem with Numba itself but instead often caused by
the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit:
http://numba.pydata.org/numba-doc/dev/reference/pysupported.html
and
http://numba.pydata.org/numba-doc/dev/reference/numpysupported.html

For more information about typing errors and how to debug them visit:
http://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#my-code-doesn-t-compile

If you think your code should work with Numba, please report the error message
and traceback, along with a minimal reproducer at:
https://github.com/numba/numba/issues/new

Steps to reproduce the problem

  1. ds_cloud = open dataset "esacci.CLOUD.mon.L3C.CLD_PRODUCTS.AVHRR.multi-platform.AVHRR-PM.2-0.r1", time 2014-01-01, 2014-12-31, global, only variable cfc
  2. ds_aero = open dataset "esacci.AEROSOL.mon.L3.AAI.multi-sensor.multi-platform.ms_uvai.1-5-7.r1", time 2014-01-01, 2014-12-31, global, all variables
  3. coregister ds_cloud with ds_aero (lower res)

Specifications

Provide information such as the version of the project, operating system, or hardware.

@forman forman changed the title Coregistration failure with Aerosol and Cloud products Coregistration failure with some Aerosol product types Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants