Example #1
0
 def elevation(self, elevation):
     x, y, z = sph2cart(self.radius, np.asarray(elevation,
                                                dtype=np.float64),
                        self.azimuth)
     self._x = x
     self._y = y
     self._z = z
Example #2
0
    def from_spherical(cls, radius, elevation, azimuth):
        """Create a Coordinates class object from a set of points in the
        spherical coordinate system.

        Parameters
        ----------
        radius : ndarray, double
            The radius for each point
        elevation : ndarray, double
            The elevation angle in radians
        azimuth : ndarray, double
            The azimuth angle in radians
        """
        radius = np.asarray(radius, dtype=np.double)
        elevation = np.asarray(elevation, dtype=np.double)
        azimuth = np.asarray(azimuth, dtype=np.double)
        x, y, z = sph2cart(radius, elevation, azimuth)
        return Coordinates(x, y, z)
Example #3
0
 def azimuth(self, azimuth):
     x, y, z = sph2cart(self.radius, self.elevation,
                        np.asarray(azimuth, dtype=np.float64))
     self._x = x
     self._y = y
     self._z = z
Example #4
0
 def radius(self, radius):
     x, y, z = sph2cart(np.asarray(radius, dtype=np.float64),
                        self.elevation, self.azimuth)
     self._x = x
     self._y = y
     self._z = z
Example #5
0
 def spherical(self, value):
     """Cartesian coordinates of all points."""
     x, y, z = sph2cart(value[0, :], value[1, :], value[2, :])
     self.cartesian = np.vstack((x, y, z))