A class holding spatial coordinates in Cartesian/spherical in units of Re and degrees
Coordinate transforms are based on the IRBEM library; its manual may prove useful. There is good background information on space physics coordinate systems at SPENVIS and RAL
Parameters: | data : list or ndarray, dim = (n,3)
dtype : string
carsph : string
units : list of strings, optional
ticks : Ticktock instance, optional
|
---|---|
Returns: | out : Coords instance
|
See also
Examples
>>> from spacepy import coordinates as coord
>>> cvals = coord.Coords([[1,2,4],[1,2,2]], 'GEO', 'car')
>>> cvals.x # returns all x coordinates
array([1, 1])
>>> from spacepy.time import Ticktock
>>> cvals.ticks = Ticktock(['2002-02-02T12:00:00', '2002-02-02T12:00:00'], 'ISO') # add ticks
>>> newcoord = cvals.convert('GSM', 'sph')
>>> newcoord
append(other) | Append another Coords instance to the current one |
convert(returntype, returncarsph) | Create a new Coords instance with new coordinate types |
Append another Coords instance to the current one
Parameters: | other : Coords instance
|
---|
Create a new Coords instance with new coordinate types
Parameters: | returntype : string
returncarsph : string
|
---|---|
Returns: | out : Coords object
|
Examples
>>> from spacepy.coordinates import Coords
>>> y = Coords([[1,2,4],[1,2,2]], 'GEO', 'car')
>>> from spacepy.time import Ticktock
>>> y.ticks = Ticktock(['2002-02-02T12:00:00', '2002-02-02T12:00:00'], 'ISO')
>>> x = y.convert('SM','car')
>>> x
Coords( [[ 0.81134097 2.6493305 3.6500375 ]
[ 0.92060408 2.30678864 1.68262126]] ), dtype=SM,car, units=['Re', 'Re', 'Re']