musevlt / mpdaf

MUSE Python Data Analysis Framework
BSD 3-Clause "New" or "Revised" License
15 stars 4 forks source link

subcube doesn't work - but subcube_circle_aperture does #15

Closed HeloiseS closed 3 years ago

HeloiseS commented 3 years ago

Hello,

I'm new to mpdaf and struggling to crop my data cube - the circle apperture works great

subcube = cube.subcube_circle_aperture(center=[106,230], radius=60, unit_center=None, unit_radius=None)
subcube.shape
>>> (3681,120,120)

And it plots great!

But when I try to crop my data to a square with

subcube = cube.subcube(center=[106,230], size=25)

I get a sensible shape (3681, 125, 125) but an empty plot!

When I run the cropping I get the following warning, which may be the cause of the issue:

[WARNING] The world coordinates and data have different dimensions. Modifying the shape of the WCS object
/home/fste075/.local/lib/python3.8/site-packages/mpdaf/obj/cube.py:1882: RuntimeWarning: overflow encountered in long_scalars
  shape = (sl.stop - sl.start, uy.stop - uy.start, ux.stop - ux.start)

What am I doing wrong? Thanks for your help!

HeloiseS commented 3 years ago

my bad - forgot to set units to none