[yt-users] Visualising spectral cube data in yt

Peter Teuben teuben at astro.umd.edu
Wed Feb 20 05:58:37 PST 2013


On 02/20/2013 06:24 AM, Kacper Kowalik wrote:
> 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
I was able to view the data just fine in e.g. ds9, there's nothing wrong
with it. ds9 even handles 3D cubes these days.
but to me it looks like this data is unsuitable for yt. Perhaps the 984
positions along the Y axis of this fits image can be re-arranged in an
RA-DEC grid, and create a real 3D cube, something like a 30 x 30 x 2000,
perhaps along the lines Kacper has tried out, but the fits file does not
contain this information how to do that, in fact the FITS header is
criminally close to being useless. There's no WCS to speak of.
More seriously, before interesting things can be seen, the data need to
be calibrated. lines extracted, fitted, and you could perhaps see some
interesting structures in doppler-velocity space. I would look at IRAF
to handle this, they have lots of tools to handle such spectra.

peter


>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130220/f251550d/attachment.html>


More information about the yt-users mailing list