Definition at line 1630 of file drivectrl.cc.
References Local::az, PointingModel::CalcPointingPos(), data, RaDec::dec, dev, Drive::DimTPoint::fCenterMag, Drive::DimTPoint::fCenterX, Drive::DimTPoint::fCenterY, Drive::DimTPoint::fDec, Drive::DimTPoint::fDx, Drive::DimTPoint::fDy, Drive::DimTPoint::fFeedbackAz, Drive::DimTPoint::fFeedbackZd, Drive::DimTPoint::fNominalAz, Drive::DimTPoint::fNominalZd, Drive::DimTPoint::fNumLeds, Drive::DimTPoint::fNumRings, Drive::DimTPoint::fPointingAz, Drive::DimTPoint::fPointingZd, Drive::DimTPoint::fRa, Drive::DimTPoint::fRealMag, Drive::DimTPoint::fRotation, Drive::DimTPoint::fStarMag, Drive::DimTPoint::fStarX, Drive::DimTPoint::fStarY, EventImp::GetSize(), EventImp::GetTime(), Source::mag, Time::Mjd(), PointingData::mjd, PointingData::mount, Source::name, Time::NightAsInt(), PointingData::pointing, EventImp::Ptr(), RaDec::ra, PointingData::sky, PointingSetup::source, Time::UnixTime(), and Local::zd.
Referenced by StateMachineDrive< T, S >::StateMachineDrive().
1634 return T::GetCurrentState();
1638 return T::GetCurrentState();
1642 return T::GetCurrentState();
1649 const double *ptr = evt.
Ptr<
double>();
1652 const double dx = ptr[0] * M_PI/648000;
1653 const double dy = ptr[1] * M_PI/648000;
1657 const double x2 = dx*dx;
1658 const double y2 = 1 + dy*dy;
1660 const double sd = cos(data.
sky.
zd);
1661 const double cd = sin(data.
sky.
zd);
1662 const double sdf = sd*sqrt(x2+y2);
1663 const double r2 = cd*cd*y2 - sd*sd*x2;
1667 if (r2<0 || fabs(sdf)>=1)
1669 T::Warn(
"Could not determine pointing direction from TPoint.");
1670 return T::GetCurrentState();
1673 const double r = sqrt(r2);
1674 const double s = sdf - dy * r;
1675 const double c = sdf * dy + r;
1676 const double phi = atan2(dx, r);
1679 const double az = fmod(data.
sky.
az-phi + 2*M_PI, 2*M_PI);
1680 const double zd = M_PI/2 - atan2(s, c);
1689 const bool exist = boost::filesystem::exists(fname);
1691 ofstream fout(fname, ios::app);
1694 fout <<
"FACT Model TPOINT data file" << endl;
1695 fout <<
": ALTAZ" << endl;
1697 fout << evt.
GetTime() << endl;
1699 fout << setprecision(7);
1700 fout << fmod(az*180/M_PI+360, 360) <<
" ";
1701 fout << 90-zd*180/M_PI <<
" ";
1702 fout << fmod(data.
mount.
az+360, 360) <<
" ";
1703 fout << 90-data.
mount.
zd <<
" ";
1704 fout << dev.
az <<
" ";
1705 fout << -dev.
zd <<
" ";
1706 fout << 90-data.
sky.
zd * 180/M_PI <<
" ";
1707 fout << data.
sky.
az * 180/M_PI <<
" ";
1708 fout << setprecision(10);
1709 fout << data.
mjd <<
" ";
1710 fout << setprecision(7);
1711 fout << ptr[6] <<
" ";
1712 fout << ptr[9] <<
" ";
1713 fout << ptr[4] <<
" ";
1714 fout << ptr[5] <<
" ";
1715 fout << ptr[7] <<
" ";
1716 fout << ptr[8] <<
" ";
1717 fout << ptr[2] <<
" ";
1718 fout << ptr[3] <<
" ";
1719 fout << ptr[0] <<
" ";
1720 fout << ptr[1] <<
" ";
1721 fout << ptr[10] <<
" ";
1751 txt <<
"TPoint recorded [" << zd*180/M_PI <<
"/" << az*180/M_PI <<
" | " 1752 << data.
sky.
zd*180/M_PI <<
"/" << data.
sky.
az*180/M_PI <<
" | " 1754 << dx*180/M_PI <<
"/" << dy*180/M_PI <<
"]";
1757 return T::GetCurrentState();
PointingSetup fPointingSetup
Adds some functionality to boost::posix_time::ptime for our needs.
uint32_t NightAsInt() const
PointingData CalcPointingPos(const PointingSetup &setup, double _mjd, const Weather &weather, uint16_t timeout, bool tpoint=false)
virtual Time GetTime() const
PointingModel fPointingModel
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 dev
bool CheckEventSize(size_t has, const char *name, size_t size)
const T * Ptr(size_t offset=0) const
virtual size_t GetSize() const