Package coords :: Module position :: Class Position
[show private | hide private]
[frames | no frames]

Class Position


The basic class in the coords library. The Position class is designed to permit users to define a position and then access many representations of it.
Method Summary
Position __init__(self, input, equinox, system, units)
string __repr__(self)
angsep.AngSep angsep(self, other)
Computes the angular separation (great circle distance) between two Positions.
(float,float) b1950(self, timetag)
Return the position in Mean FK4 B1950 coordinates
(float,float) dd(self)
Return position in decimal degrees
string details(self)
Return system & equinox
(float,float) ecliptic(self, timetag)
Return the position in IAU 1980 Ecliptic coordinates
(float,float) galactic(self, timetag)
Return the position in IAU 1958 Galactic coordinates.
string hmsdms(self)
Return position in hms dms
(float, float) j2000(self, timetag)
Return the position in Mean FK5 J2000 coordinates
(float,float) rad(self)
Return position in radians
(float,float) tpmstate(self, endstate, epoch, equinox, timetag)
This method allows the expert user to call the blackbox routine of the TPM library directly, for access to more state transitions than are supported in this interface.
Boolean within(self, other, epsilon, units)
returns true if "other" is within "epsilon" of "self"
None _parsecoords(self)
Convert from input string into internal representation (decimal degrees) by invoking the appropriate type of Coord.
  _set_tpmstate(self)
Define the state for TPM based on equinox and system

Instance Variable Summary
Coord coord: a "smart" representation of the position
  equinox: at which the coordinates were specified
  input: the input used to create the Position
string system: celestial, galactic, ecliptic
string units: in which the coords were specified (degrees, radians)
(float,float) _internal: the internal representation of the position (decimal degrees)
integer _tpmstate: the TPM state of the position

Method Details

__init__(self, input, equinox='J2000', system='celestial', units='degrees')
(Constructor)

Parameters:
input - coordinates of the position
           (type=string (hh:mm:ss.ss +dd:mm:ss.sss) or tuple of numbers (dd.ddd, dd.ddd))
equinox - in which the coords are specified
           (type=string)
system - celestial, galactic, ecliptic, etc
           (type=string)
units - degrees or radians
           (type=string)
Returns:
Position

__repr__(self)
(Representation operator)

Returns:
string

angsep(self, other)

Computes the angular separation (great circle distance) between two Positions.
Parameters:
other - another Position
Returns:
angular separation
           (type=angsep.AngSep)

b1950(self, timetag=None)

Return the position in Mean FK4 B1950 coordinates
Parameters:
timetag - Timetag of returned coordinate
           (type=astrodate.AstroDate)
Returns:
(ra, dec) tuple in decimal degrees
           (type=(float,float))

dd(self)

Returns:
Position in decimal degrees
           (type=(float,float))

details(self)

Returns:
system & equinox
           (type=string)

ecliptic(self, timetag=None)

Return the position in IAU 1980 Ecliptic coordinates
Parameters:
timetag - Timetag of returned coordinate
           (type=astrodate.AstroDate)
Returns:
(le,be) tuple in decimal degrees
           (type=(float,float))

galactic(self, timetag=None)

Return the position in IAU 1958 Galactic coordinates.
Parameters:
timetag - Timetag of returned coordinate
           (type=astrodate.AstroDate)
Returns:
(l,b) tuple in decimal degrees
           (type=(float,float))

hmsdms(self)

Returns:
Position in hms dms
           (type=string)

j2000(self, timetag=None)

Return the position in Mean FK5 J2000 coordinates
Parameters:
timetag - Timetag of returned coordinate
           (type=astrodate.AstroDate)
Returns:
(ra, dec) tuple in decimal degrees
           (type=(float, float))

rad(self)

Returns:
Position in radians
           (type=(float,float))

tpmstate(self, endstate, epoch=None, equinox=None, timetag=None)

This method allows the expert user to call the blackbox routine of the TPM library directly, for access to more state transitions than are supported in this interface. Little documentation is provided here because it is assumed you know what you are doing if you need this routine.
Parameters:
endstate - as defined by the TPM state machine
           (type=integer)
epoch - in Julian date; default J2000
           (type=float)
equinox - in Julian date; default self._tpmequinox
           (type=float)
timetag - Timetag of returned coordinate
           (type=astrodate.AstroDate)
Returns:
transformed coordinates in decimal degrees
           (type=(float,float))

within(self, other, epsilon, units='arcsec')

returns true if "other" is within "epsilon" of "self"
Parameters:
other - Another position
           (type=Position)
epsilon - angular separation
           (type=angsep.AngSep or number)
units - of the angular separation, if it's specified as a number
           (type=string ('arcsec','degrees'))
Returns:
Boolean

_parsecoords(self)

Convert from input string into internal representation (decimal degrees) by invoking the appropriate type of Coord. Default float values will be interpreted as decimal degrees; radians will have to be specified as such.

Legitimate units: hmsdms, decimal degrees, radians
  • hmsdms = "hh:mm:ss.ss -dd:mm:ss.ss"
  • decimal degrees = (ddd.dd, -ddd.dd)
  • radians = (rr.rr, rr.rr)
Returns:
None

To Do: add support for 3vectors ("xx.xxx yy.yyy zz.zzz")

_set_tpmstate(self)

Define the state for TPM based on equinox and system

Instance Variable Details

coord

a "smart" representation of the position
Type:
Coord

equinox

at which the coordinates were specified

input

the input used to create the Position

system

celestial, galactic, ecliptic
Type:
string

units

in which the coords were specified (degrees, radians)
Type:
string

_internal

the internal representation of the position (decimal degrees)
Type:
(float,float)

_tpmstate

the TPM state of the position
Type:
integer

Generated by Epydoc 2.1 on Mon Feb 12 15:01:04 2007 http://epydoc.sf.net