Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/coordConv/html/namespacecoord_conv.html
Дата изменения: Thu May 7 21:42:46 2015
Дата индексирования: Sun Apr 10 03:06:08 2016
Кодировка:

Поисковые слова: south pole
lsst.coordConv: coordConv Namespace Reference
lsst.coordConv  unknown
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Namespaces | Classes | Enumerations | Functions | Variables
coordConv Namespace Reference

Namespaces

 testUtils
 
 version
 

Classes

class  Coord
 
class  CoordSys
 
class  MeanCoordSys
 
class  ApparentCoordSys
 
class  ICRSCoordSys
 
class  FK5CoordSys
 
class  FK4CoordSys
 
class  GalCoordSys
 
class  AppGeoCoordSys
 
class  AppTopoCoordSys
 
class  ObsCoordSys
 
class  OtherCoordSys
 
class  NoneCoordSys
 
class  PVT
 
class  PVTCoord
 
class  Site
 

Enumerations

enum  DateTypeEnum { DateType_Julian, DateType_Besselian, DateType_TAI, DateType_None }
 

Functions

bool angSideAng (double &angA, double &sideB, double &angC, double sideA, double angB, double sideC)
 
Coord appGeoFromAppTopo (Coord const &appTopoCoord, Site const &site, double tai)
 
Coord appTopoFromAppGeo (Coord const &appGeoCoord, Site const &site, double tai)
 
Coord appTopoFromObs (Coord const &obsCoord, Site const &site)
 
void azAltFromHADec (Eigen::Vector3d &azAlt, Eigen::Vector3d const &haDec, double lat)
 
double distanceFromParallax (double parallax)
 
double parallaxFromDistance (double dist)
 
std::ostream & operator<< (std::ostream &out, Coord const &coord)
 
CoordSys::Ptr makeCoordSys (std::string const &name, double date)
 
std::ostream & operator<< (std::ostream &out, CoordSys const &coordSys)
 
void haDecFromAzAlt (Eigen::Vector3d &haDec, Eigen::Vector3d const &azAlt, double lat)
 
void rot2D (double &rotX, double &rotY, double x, double y, double ang)
 
double wrapPos (double ang)
 
double wrapCtr (double ang)
 
double wrapNear (double ang, double refAng)
 
double hypot (double x, double y)
 
double sind (double ang)
 sine of angle in degrees More...
 
double cosd (double ang)
 cosine of angle in degrees More...
 
double tand (double ang)
 tangent of angle in degrees More...
 
double asind (double x)
 arcsine in degrees More...
 
double acosd (double x)
 arccosine in degrees More...
 
double atand (double x)
 arctangent in degrees More...
 
double atan2d (double x, double y)
 arctangent2 in degrees More...
 
bool polarFromXY (double &r, double &theta, double x, double y)
 
void xyFromPolar (double &x, double &y, double r, double theta)
 
void computeRotationMatrix (Eigen::Matrix3d &rotMat, Eigen::Vector3d const &axis, double rotAngle)
 
Coord obsFromAppTopo (Coord const &appTopoCoord, Site const &site)
 
bool polarFromXY (PVT &r, PVT &theta, PVT const &x, PVT const &y, double tai)
 
void xyFromPolar (PVT &x, PVT &y, PVT const &r, PVT const &theta, double tai)
 
void rot2D (PVT &rotX, PVT &rotY, PVT const &x, PVT const &y, double ang, double tai)
 
PVT wrapPos (PVT const &pvt)
 
PVT wrapCtr (PVT const &pvt)
 
std::ostream & operator<< (std::ostream &os, PVT const &pvt)
 
std::ostream & operator<< (std::ostream &os, PVTCoord const &pvtCoord)
 
void rotEqPol (Eigen::Vector3d &toVec, Eigen::Vector3d const &fromVec, double eqAng, double polarAng)
 
void rotXY (Eigen::Vector3d &toVec, Eigen::Vector3d const &fromVec, double xAng, double yAng)
 
std::ostream & operator<< (std::ostream &out, Site const &site)
 
double lastFromTAI (double tai, Site const &site)
 
double julianEpochFromTAI (double mjdSec)
 
double taiFromJulianEpoch (double julianEpoch)
 
double besselianEpochFromTAI (double mjdSec)
 
double taiFromBesselianEpoch (double besselianEpoch)
 

Variables

const double MinParallax = 1e-7
 
const double DeltaTForPos = 0.01
 by computing position at two nearby times (sec) More...
 
const double DoubleEpsilon = std::numeric_limits<double>::epsilon()
 
const double DoubleMax = std::numeric_limits<double>::max()
 
const double DoubleMin = std::numeric_limits<double>::min()
 
const double DoubleNaN = std::numeric_limits<double>::quiet_NaN()
 
const double Pi = std::atan(1.0)*4
 
const double HoursPerDeg = 24.0 / 360.0
 
const double RadPerDeg = Pi / 180.0
 
const double KmPerAU = 149597871.0
 
const double AUPerParsec = 206264.8062470964
 
const double ArcsecPerDeg = 3600.0
 
const double SecPerDay = 24.0 * 3600.0
 
const double DaysPerYear = 365.25
 
const double VLight = 299792.458 / KmPerAU
 
const double DegK_DegC = 273.15
 
const double MJD_UnixTime = 40587 * SecPerDay
 
const double MJDJ2000 = 51544.5
 
const double AngstromsPerMicron = 1.0e4
 
const double PascalsPerMillibar = 100.0
 
const double TT_TAI = 32.184
 
const double SiderealPerSolar = 1.00273790934
 

Enumeration Type Documentation

Enumerator
DateType_Julian 

Julian years.

DateType_Besselian 

Besselian years.

DateType_TAI 

TAI (MJD, seconds)

DateType_None 

date is irrelevant

Definition at line 18 of file coordSys.h.

Function Documentation

double coordConv::acosd ( double  x)
inline

arccosine in degrees

Definition at line 64 of file mathUtils.h.

bool coordConv::angSideAng ( double &  angA,
double &  sideB,
double &  angC,
double  sideA,
double  angB,
double  sideC 
)

Solve for two sides and the included angle of a spherical triangle

Parameters
[out]angAinterior angle opposite side A (deg)
[out]sideBlength of side B (deg)
[out]angCinterior angle opposite side C (deg)
[in]sideAlength of side A (deg)
[in]angBinterior angle opposite side B (deg)
[in]sideClength of side C (deg)
Returns
unknownAng: if true: sideB is so near 0 or 180 (see Special Cases below) that angA and angC cannot not be computed; angA and angC are set to 90 (hence their sum is 180, which is essentially correct) and sideB will be 0 or 180 (again, essentially correct).
Exceptions
runtime_errorif the inputs are too small to allow computation

Special Cases (in the order they are handled):

sideA angB sideC angA sideB angC

~0 any ~0 unknown(90) 0 unknown(90) ~0 any ~180 unknown(90) 180 unknown(90) ~0 any !pole 0 sideC 180-angB

~180 any ~0 unknown(90) 180 unknown(90) ~180 any ~180 unknown(90) 0 unknown(90) ~180 any !pole 180 180-sideC angB

!pole any ~0 180-angB sideA 0 !pole any ~180 angB 180-sideA 180

any ~0 ~=sideA unknown(90) 0 unknown(90) any ~0 <sideA 180 sideA-sideC 0 any ~0 >sideA 0 sideC-sideA 180

where:

  • !pole means not nearly 0 and not nearly 180 (modulo 360)
  • unknown(90) means unknownAng = true is returned
  • All relations are modulo 360. For example ~0 means approximately zero, 360, etc.
Note
: allowing angles in the 3rd and 4th quadrants is unusual.

References: Selby, Standard Math Tables, crc, 15th ed, 1967, p161 (Spherical Trig.)

Definition at line 9 of file angSideAng.cc.

Coord coordConv::appGeoFromAppTopo ( Coord const &  appTopoCoord,
Site const &  site,
double  tai 
)

Convert apparent geocentric coordinates to apparent topocentric at a specified date

Parameters
[in]appTopoCoordapparent topocentric coord at the specified TAI date
[in]sitesite information
[in]taiTAI date (MJD, sec)
Returns
position in apparent topocentric coordinates at the specified TAI date

Definition at line 8 of file appGeoFromAppTopo.cc.

Coord coordConv::appTopoFromAppGeo ( Coord const &  appGeoCoord,
Site const &  site,
double  tai 
)

Convert apparent geocentric coordinates to apparent topocentric at a specified date

Parameters
[in]appGeoCoordapparent geocentric coord at the specified TAI date
[in]sitesite information
[in]taiTAI date (MJD, sec)
Returns
position in apparent geocentric coordinates at the specified TAI date

Definition at line 8 of file appTopoFromAppGeo.cc.

Coord coordConv::appTopoFromObs ( Coord const &  obsCoord,
Site const &  site 
)

Convert observed coordinates (refracted apparent topocentric) to apparent topocentric coordinates

Parameters
[in]obsCoordobserved (refracted apparent topocentric) coord
[in]sitesite information; refCoA and refCoB are read
Returns
position in observed coordinates

Definition at line 7 of file appTopoFromObs.cc.

double coordConv::asind ( double  x)
inline

arcsine in degrees

Definition at line 61 of file mathUtils.h.

double coordConv::atan2d ( double  x,
double  y 
)
inline

arctangent2 in degrees

Definition at line 70 of file mathUtils.h.

double coordConv::atand ( double  x)
inline

arctangent in degrees

Definition at line 67 of file mathUtils.h.

void coordConv::azAltFromHADec ( Eigen::Vector3d &  azAlt,
Eigen::Vector3d const &  haDec,
double  lat 
)

Convert HA/Dec position to Alt/Az.

Parameters
[out]azAltcartesian Az/Alt (same units as haDec); Sign convention: (1,0,0) is south, (0,1,0) is east.
[in]haDeccartesian -HA, Dec (any units)
[in]latlatitude (degrees)

Definition at line 6 of file azAltFromHADec.cc.

double coordConv::besselianEpochFromTAI ( double  mjdSec)

Convert TAI (MJD seconds) to Besselian epoch

Parameters
[in]mjdSecMJD date (sec)

Definition at line 39 of file time.cc.

void coordConv::computeRotationMatrix ( Eigen::Matrix3d &  rotMat,
Eigen::Vector3d const &  axis,
double  rotAngle 
)

Compute a rotation matrix given an axis and rotation angle

Parameters
[out]rotMatrotation matrix
[in]axisaxis of rotation (magnitude is ignored, but must be finite and nonzero)
[in]rotAnglerotation angle (deg)

Definition at line 33 of file mathUtils.cc.

double coordConv::cosd ( double  ang)
inline

cosine of angle in degrees

Definition at line 55 of file mathUtils.h.

double coordConv::distanceFromParallax ( double  parallax)

Definition at line 12 of file coord.cc.

void coordConv::haDecFromAzAlt ( Eigen::Vector3d &  haDec,
Eigen::Vector3d const &  azAlt,
double  lat 
)

Convert Az/Alt position to HA/Dec

Parameters
[out]haDeccartesian -HA, Dec (same units as azAlt)
[in]azAltcartesian Az/Alt (any units) Sign convention: (1,0,0) is south, (0,1,0) is east.
[in]latlatitude (degrees)

Compute HA/Dec position from alt/az position

Parameters
[out]haDeccartesian -HA, Dec (same units as azAlt)
[in]latlatitude (degrees)
[in]azAltcartesian Az/Alt (any units) Sign convention: (1,0,0) is south, (0,1,0) is east.

Definition at line 14 of file haDecFromAzAlt.cc.

double coordConv::hypot ( double  x,
double  y 
)

Hypotenuse function (also present in C++11, which I'm not using yet)

Parameters
[in]x,y:sides of right triangle
Returns
hypotenuse of right triangle

Definition at line 8 of file mathUtils.cc.

double coordConv::julianEpochFromTAI ( double  mjdSec)

Convert TAI (MJD seconds) to Julian epoch

Parameters
[in]mjdSecMJD date (sec)

Definition at line 31 of file time.cc.

double coordConv::lastFromTAI ( double  tai,
Site const &  site 
)

Compute local apparent sidereal time from TAI

Parameters
[in]taiuniversal time (MJD, seconds)
[in]sitesite information (a coordConv::Site) read fields: ut1_tai, longitude
Returns
Local mean sidereal time, in degrees, in range [0, 360)

Definition at line 18 of file time.cc.

CoordSys::Ptr coordConv::makeCoordSys ( std::string const &  name,
double  date 
)

Return a coordinate system given its name

Parameters
[in]namename of coordinate system (case matters)
[in]datedate of coordinate system (units depend on the coordinate system); if 0 then the coordSys is current, except FK4 defaults to 1950 and FK5 defaults to 2000
Returns
the specified coordinate system at the specified date
Exceptions
std::invalid_argument(ValueError in python) if name is not recognized.
Warning
this will not construct an OtherCoordSys, since those have arbitary names (but it will construct a NoneCoordSys)

Definition at line 74 of file coordSys.cc.

Coord coordConv::obsFromAppTopo ( Coord const &  appTopoCoord,
Site const &  site 
)

Convert apparent topocentric coordinates to observed (refracted apparent topocentric)

Parameters
[in]appTopoCoordapparent topocentric coord
[in]sitesite information; refCoA and refCoB are read
Returns
position in observed coordinates

Definition at line 7 of file obsFromAppTopo.cc.

std::ostream & coordConv::operator<< ( std::ostream &  out,
Site const &  site 
)

Definition at line 82 of file site.cc.

std::ostream & coordConv::operator<< ( std::ostream &  os,
PVTCoord const &  pvtCoord 
)

Definition at line 191 of file pvtCoord.cc.

std::ostream & coordConv::operator<< ( std::ostream &  out,
Coord const &  coord 
)

Definition at line 263 of file coord.cc.

std::ostream & coordConv::operator<< ( std::ostream &  os,
PVT const &  pvt 
)

Append a formatted PVT to a stream

The format is:

PVT(pos, vel, time)

where all values are shown in decimal format (rather than exponential notation):

  • pos and vel are shown to 7 digits after the decimal point (0.0003 arcsec resolution)
  • time is shown to 6 digits (because time is commonly given to the nearest microsecond)
Parameters
[in,out]osstream to which to append the formatted value
[in]pvtPVT to format and append to the stream

Definition at line 49 of file pvt.cc.

std::ostream & coordConv::operator<< ( std::ostream &  out,
CoordSys const &  coordSys 
)

Definition at line 98 of file coordSys.cc.

double coordConv::parallaxFromDistance ( double  dist)

Definition at line 16 of file coord.cc.

bool coordConv::polarFromXY ( double &  r,
double &  theta,
double  x,
double  y 
)

Convert cartesian coordinates to polar coordinates.

Parameters
[out]rmagnitude of vector (same units as "x" and "y")
[out]thetaangle of vector (degrees) 0 along x, 90 along y and in the range (-180, 180)
[in]xx component of vector (arbitrary units)
[in]yy component of vector (same units as "x")
Returns
true if |r| is so small that theta cannot be computed and sets theta to 0

Definition at line 14 of file mathUtils.cc.

bool coordConv::polarFromXY ( PVT &  r,
PVT &  theta,
PVT const &  x,
PVT const &  y,
double  tai 
)

Convert cartesian coordinates to polar coordinates.

Parameters
[out]rmagnitude of vector (same units as "x" and "y")
[out]thetaangle of vector (degrees) 0 along x, 90 along y and in the range (-180, 180)
[in]xx component of vector (arbitrary units)
[in]yy component of vector (same units as "x")
[in]taiTAI date (MJD, sec)
Returns
true if |r| is so small that theta cannot be computed and sets theta to 0

Definition at line 17 of file pvt.cc.

void coordConv::rot2D ( double &  rotX,
double &  rotY,
double  x,
double  y,
double  ang 
)
inline

Rotate a 2-dimensional vector by a given angle.

Parameters
[out]rotXrotated x value
[out]rotYrotated y value
[in]x:unrotated x value
[in]y:unrotated y value
[in]ang:angle by which to rotate (deg)

Using rot2D to change coordinate systems: Given a coordinate system A and a coordinate system B, such that:

  • B's origin is at B_A_xy in A
  • B's orientation is B_A_ang in A Then a point P can be transformed as follows between these systems:
  • P_B_xy = rot2D(P_A_xy - B_A_xy, -B_A_ang)
  • P_A_xy = B_A_xy + rot2D(P_B_xy, +B_A_ang)

Definition at line 12 of file mathUtils.cc.

void coordConv::rot2D ( PVT &  rotX,
PVT &  rotY,
PVT const &  x,
PVT const &  y,
double  ang,
double  tai 
)

Rotate a 2-dimensional PVT vector by a given angle.

Parameters
[out]rotXrotated x value
[out]rotYrotated y value
[in]x:unrotated x value
[in]y:unrotated y value
[in]ang:angle by which to rotate (deg)
[in]taiTAI date (MJD, sec)

Using rot2D to change coordinate systems: Given a coordinate system A and a coordinate system B, such that:

  • B's origin is at B_A_xy in A
  • B's orientation is B_A_ang in A Then a point P can be transformed as follows between these systems:
  • P_B_xy = rot2D(P_A_xy - B_A_xy, -B_A_ang)
  • P_A_xy = B_A_xy + rot2D(P_B_xy, +B_A_ang)

Definition at line 39 of file pvt.cc.

void coordConv::rotEqPol ( Eigen::Vector3d &  toVec,
Eigen::Vector3d const &  fromVec,
double  eqAng,
double  polarAng 
)

Rotate a 3-vector described by equatorial and polar angles, as follows: The plane of rotation contains the z axis and a line in the x-y plane at angle eqAng from the x axis towards y. The amount of rotation is angle polarAng from the z axis towards the line in the x-y plane.

Parameters
[out]toVecrotated 3-vector
[in]fromVecinput 3-vector
[in]eqAngangle of line in x-y plane (from x to y); the plane of rotation includes this line and z
[in]polarAngangle of rotation (from z axis to line in x-y plane)

Definition at line 5 of file rotEqPol.cc.

void coordConv::rotXY ( Eigen::Vector3d &  toVec,
Eigen::Vector3d const &  fromVec,
double  xAng,
double  yAng 
)

Rotate a 3-vector, first about the x axis, then about the y axis. Warning: toVec cannot replace fromVec

Inputs:

Parameters
[out]toVecrotated 3-vector
[in]fromVecinput 3-vector
[in]xAngangle about x axis (deg); positive rotation is from y to z.
[in]yAngangle about original y axis (deg); positive rotation is from z to x.

Definition at line 5 of file rotXY.cc.

double coordConv::sind ( double  ang)
inline

sine of angle in degrees

Definition at line 52 of file mathUtils.h.

double coordConv::taiFromBesselianEpoch ( double  besselianEpoch)

Convert Besselian epoch to TAI (MJD seconds)

Parameters
[in]besselianEpochdate as a Besselian epoch (years)

Definition at line 43 of file time.cc.

double coordConv::taiFromJulianEpoch ( double  julianEpoch)

Convert Julian epoch to TAI (MJD seconds)

Parameters
[in]julianEpochdate as a Julian epoch (years)

Definition at line 35 of file time.cc.

double coordConv::tand ( double  ang)
inline

tangent of angle in degrees

Definition at line 58 of file mathUtils.h.

double coordConv::wrapCtr ( double  ang)
inline

Compute angle wrapped into range: -180 <= wrapped ang < 180 deg

Parameters
[in]angangle to wrap (deg)
Returns
wrapped angle (deg)

Definition at line 33 of file mathUtils.cc.

PVT coordConv::wrapCtr ( PVT const &  pvt)
inline

Compute PVT angle wrapped into range [-180, 180) deg; only the pos differs

Parameters
pvtinput PVT angle (pos in deg)

Definition at line 244 of file pvt.h.

double coordConv::wrapNear ( double  ang,
double  refAng 
)
inline

Wrap one angle to be within 180 degrees of a reference angle: 180 <= wrapped ang - refAng < 180

Parameters
[in]angangle to wrap (deg)
[in]refAngresult is wrapped to be near this reference angle (deg)
Returns
wrapped angle (deg)

Definition at line 52 of file mathUtils.cc.

double coordConv::wrapPos ( double  ang)
inline

Compute angle wrapped into range: 0 <= wrapped ang < 360 deg

Parameters
[in]angangle to wrap (deg)
Returns
wrapped angle (deg)

Definition at line 20 of file mathUtils.cc.

PVT coordConv::wrapPos ( PVT const &  pvt)
inline

Compute PVT angle wrapped into range [0, 360) deg; only the pos differs

Parameters
pvtinput PVT angle (pos in deg)

Definition at line 233 of file pvt.h.

void coordConv::xyFromPolar ( double &  x,
double &  y,
double  r,
double  theta 
)

Convert polar coordinates to cartesian coordinates.

Parameters
[out]xx component of vector (same units as "r")
[out]yy component of vector (same units as "r")
[in]rmagnitude of vector (arbitrary units)
[in]thetaangle of vector from x axis (degrees)

Definition at line 28 of file mathUtils.cc.

void coordConv::xyFromPolar ( PVT &  x,
PVT &  y,
PVT const &  r,
PVT const &  theta,
double  tai 
)

Convert polar coordinates to cartesian coordinates.

Parameters
[out]xx component of vector (same units as "r")
[out]yy component of vector (same units as "r")
[in]rmagnitude of vector (arbitrary units)
[in]thetaangle of vector from x axis (degrees)
[in]taiTAI date (MJD, sec)

Definition at line 29 of file pvt.cc.

Variable Documentation

const double coordConv::AngstromsPerMicron = 1.0e4

Definition at line 31 of file physConst.h.

const double coordConv::ArcsecPerDeg = 3600.0

Definition at line 22 of file physConst.h.

const double coordConv::AUPerParsec = 206264.8062470964

Definition at line 21 of file physConst.h.

const double coordConv::DaysPerYear = 365.25

Definition at line 24 of file physConst.h.

const double coordConv::DegK_DegC = 273.15

Definition at line 26 of file physConst.h.

const double coordConv::DeltaTForPos = 0.01

by computing position at two nearby times (sec)

delta time to use when computing velocity

Definition at line 15 of file coordSys.h.

const double coordConv::DoubleEpsilon = std::numeric_limits<double>::epsilon()

Definition at line 13 of file mathUtils.h.

const double coordConv::DoubleMax = std::numeric_limits<double>::max()

Definition at line 14 of file mathUtils.h.

const double coordConv::DoubleMin = std::numeric_limits<double>::min()

Definition at line 15 of file mathUtils.h.

const double coordConv::DoubleNaN = std::numeric_limits<double>::quiet_NaN()

Definition at line 16 of file mathUtils.h.

const double coordConv::HoursPerDeg = 24.0 / 360.0

Definition at line 18 of file physConst.h.

const double coordConv::KmPerAU = 149597871.0

Definition at line 20 of file physConst.h.

const double coordConv::MinParallax = 1e-7

Definition at line 10 of file coord.h.

const double coordConv::MJD_UnixTime = 40587 * SecPerDay

Definition at line 27 of file physConst.h.

const double coordConv::MJDJ2000 = 51544.5

Definition at line 30 of file physConst.h.

const double coordConv::PascalsPerMillibar = 100.0

Definition at line 32 of file physConst.h.

const double coordConv::Pi = std::atan(1.0)*4

Definition at line 17 of file physConst.h.

const double coordConv::RadPerDeg = Pi / 180.0

Definition at line 19 of file physConst.h.

const double coordConv::SecPerDay = 24.0 * 3600.0

Definition at line 23 of file physConst.h.

const double coordConv::SiderealPerSolar = 1.00273790934

Definition at line 39 of file physConst.h.

const double coordConv::TT_TAI = 32.184

Definition at line 35 of file physConst.h.

const double coordConv::VLight = 299792.458 / KmPerAU

Definition at line 25 of file physConst.h.