In [1]:
from vaex.quick import *
%matplotlib inline
vx.set_log_level_warning()
/Users/users/breddels/.local/lib/python2.7/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)
In [2]:
#table = vx.open("/Users/maartenbreddels/vaex/data/tgas/Simu-AGISLab-nominal-shuffled.hdf5")
table = vx.open('/data2/users/breddels/gaia/tgas/1/Simu-AGISLab-nominal-shuffled.hdf5')
table.add_virtual_columns_equatorial_to_galactic_cartesian("Alpha", "Delta", "Distance", "x", "y", "z", radians=False)
table.add_virtual_column("rho", "sqrt(x**2+y**2)") # cylindrical radius
In [3]:
table.select("rho > 50.")
subspace = table("x", "y").selected()
In [4]:
xlim, ylim, zlim = table("x", "y", "z").limits_sigma(0.5, square=True)
In [5]:
table("x", "y").selected().bounded_by([xlim, ylim]).gridded()
Out[5]:
In [6]:
table("x", "z").selected().bounded_by([xlim, zlim]).gridded()
Out[6]:
In [7]:
table("y", "z").selected().bounded_by([ylim, zlim]).gridded()
Out[7]:
In [8]:
table.add_virtual_columns_rotation("y", "z", "yp", "zp", 30)
table("yp", "zp").selected().bounded_by([ylim, zlim]).gridded()
Out[8]:
In [9]:
import vaex.transformations as t
axis = [1, 0, 0]
m = t.rotation_matrix(np.radians(30), axis)
table.add_virtual_columns_matrix3d("x", "y", "z", "x2", "y2", "z2", m, "mat3d")
/Users/users/breddels/vaex-testing/python/vaex/transformations.py:1899: UserWarning: failed to import module _transformations
  warnings.warn("failed to import module %s" % name)
In [10]:
table("y2", "z2").selected().bounded_by([ylim, zlim]).gridded()
Out[10]: