cate icon indicating copy to clipboard operation
cate copied to clipboard

animate_map error: 'bboxes' cannot be empty

Open forman opened this issue 7 years ago • 7 comments

Expected behavior

animate_map() should produce a valid animation when given a valid datasets, variable, and valid region. The dataset was created using subset_spatial() on a fully valid, CF-conformant dataset with dimension (time, lat, lon) and shape (216, 1000, 2000).

Actual behavior

animate_map() raises ValueError.

Steps to reproduce the problem

  1. Open dataset
  2. subset_spatial()
  3. animate_map()

Specifications

Cate 2.0.0.dev12

Traceback

Job: Executing operation "animate_map"
Message: 'bboxes' cannot be empty
Code: -32003
Method: set_workspace_resource
Exception: ValueError

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 398, in result
    return self.__get_result()
  File "D:\Miniconda3\envs\cate-env\lib\concurrent\futures\_base.py", line 357, in __get_result
    raise self._exception
  File "D:\Miniconda3\envs\cate-env\lib\concurrent\futures\thread.py", line 55, 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 289, in set_workspace_resource
    monitor=monitor)
  File "D:\Projects\cate\cate\core\wsmanag.py", line 317, in set_workspace_resource
    workspace.execute_workflow(res_name=res_name, monitor=monitor)
  File "D:\Projects\cate\cate\core\workspace.py", line 612, 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\animate.py", line 258, in animate_map
    anim_html = anim.to_jshtml()
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\matplotlib\animation.py", line 1469, in to_jshtml
    default_mode=default_mode))
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\matplotlib\animation.py", line 1259, in save
    anim._draw_next_frame(d, blit=False)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\matplotlib\animation.py", line 1296, in _draw_next_frame
    self._draw_frame(framedata)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\matplotlib\animation.py", line 1814, in _draw_frame
    self._drawn_artists = self._func(framedata, *self._args)
  File "D:\Projects\cate\cate\ops\animate.py", line 251, in run
    add_colorbar=False, **plot_kwargs)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\plot\plot.py", line 681, in plotmethod
    return newplotfunc(**allargs)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\plot\plot.py", line 630, in newplotfunc
    **kwargs)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\xarray\plot\plot.py", line 779, in contourf
    primitive = ax.contourf(x, y, z, **kwargs)
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\cartopy\mpl\geoaxes.py", line 1396, in contourf
    for col in result.collections
  File "D:\Miniconda3\envs\cate-env\lib\site-packages\matplotlib\transforms.py", line 724, in union
    raise ValueError("'bboxes' cannot be empty")
ValueError: 'bboxes' cannot be empty

forman avatar Jun 08 '18 15:06 forman

@forman I'm not able to reproduce it. I tried with SST that was downloaded from ODP as a global dataset, created a subset using subset_spatial and then created an animation with animate_map. Everything with default parameter settings.

Which dataset are you using?

JanisGailis avatar Jun 08 '18 15:06 JanisGailis

I used a dataset that was created for another project. It was written by NetCDF and is perfectly readable by xarray and is fully CF compliant.

forman avatar Jun 11 '18 12:06 forman

Can I get the dataset? Or something representative? Otherwise I haven't been able to reproduce it with any of the ODP datasets I've tried.

JanisGailis avatar Jun 14 '18 10:06 JanisGailis

It happened again, this time for a OC CCI 200-day spatial subset. ESA Climate Office (@esacci) can make the dataset available. Please ask Paul or Ed.

forman avatar Sep 24 '18 13:09 forman

If no bbox given, the operation should use the spatial extent taken from lon/lat coordinate variables.

forman avatar Sep 24 '18 13:09 forman

      Can I get the dataset? Or something representative? Otherwise I haven't been able to reproduce it with any of the ODP datasets I've tried.

I emailed CO2 data to you

To reproduce the issue -use a new polygon (generated using the place mark tool) to subset the data. -compute the animation map

Evadzi avatar Oct 11 '18 08:10 Evadzi

@Evadzi Thank you! I'm sure this will help to solve this issue. I put it in a Google Drive folder: https://drive.google.com/drive/folders/1Gbg_02paUsFyyvSSGnz-vYMwGHIRNBb0?usp=sharing

JanisGailis avatar Oct 11 '18 09:10 JanisGailis