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

Поисковые слова: virgo cluster
lsst.coordConv: src/galCoordSys.cc Source File
lsst.coordConv  unknown
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
galCoordSys.cc
Go to the documentation of this file.
1 #include "coordConv/coordSys.h"
2 
3 namespace {
4 
5  // WARNING: this data is transposed from how it will be in the Eigen matrix
6  static double const _fromFK5J2000CArr[9] = {
7  -5.487553969571600e-02, +4.941094533056070e-01, -8.676661358478490e-01,
8  -8.734371079953150e-01, -4.448295894318790e-01, -1.980763861308200e-01,
9  -4.838349858369940e-01, +7.469822518105100e-01, +4.559837957210930e-01
10  };
11  static const Eigen::Map<const Eigen::Matrix3d> _fromFK5J2000RotMat(_fromFK5J2000CArr);
12 
13 }
14 
15 namespace coordConv {
16 
18  :
19  MeanCoordSys("gal", date)
20  {}
21 
23  return clone(getDate());
24  }
25 
26  CoordSys::Ptr GalCoordSys::clone(double date) const {
27  return CoordSys::Ptr(new GalCoordSys(date));
28  };
29 
30  Coord GalCoordSys::fromFK5J2000(Coord const &coord, Site const &site) const {
31  double const fromDate = 2000.0;
32  double const toDate = this->_date;
33 
34  // adjust space velocity
35  Eigen::Vector3d fk5J2000Pos = coord.getVecPos();
36  Eigen::Vector3d fk5J2000PM = coord.getVecPM();
37  Eigen::Vector3d adjIcrsPos = fk5J2000Pos + (fk5J2000PM * (toDate - fromDate));
38 
39  // convert position to galactic coordinates
40  Eigen::Vector3d galPos, galPM;
41  galPos = _fromFK5J2000RotMat * adjIcrsPos;
42  galPM = _fromFK5J2000RotMat * fk5J2000PM;
43 
44  return Coord(galPos, galPM);
45  }
46 
47  Coord GalCoordSys::toFK5J2000(Coord const &coord, Site const &site) const {
48  double const fromDate = this->_date;
49  double const toDate = 2000.0;
50 
51  // correct for velocity (proper motion and radial velocity)
52  Eigen::Vector3d galPos = coord.getVecPos();
53  Eigen::Vector3d galPM = coord.getVecPM();
54  Eigen::Vector3d adjGalPos = galPos + (galPM * (toDate - fromDate));
55 
56  // convert position to J2000 coordinates (by INVERSE rotation)
57  Eigen::Vector3d fk5J2000Pos, fk5J2000PM;
58  fk5J2000Pos = _fromFK5J2000RotMat.transpose() * adjGalPos;
59  fk5J2000PM = _fromFK5J2000RotMat.transpose() * galPM;
60 
61  return Coord(fk5J2000Pos, fk5J2000PM);
62  }
63 
64  std::string GalCoordSys::__repr__() const {
65  std::ostringstream os;
66  os << "GalCoordSys(" << getDate() << ")";
67  return os.str();
68  }
69 
70 }
virtual std::string __repr__() const
Definition: galCoordSys.cc:64
Eigen::Vector3d const getVecPM() const
Definition: coord.h:142
double getDate(bool zeroIfCurrent=true) const
Definition: coordSys.h:86
boost::shared_ptr< CoordSys > Ptr
Definition: coordSys.h:32
double _date
name of coordinate system
Definition: coordSys.h:249
virtual CoordSys::Ptr clone() const
Definition: galCoordSys.cc:22
virtual Coord toFK5J2000(Coord const &coord, Site const &site) const
Definition: galCoordSys.cc:47
Eigen::Vector3d const getVecPos() const
Definition: coord.h:135
virtual Coord fromFK5J2000(Coord const &coord, Site const &site) const
Definition: galCoordSys.cc:30
GalCoordSys(double date=0)
Definition: galCoordSys.cc:17