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

spatial subset failed #276

Closed
barsten opened this issue Jun 30, 2017 · 5 comments
Closed

spatial subset failed #276

barsten opened this issue Jun 30, 2017 · 5 comments
Assignees
Milestone

Comments

@barsten
Copy link

barsten commented Jun 30, 2017

download AOT - success
download cfc - success
open AOT - success
open cfc - success
spatial subset AOT - success
spatial subset cfc (same as AOT) - fail


Cate Desktop, version 0.9.0-dev.1

integer division or modulo by zero

An error (code 10) occurred while executing a backend process:

Traceback (most recent call last):
  File "C:\Users\carsten\cate\lib\site-packages\cate\util\web\jsonrpchandler.py", line 163, in send_service_method_result
    result = future.result()
  File "C:\Users\carsten\cate\lib\concurrent\futures\_base.py", line 398, in result
    return self.__get_result()
  File "C:\Users\carsten\cate\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\Users\carsten\cate\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\carsten\cate\lib\site-packages\cate\util\web\jsonrpchandler.py", line 216, in call_service_method
    result = method(*method_params, monitor=monitor)
  File "C:\Users\carsten\cate\lib\site-packages\cate\webapi\websocket.py", line 294, in set_workspace_resource
    return workspace.to_json_dict()
  File "C:\Users\carsten\cate\lib\site-packages\cate\core\workspace.py", line 205, in to_json_dict
    ('resources', self._resources_to_json_list())
  File "C:\Users\carsten\cate\lib\site-packages\cate\core\workspace.py", line 217, in _resources_to_json_list
    resource_descriptor = self._get_resource_descriptor(res_id, res_update_count, res_name, resource)
  File "C:\Users\carsten\cate\lib\site-packages\cate\core\workspace.py", line 237, in _get_resource_descriptor
    variable_descriptors.append(self._get_xarray_variable_descriptor(variable))
  File "C:\Users\carsten\cate\lib\site-packages\cate\core\workspace.py", line 298, in _get_xarray_variable_descriptor
    image_config = self._get_variable_image_config(variable)
  File "C:\Users\carsten\cate\lib\site-packages\cate\core\workspace.py", line 335, in _get_variable_image_config
    max_size, tile_size, num_level_zero_tiles, num_levels = ImagePyramid.compute_layout(array=variable)
  File "C:\Users\carsten\cate\lib\site-packages\cate\util\im\image.py", line 789, in compute_layout
    num_level_zero_tiles = cardinal_div_round(max_width, tile_width  2 * (num_levels - 1)), \
  File "C:\Users\carsten\cate\lib\site-packages\cate\util\im\utils.py", line 66, in cardinal_div_round
    return int(num + denom - 1) // int(denom)
ZeroDivisionError: integer division or modulo by zero
@mzuehlke
Copy link
Collaborator

mzuehlke commented Jul 3, 2017

To reproduce I need to following details:

  • which cfc datasource for download
  • the constraints while downloading (time, region, variables), if any
  • the region in subset

@forman
Copy link
Member

forman commented Jul 3, 2017

Even without knowing any data source details, int(denom) must not be zero.

@forman forman added this to the IPM6 milestone Jul 3, 2017
@forman
Copy link
Member

forman commented Jul 3, 2017

Still trying to get into the state where one of the tile width or height is zero. When trying to create very small subsets I get another error:

Cate Desktop, version 0.9.0-dev.2

index 0 is out of bounds for axis 0 with size 0

An error (code 10) occurred while executing a backend process:

Traceback (most recent call last):
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\util\web\jsonrpchandler.py", line 163, in send_service_method_result
    result = future.result()
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\concurrent\futures\_base.py", line 398, in result
    return self.__get_result()
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\util\web\jsonrpchandler.py", line 216, in call_service_method
    result = method(*method_params, monitor=monitor)
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\webapi\websocket.py", line 294, in set_workspace_resource
    return workspace.to_json_dict()
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\core\workspace.py", line 205, in to_json_dict
    ('resources', self._resources_to_json_list())
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\core\workspace.py", line 217, in _resources_to_json_list
    resource_descriptor = self._get_resource_descriptor(res_id, res_update_count, res_name, resource)
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\core\workspace.py", line 238, in _get_resource_descriptor
    variable_descriptors.append(self._get_xarray_variable_descriptor(variable))
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\core\workspace.py", line 306, in _get_xarray_variable_descriptor
    image_config = self._get_variable_image_config(variable)
  File "C:\Users\Norman\IdeaProjects\ccitools\cate-core\cate\core\workspace.py", line 331, in _get_variable_image_config
    west = min(lons[0], lons[-1]) - lon_delta
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\xarray\core\dataarray.py", line 472, in __getitem__
    return self.isel(**self._item_key_to_dict(key))
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\xarray\core\dataarray.py", line 679, in isel
    ds = self._to_temp_dataset().isel(drop=drop, **indexers)
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\xarray\core\dataset.py", line 1143, in isel
    new_var = var.isel(**var_indexers)
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\xarray\core\variable.py", line 570, in isel
    return self[tuple(key)]
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\xarray\core\variable.py", line 1225, in __getitem__
    values = self._indexable_data[key]
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\xarray\core\indexing.py", line 545, in __getitem__
    result = self.array[key]
  File "C:\Users\Norman\Miniconda3\envs\cate\lib\site-packages\pandas\core\indexes\base.py", line 1689, in __getitem__
    return getitem(key)
IndexError: index 0 is out of bounds for axis 0 with size 0

@forman
Copy link
Member

forman commented Jul 3, 2017

Fixed the above problem.

@forman forman self-assigned this Jul 5, 2017
@forman forman modified the milestones: IPM6, 1.0 Sep 21, 2017
@forman
Copy link
Member

forman commented Sep 28, 2017

Closing this as we cannot reproduce it anymore. We may reopen later.

@forman forman closed this as completed Sep 28, 2017
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

3 participants