<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/20/2013 06:24 AM, Kacper Kowalik
wrote:<br>
</div>
<blockquote cite="mid:5124B275.4000200@gmail.com" type="cite">
<pre wrap="">On 02/20/2013 11:09 AM, Francisco Ocaña González wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Dear Eli,
</pre>
</blockquote>
<pre wrap="">
Hi Paco!
</pre>
<blockquote type="cite">
<pre wrap="">I found a post about 3D data in YT ,
<a class="moz-txt-link-freetext" href="http://astrobiased.com/3d-data-vis-in-yt.html">http://astrobiased.com/3d-data-vis-in-yt.html</a> , 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 :-)
</pre>
</blockquote>
<pre wrap="">
Great to hear that!
</pre>
<blockquote type="cite">
<pre wrap="">However I get an error message when loading the data into yt's data
structure (script <a class="moz-txt-link-freetext" href="http://paste.yt-project.org/show/3182/">http://paste.yt-project.org/show/3182/</a> ):
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
</pre>
</blockquote>
<pre wrap="">
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:
<a class="moz-txt-link-freetext" href="http://bpaste.net/show/78501/">http://bpaste.net/show/78501/</a>
I hope it'll work for you.
Cheers,
Kacper</pre>
</blockquote>
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.<br>
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.<br>
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.<br>
<br>
peter<br>
<br>
<br>
<blockquote cite="mid:5124B275.4000200@gmail.com" type="cite">
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>
</pre>
</blockquote>
<br>
</body>
</html>