- Timestamp:
- 03/30/13 16:38:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/InterpreterV8.cc
r15172 r15204 10 10 11 11 #ifdef HAVE_NOVA 12 #include <libnova/solar.h> 13 #include <libnova/lunar.h> 14 #include <libnova/transform.h> 12 #include "externals/nova.h" 15 13 #endif 16 14 … … 1658 1656 const Time utc = args.Length()==0 ? Time() : Time(v/1000, v%1000); 1659 1657 1660 return Number::New( ln_get_lunar_disk(utc.JD()));1658 return Number::New(Nova::GetLunarDisk(utc.JD())); 1661 1659 } 1662 1660 … … 1669 1667 return ThrowException(String::New("Argument must be a Date")); 1670 1668 1671 ln_hrz_posn hrz;1669 Nova::HrzPosn hrz; 1672 1670 hrz.alt = 90-GetDataMember(args, "zd"); 1673 1671 hrz.az = GetDataMember(args, "az"); … … 1686 1684 const Time utc(v/1000, v%1000); 1687 1685 1688 ln_lnlat_posn obs; 1689 obs.lng = -(17.+53./60+26.525/3600); 1690 obs.lat = 28.+45./60+42.462/3600; 1691 1692 ln_equ_posn equ; 1693 ln_get_equ_from_hrz(&hrz, &obs, utc.JD(), &equ); 1686 const Nova::EquPosn equ = Nova::GetEquFromHrz(hrz, utc.JD()); 1694 1687 1695 1688 // ----------------------------- … … 1707 1700 return ThrowException(String::New("Argument must be a Date")); 1708 1701 1709 ln_equ_posn equ;1702 Nova::EquPosn equ; 1710 1703 equ.ra = GetDataMember(args, "ra")*15; 1711 1704 equ.dec = GetDataMember(args, "dec"); … … 1724 1717 const Time utc(v/1000, v%1000); 1725 1718 1726 ln_lnlat_posn obs; 1727 obs.lng = -(17.+53./60+26.525/3600); 1728 obs.lat = 28.+45./60+42.462/3600; 1729 1730 ln_hrz_posn hrz; 1731 ln_get_hrz_from_equ(&equ, &obs, utc.JD(), &hrz); 1719 const Nova::HrzPosn hrz = Nova::GetHrzFromEqu(equ, utc.JD()); 1732 1720 1733 1721 Handle<Value> arg[] = { Number::New(90-hrz.alt), Number::New(hrz.az), date }; … … 1740 1728 return ThrowException(String::New("toLocal must not be called with arguments.")); 1741 1729 1742 ln_equ_posn equ;1730 Nova::EquPosn equ; 1743 1731 equ.ra = GetDataMember(args, "ra")*15; 1744 1732 equ.dec = GetDataMember(args, "dec"); … … 1756 1744 const Time utc(v/1000, v%1000); 1757 1745 1758 ln_lnlat_posn obs; 1759 obs.lng = -(17.+53./60+26.525/3600); 1760 obs.lat = 28.+45./60+42.462/3600; 1761 1762 ln_hrz_posn hrz; 1763 ln_get_hrz_from_equ(&equ, &obs, utc.JD(), &hrz); 1746 const Nova::HrzPosn hrz = Nova::GetHrzFromEqu(equ, utc.JD()); 1764 1747 1765 1748 Handle<Value> arg[] = { Number::New(90-hrz.alt), Number::New(hrz.az), date }; … … 1785 1768 const Time utc(v/1000, v%1000); 1786 1769 1787 ln_equ_posn equ; 1788 ln_get_lunar_equ_coords_prec(utc.JD(), &equ, 0.01); 1770 const Nova::EquPosn equ = Nova::GetLunarEquCoords(utc.JD(), 0.01); 1789 1771 1790 1772 // ---------------------------- … … 1879 1861 } 1880 1862 1881 Handle<Object> InterpreterV8::ConstructRiseSet(const Handle<Value> time, const ln_rst_time &rst, const bool &rc)1863 Handle<Object> InterpreterV8::ConstructRiseSet(const Handle<Value> time, const Nova::RstTime &rst, const bool &rc) 1882 1864 { 1883 1865 Handle<Object> obj = Object::New(); … … 1952 1934 const Time utc(v/1000, v%1000); 1953 1935 1954 ln_lnlat_posn obs; 1955 obs.lng = -(17.+53./60+26.525/3600); 1956 obs.lat = 28.+45./60+42.462/3600; 1957 1958 // get Julian day from local time 1959 const double JD = utc.JD(); 1936 Nova::LnLatPosn obs = Nova::ORM(); 1960 1937 1961 1938 ln_rst_time sun; 1962 const int rc = ln_get_solar_rst_horizon( JD-0.5, &obs, hrz, &sun);1939 const int rc = ln_get_solar_rst_horizon(utc.JD()-0.5, &obs, hrz, &sun); 1963 1940 Handle<Object> rst = ConstructRiseSet(date, sun, rc); 1964 1941 rst->Set(String::New("horizon"), Number::New(hrz)); … … 1984 1961 const Time utc(v/1000, v%1000); 1985 1962 1986 ln_lnlat_posn obs; 1987 obs.lng = -(17.+53./60+26.525/3600); 1988 obs.lat = 28.+45./60+42.462/3600; 1989 1990 // get Julian day from local time 1991 const double JD = utc.JD(); 1963 Nova::LnLatPosn obs = Nova::ORM(); 1992 1964 1993 1965 ln_rst_time moon; 1994 const int rc = ln_get_lunar_rst( JD-0.5, &obs, &moon);1966 const int rc = ln_get_lunar_rst(utc.JD()-0.5, &obs, &moon); 1995 1967 Handle<Object> rst = ConstructRiseSet(date, moon, rc); 1996 1968 return handle_scope.Close(rst);
Note:
See TracChangeset
for help on using the changeset viewer.