[yt-users] Visualising spectral cube data in yt

Kacper Kowalik xarthisius.kk at gmail.com
Wed Feb 20 03:24:37 PST 2013


On 02/20/2013 11:09 AM, Francisco Ocaña González wrote:
> Dear Eli,
> 

Hi Paco!

> I found a post about 3D data in YT ,
> http://astrobiased.com/3d-data-vis-in-yt.html , very interesting. I am
> working with spectral cubes from PMAS Spectrograph (at 3.5m CAHA
> telescope). Thus, I tried to use it. I am newbie with python, but I was
> able to install everything :-)

Great to hear that!

> However I get an error message when loading the data into yt's data
> structure (script http://paste.yt-project.org/show/3182/ ):
> 
> ERROR: ValueError: total size of new array must be unchanged
> [yt.frontends.stream.data_structures]
> astropy: [ERROR    ] 2013-02-20 10:46:53,395 ValueError: total size of new
> array must be unchanged
> Traceback (most recent call last):
>   File "3d_viewer.py", line 9, in <module>
>     pf = load_uniform_grid(data, cube.shape, 9e16)
>   File
> "/home/fog/YT/yt-x86_64/src/yt-hg/yt/frontends/stream/data_structures.py",
> line 490, in load_uniform_grid
>     grid_dimensions = domain_dimensions.reshape(nprocs,3).astype("int32")
> ValueError: total size of new array must be unchanged

That happens due to the fact that load_uniform_grid expects that data
has 3 dimensions, whereas the data from your fits has only 2. You can
"fix" that by artificially adding one dimension by e.g. using numpy
function "expand_dims". I've modified your script slightly:

http://bpaste.net/show/78501/

I hope it'll work for you.
Cheers,
Kacper

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130220/aaefb5cd/attachment.sig>


More information about the yt-users mailing list