Changeset 15209 for trunk/FACT++


Ignore:
Timestamp:
03/31/13 02:51:04 (12 years ago)
Author:
tbretz
Message:
Updated to use new nova C++ wrapper
File:
1 edited

Legend:

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

    r15178 r15209  
    1 #include <libnova/solar.h>
    2 #include <libnova/lunar.h>
    3 #include <libnova/rise_set.h>
    4 #include <libnova/transform.h>
     1#include "externals/nova.h"
    52
    63#include "Database.h"
     
    123120    // ------------------ Eval config ---------------------
    124121
    125     const double lon = -(17.+53./60+26.525/3600);
    126     const double lat =   28.+45./60+42.462/3600;
    127 
    128     ln_lnlat_posn observer;
    129     observer.lng = lon;
    130     observer.lat = lat;
    131 
    132122    Time time;
    133123    if (conf.Has("date-time"))
     
    139129
    140130    // -12: nautical
    141     ln_rst_time sun_set;   // Sun set with the same date than th provided date
    142     ln_rst_time sun_rise;  // Sun rise on the following day
    143     ln_get_solar_rst_horizon(time.JD()-0.5, &observer, -12, &sun_set);
    144     ln_get_solar_rst_horizon(time.JD()+0.5, &observer, -12, &sun_rise);
     131    // Sun set with the same date than th provided date
     132    // Sun rise on the following day
     133    const Nova::RstTime sun_set  = Nova::GetSolarRst(time.JD()-0.5, -12);
     134    const Nova::RstTime sun_rise = Nova::GetSolarRst(time.JD()+0.5, -12);
    145135
    146136    const double jd  = floor(time.Mjd())+2400001;
     
    159149    // ------------------ Precalc moon coord ---------------------
    160150
    161     vector<pair<ln_equ_posn, double>> fMoonCoords;
     151    vector<pair<Nova::EquPosn, double>> fMoonCoords;
    162152
    163153    for (double h=0; h<1; h+=1./(24*12))
    164154    {
    165         ln_equ_posn  moon;
    166         ln_get_lunar_equ_coords_prec(jd+h, &moon, 0.01);
    167 
    168         const double disk = ln_get_lunar_disk(jd+h);
     155        const Nova::EquPosn moon = Nova::GetLunarEquCoords(jd+h, 0.01);
     156
     157        const double disk = Nova::GetLunarDisk(jd+h);
    169158
    170159        fMoonCoords.push_back(make_pair(moon, disk));
     
    260249        const string name = (*v)[0].c_str();
    261250
    262         ln_equ_posn pos;
     251        Nova::EquPosn pos;
    263252        pos.ra  = double((*v)[1])*15;
    264253        pos.dec = double((*v)[2]);
     
    298287
    299288            // get local position of source
    300             ln_hrz_posn hrz;
    301             ln_get_hrz_from_equ(&pos, &observer, jd+h, &hrz);
     289            const Nova::HrzPosn hrz = Nova::GetHrzFromEqu(pos, jd+h);
    302290
    303291            // Get moon properties and
    304             ln_equ_posn moon = fMoonCoords[i].first;
     292            const Nova::EquPosn moon = fMoonCoords[i].first;
    305293            const double disk = fMoonCoords[i].second;
    306294
    307             ln_hrz_posn hrzm;
    308             ln_get_hrz_from_equ(&moon, &observer, jd+h, &hrzm);
     295            const Nova::HrzPosn hrzm = Nova::GetHrzFromEqu(moon, jd+h);
     296
     297            if (v==res.begin())
     298                cout << Time(jd+h) <<" " << 90-hrzm.alt <<  endl;
    309299
    310300            // Distance between source and moon
Note: See TracChangeset for help on using the changeset viewer.