Changeset 15202


Ignore:
Timestamp:
03/30/13 16:26:47 (12 years ago)
Author:
tbretz
Message:
Simplified using libnova with the new C++ wrapper. ln_get_solar_rst_horizon is kept, because a wrong value might be safety relevant, so we can keep the return value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Time.cc

    r15190 r15202  
    2828
    2929#ifdef HAVE_LIBNOVA
    30 #include <libnova/solar.h>
    31 #include <libnova/rise_set.h>
     30#include "../externals/nova.h"
    3231#endif
    3332
     
    308307{
    309308#ifdef HAVE_LIBNOVA
    310     const double lon = -(17.+53./60+26.525/3600);
    311     const double lat =   28.+45./60+42.462/3600;
    312 
    313     ln_lnlat_posn observer;
    314     observer.lng = lon;
    315     observer.lat = lat;
    316 
    317309    ln_rst_time sun_day;
    318     if (ln_get_solar_rst_horizon(JD()-0.5, &observer, horizon, &sun_day)==1)
     310    if (ln_get_solar_rst_horizon(JD()-0.5, &Nova::ORM(), horizon, &sun_day)==1)
    319311        throw runtime_error("ln_get_solar_rst_horizon reported the sun to be circumpolar at the coordinates of La Palma!");
    320312
     
    322314        return Time(sun_day.rise);
    323315
    324     if (ln_get_solar_rst_horizon(JD()-1.5, &observer, horizon, &sun_day)==1)
     316    if (ln_get_solar_rst_horizon(JD()-1.5, &Nova::ORM(), horizon, &sun_day)==1)
    325317        throw runtime_error("ln_get_solar_rst_horizon reported the sun to be circumpolar at the coordinates of La Palma!");
    326318
     
    346338{
    347339#ifdef HAVE_LIBNOVA
    348     const double lon = -(17.+53./60+26.525/3600);
    349     const double lat =   28.+45./60+42.462/3600;
    350 
    351     ln_lnlat_posn observer;
    352     observer.lng = lon;
    353     observer.lat = lat;
    354 
    355340    ln_rst_time sun_day;
    356     if (ln_get_solar_rst_horizon(JD()-0.5, &observer, horizon, &sun_day)==1)
     341    if (ln_get_solar_rst_horizon(JD()-0.5, &Nova::ORM(), horizon, &sun_day)==1)
    357342        throw runtime_error("ln_get_solar_rst_horizon reported the sun to be circumpolar at the coordinates of La Palma!");
    358343
     
    360345        return Time(sun_day.rise);
    361346
    362     if (ln_get_solar_rst_horizon(JD()+0.5, &observer, horizon, &sun_day)==1)
     347    if (ln_get_solar_rst_horizon(JD()+0.5, &Nova::ORM(), horizon, &sun_day)==1)
    363348        throw runtime_error("ln_get_solar_rst_horizon reported the sun to be circumpolar at the coordinates of La Palma!");
    364349
Note: See TracChangeset for help on using the changeset viewer.