[yt-users] possible error with spherical coordinate transforms
M Ryan Joung
moo at astro.columbia.edu
Thu Oct 18 08:44:35 PDT 2012
Hello,
I am trying to produce an all-sky map projection of a field. Maybe I did something wrong here, but even after the fix described in
https://bitbucket.org/yt_analysis/yt/issue/451/radialvelocity-now-seems-to-require-a
(which sets 'normal' to [0,0,1]), there seems to be an array dimension mismatch between Jy and theta, phi, as you can see below. Can anyone help me with this problem? I attach a logfile (output with --detail) with this error.
Thank you,
-Ryan
The part of the script where the error occurs:
-----------------------------
[snipped]
for _fields in grouper(3, field_names):
f = h5py.File("hi_maps.h5", "a")
fields = [fn for fn in _fields if fn not in f["/"]]
allsky = camera.allsky_projection(pf, c,
300.0/pf['kpc'], NP, fields,
inner_radius = rr, rotation = rotation) <-- line 60
[snipped]
-----------------------------
-----------------------------
Traceback (most recent call last):
File "sky_maps.py", line 60, in <module>
inner_radius = rr, rotation = rotation)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 1536, in allsky_projection
for field in fields]
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/grid_patch.py", line 157, in __getitem__
self.get_data(key)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/grid_patch.py", line 200, in get_data
self._generate_field(field)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/grid_patch.py", line 145, in _generate_field
self[field] = self.pf.field_info[field](self)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/field_info_container.py", line 316, in __call__
dd = self._function(self, data)
File "sky_maps.py", line 50, in VelocityTransmittedHI
(((vel * 1e5) < data["RadialVelocity"])
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/grid_patch.py", line 157, in __getitem__
self.get_data(key)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/grid_patch.py", line 200, in get_data
self._generate_field(field)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/grid_patch.py", line 145, in _generate_field
self[field] = self.pf.field_info[field](self)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/field_info_container.py", line 316, in __call__
dd = self._function(self, data)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/data_objects/universal_fields.py", line 885, in _RadialVelocity
return get_sph_r_component(velocities, theta, phi, normal)
File "/Users/mkjoung/work/yt/yt-i386/src/yt-hg/yt/utilities/math_utils.py", line 797, in get_sph_r_component
Jy*np.sin(theta)*np.sin(phi) + \
ValueError: operands could not be broadcast together with shapes (128,128,128,3) (128,384,128)
-----------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20121018/47d4b913/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log3
Type: application/octet-stream
Size: 21884 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20121018/47d4b913/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20121018/47d4b913/attachment-0001.htm>
More information about the yt-users
mailing list