# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl PS-MOPS-JPLEPH.t'

use strict;
use warnings;

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test::More tests => 4;
BEGIN { use_ok('PS::MOPS::JPLEPH') };

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

#$o = modco_retrieve($inst, orbitId => 5);
#$o->q(1.252);
#$o->e(.382);
#$o->i(9.3);
#$o->node(252.1);
#$o->argPeri(185.6);
#$o->timePeri(53015.0);$o->hV(10.315);
#$o->epoch(52860.0);

my %orbit = (
    q => 1.252,
    e => .382,
    i => 9.3,
    node => 252.1,
    argPeri => 185.6,
    timePeri => 53015,
    hV => 10.315,
    epoch => 52860.0,
    objectName => 'foo',
);

my @inp = (
    obscode => '566',
    epoch => 54100,
    objectName => 'foo',
);

ok(defined(jpleph_calcEphemeris(@inp, orbit => \%orbit)), 'compute ephem');

my $stuff = jpleph_calcEphemeris(@inp, orbit => \%orbit, trails => 1, exposureTime_sec => 30);
ok(defined($stuff), 'compute trailed ephem');
ok($stuff->{length_deg} > 0, 'length > 0');
