Package astLib :: Module astCoords
[hide private]
[frames] | no frames]

Module astCoords

source code

module for coordinate manipulation (conversions, calculations etc.)

(c) 2007-2009 Matt Hilton

http://astlib.sourceforge.net

Functions [hide private]
float
hms2decimal(RAString, delimiter)
Converts a delimited string of Hours:Minutes:Seconds format into decimal degrees.
source code
float
dms2decimal(decString, delimiter)
Converts a delimited string of Degrees:Minutes:Seconds format into decimal degrees.
source code
string
decimal2hms(RADeg, delimiter)
Converts decimal degrees to string in Hours:Minutes:Seconds format with user specified delimiter.
source code
string
decimal2dms(decDeg, delimiter)
Converts decimal degrees to string in Degrees:Minutes:Seconds format with user specified delimiter.
source code
float
calcAngSepDeg(RADeg1, decDeg1, RADeg2, decDeg2)
Calculates the angular separation of two positions on the sky (specified in decimal degrees) in decimal degrees, assuming a tangent plane projection (so separation has to be <90 deg).
source code
list
convertCoords(inputSystem, outputSystem, coordX, coordY, epoch)
Converts specified coordinates (given in decimal degrees) between J2000, B1950, and Galactic.
source code
Function Details [hide private]

hms2decimal(RAString, delimiter)

source code 

Converts a delimited string of Hours:Minutes:Seconds format into decimal degrees.

Parameters:
  • RAString (string) - coordinate string in H:M:S format
  • delimiter (string) - delimiter character in RAString
Returns: float
coordinate in decimal degrees

dms2decimal(decString, delimiter)

source code 

Converts a delimited string of Degrees:Minutes:Seconds format into decimal degrees.

Parameters:
  • decString (string) - coordinate string in D:M:S format
  • delimiter (string) - delimiter character in decString
Returns: float
coordinate in decimal degrees

decimal2hms(RADeg, delimiter)

source code 

Converts decimal degrees to string in Hours:Minutes:Seconds format with user specified delimiter.

Parameters:
  • RADeg (float) - coordinate in decimal degrees
  • delimiter (string) - delimiter character in returned string
Returns: string
coordinate string in H:M:S format

decimal2dms(decDeg, delimiter)

source code 

Converts decimal degrees to string in Degrees:Minutes:Seconds format with user specified delimiter.

Parameters:
  • decDeg (float) - coordinate in decimal degrees
  • delimiter (string) - delimiter character in returned string
Returns: string
coordinate string in D:M:S format

calcAngSepDeg(RADeg1, decDeg1, RADeg2, decDeg2)

source code 

Calculates the angular separation of two positions on the sky (specified in decimal degrees) in decimal degrees, assuming a tangent plane projection (so separation has to be <90 deg).

Parameters:
  • RADeg1 (float) - R.A. in decimal degrees for position 1
  • decDeg1 (float) - dec. in decimal degrees for position 1
  • RADeg2 (float) - R.A. in decimal degrees for position 2
  • decDeg2 (float) - dec. in decimal degrees for position 2
Returns: float
angular separation in decimal degrees

convertCoords(inputSystem, outputSystem, coordX, coordY, epoch)

source code 

Converts specified coordinates (given in decimal degrees) between J2000, B1950, and Galactic.

Parameters:
  • inputSystem (string) - system of the input coordinates (either "J2000", "B1950" or "GALACTIC")
  • outputSystem (string) - system of the returned coordinates (either "J2000", "B1950" or "GALACTIC")
  • coordX (float) - longitude coordinate in decimal degrees, e.g. R. A.
  • coordY (float) - latitude coordinate in decimal degrees, e.g. dec.
  • epoch (float) - epoch of the input coordinates
Returns: list
coordinates in decimal degrees in requested output system