Warning: Can't synchronize with repository "ojims" (/svn/ojims does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #493 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

Too many indices error

Reported by: egryspeerdt Owned by: ibush
Priority: major Component: JASMIN CIS
Keywords: Cc:

Description

This may be related to ticket #491 'Too many boolean indices'

When I try to do a heatmap of subset L2 MODIS data, I get the following error.

cis subset Cloud_Fraction_Day_Mean:MYD08_D3.A2010100.051.2010108030749.hdf x=[-55,-30],y=[0,24] -o MODIS_L2-out
cis plot Cloud_Fraction_Day_Mean:cis-MODIS_L2-out.nc --type=heatmap
2014-04-03 11:23:21,973 - INFO - Identified input file list: ['cis-MODIS_L2-out.nc']
2014-04-03 11:23:21,978 - INFO - Retrieving data using product Cis...
2014-04-03 11:23:21,978 - INFO - Listing coordinates: [('longitude', 'x'), ('latitude', 'y'), ('altitude', 'z'), ('time', 't'), ('air_pressure', 'p')]
2014-04-03 11:23:22,162 - INFO - Plotting longitude on the x axis
2014-04-03 11:23:22,162 - INFO - Plotting latitude on the y axis
Traceback (most recent call last):
  File "/home/edward/jasmin_cis/CISENV/bin/cis", line 5, in <module>
    pkg_resources.run_script('jasmin-cis==0.6.4', 'cis')
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/pkg_resources.py", line 1455, in run_script
    execfile(script_filename, namespace, namespace)
  File "/home/edward/jasmin_cis/CISENV/lib/python2.7/site-packages/jasmin_cis-0.6.4-py2.7.egg/EGG-INFO/scripts/cis", line 6, in <module>
    main()
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/jasmin_cis-0.6.4-py2.7.egg/jasmin_cis/cis.py", line 229, in main
    commands[command](arguments)
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/jasmin_cis-0.6.4-py2.7.egg/jasmin_cis/cis.py", line 80, in plot_cmd
    Plotter(data, plot_type, output, **main_arguments)
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/jasmin_cis-0.6.4-py2.7.egg/jasmin_cis/plotting/plot.py", line 96, in __init__
    plot = self.plot_types[plot_type](packed_data_items, plot_args, *mplargs, **mplkwargs)
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/jasmin_cis-0.6.4-py2.7.egg/jasmin_cis/plotting/generic_plot.py", line 47, in __init__
    self.plot()
  File "/home/edward/jasmin_cis/CISENV/local/lib/python2.7/site-packages/jasmin_cis-0.6.4-py2.7.egg/jasmin_cis/plotting/heatmap.py", line 14, in plot
    self.plotting_library.pcolormesh(self.unpacked_data_items[0]["x"], self.unpacked_data_items[0]["y"], self.unpacked_data_items[0]["data"], *self.mplargs, **self.mplkwargs)
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/basemap/__init__.py", line 447, in with_transform
    return plotfunc(self,x,y,data,*args,**kwargs)
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/basemap/__init__.py", line 3149, in pcolormesh
    ret =  ax.pcolormesh(x,y,data,**kwargs)
  File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 7499, in pcolormesh
    C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at
  File "/usr/lib/python2.7/dist-packages/numpy/ma/core.py", line 2935, in __getitem__
    dout = ndarray.__getitem__(_data, indx)
IndexError: too many indices

Change History

comment:1 Changed 6 years ago by egryspeerdt

Just as a note, this doesn't happen if the data is plotted as a contourf (for example)

comment:2 Changed 6 years ago by spascoe

  • Status changed from new to assigned
  • Owner changed from spascoe to ibush

comment:3 Changed 6 years ago by ibush

I think this data is actually MODIS L3, and this issue is related to #519. The data structure is kept when first read from the MODIS L3 file, but the structural information is lost when saving. Hence a heatmap works for the original MODIS L3 file, but it will not work for this cis- outputs, as this requires gridded data.

I actually get a different error message, albeit on a different data file, as I can not get access to the one described above.

comment:4 Changed 4 years ago by dwatsonparris

  • Status changed from assigned to closed
  • Resolution set to fixed

This now gives a more sensible error message, although ideally we would keep MODIS L3 as gridded...

Note: See TracTickets for help on using tickets.