FACT++  1.0
static void t_planet ( int *  status)
static

Definition at line 1479 of file palTest.c.

References palEl2ue(), palPertel(), palPertue(), palPlanel(), palPlanet(), palPlante(), palPlantu(), palPv2el(), palPv2ue(), palRdplan(), palUe2el(), palUe2pv(), viv(), vvd(), and vvec().

Referenced by main().

1479  {
1480  int j;
1481  double pv[6];
1482  double u[13];
1483  double expected1[6] = { 0., 0., 0., 0., 0., 0. };
1484  double expectedue1[13] = {
1485  1.000878908362435284, -0.3336263027874777288, 50000.,
1486  2.840425801310305210, 0.1264380368035014224, -0.2287711835229143197,
1487  -0.01301062595106185195, 0.5657102158104651697, 0.2189745287281794885,
1488  2.852427310959998500, -0.01552349065435120900,
1489  50000., 0.0
1490  };
1491  double expectedue2[13] = {
1492  1.00006, -4.856142884511782, 50000., 0.3, -0.2,
1493  0.1, -0.4520378601821727, 0.4018114312730424,
1494  -.3515850023639121, 0.3741657386773941,
1495  -0.2511321445456515, 50000., 0.
1496  };
1497  double expectedue3[13] = {
1498  1.000000000000000,
1499  -0.3329769417028020949,
1500  50100.,
1501  2.638884303608524597,
1502  1.070994304747824305,
1503  0.1544112080167568589,
1504  -0.2188240619161439344,
1505  0.5207557453451906385,
1506  0.2217782439275216936,
1507  2.852118859689216658,
1508  0.01452010174371893229,
1509  50100.,
1510  0.
1511  };
1512  double expectedpv[6] = {
1513  0.07944764084631667011, -0.04118141077419014775,
1514  0.002915180702063625400, -0.6890132370721108608e-6,
1515  0.4326690733487621457e-6, -0.1763249096254134306e-6,
1516  };
1517  double expectedpv2[6] = {
1518  1.947628959288897677,
1519  -1.013736058752235271,
1520  -0.3536409947732733647,
1521  2.742247411571786194e-8,
1522  1.170467244079075911e-7,
1523  3.709878268217564005e-8
1524  };
1525 
1526  double ra,dec,diam, r;
1527  int jform;
1528  double epoch, orbinc, anode, perih, aorq, e, aorl,
1529  dm;
1530 
1531  /* palEl2ue */
1532  palEl2ue ( 50000, 1, 49000, 0.1, 2, 0.2,
1533  3, 0.05, 3, 0.003312, u, &j );
1534  vvec( 13, u, expectedue1, "palEl2ue", status );
1535  viv ( j, 0, "palEl2ue", "J", status );
1536 
1537  /* palPertel */
1538  palPertel ( 2, 43000., 43200., 43000.,
1539  0.2, 3, 4, 5, 0.02, 6,
1540  &epoch, &orbinc, &anode, &perih, &aorq, &e, &aorl, &j );
1541  vvd ( epoch, 43200., 1e-10, "palPertel",
1542  "EPOCH", status );
1543  vvd ( orbinc, 0.1995661466545422381, 1e-7, "palPertel",
1544  "ORBINC", status );
1545  vvd ( anode, 2.998052737821591215, 1e-7, "palPertel",
1546  "ANODE", status );
1547  vvd ( perih, 4.009516448441143636, 1e-6, "palPertel",
1548  "PERIH", status );
1549  vvd ( aorq, 5.014216294790922323, 1e-7, "palPertel",
1550  "AORQ", status );
1551  vvd ( e, 0.02281386258309823607, 1e-7, "palPertel",
1552  "E", status );
1553  vvd ( aorl, 0.01735248648779583748, 1e-6, "palPertel",
1554  "AORL", status );
1555  viv ( j, 0, "palPertel", "J", status );
1556 
1557  /* palPertue */
1558  palPertue ( 50100, u, &j );
1559  vvec( 13, u, expectedue3, "palPertue", status );
1560  viv ( j, 0, "palPertue", "J", status );
1561 
1562  /* palPlanel */
1563  palPlanel ( 50600, 2, 50500, 0.1, 3, 5,
1564  2, 0.3, 4, 0, pv, &j );
1565  vvec( 6, pv, expectedpv2, "palPlanel", status );
1566  viv ( j, 0, "palPlanel", "J", status );
1567 
1568  /* palPlanet */
1569 
1570  palPlanet( 1e6, 0, pv, &j );
1571  vvec( 6, pv, expected1, "palPlanet 1", status );
1572  viv ( j, -1, "palPlanet", "J 1", status );
1573 
1574  palPlanet( 1e6, 9, pv, &j);
1575  viv ( j, -1, "palPlanet", "J 2", status );
1576 
1577  palPlanet ( -320000, 3, pv, &j );
1578  vvd ( pv[0], 0.9308038666827242603, 1e-11, "palPlanet",
1579  "pv[0] 3", status );
1580  vvd ( pv[1], 0.3258319040252137618, 1e-11, "palPlanet",
1581  "pv[1] 3", status );
1582  vvd ( pv[2], 0.1422794544477122021, 1e-11, "palPlanet",
1583  "pv[2] 3", status );
1584  vvd ( pv[3], -7.441503423889371696e-8, 1e-17, "palPlanet",
1585  "pv[3] 3", status );
1586  vvd ( pv[4], 1.699734557528650689e-7, 1e-17, "palPlanet",
1587  "pv[4] 3", status );
1588  vvd ( pv[5], 7.415505123001430864e-8, 1e-17, "palPlanet",
1589  "pv[5] 3", status );
1590  viv ( j, 1, "palPlanet", "J 3", status );
1591 
1592  palPlanet ( 43999.9, 1, pv, &j );
1593  vvd ( pv[0], 0.2945293959257422246, 1e-11, "palPlanet",
1594  "pv[0] 4", status );
1595  vvd ( pv[1], -0.2452204176601052181, 1e-11, "palPlanet",
1596  "pv[1] 4", status );
1597  vvd ( pv[2], -0.1615427700571978643, 1e-11, "palPlanet",
1598  "pv[2] 4", status );
1599  vvd ( pv[3], 1.636421147459047057e-7, 1e-18, "palPlanet",
1600  "pv[3] 4", status );
1601  vvd ( pv[4], 2.252949422574889753e-7, 1e-18, "palPlanet",
1602  "pv[4] 4", status );
1603  vvd ( pv[5], 1.033542799062371839e-7, 1e-18, "palPlanet",
1604  "pv[5] 4", status );
1605  viv ( j, 0, "palPlanet", "J 4", status );
1606 
1607  /* palPlante test would go here */
1608 
1609  palPlante ( 50600., -1.23, 0.456, 2, 50500.,
1610  0.1, 3., 5., 2., 0.3, 4.,
1611  0., &ra, &dec, &r, &j );
1612  vvd ( ra, 6.222958101333794007, 1e-6, "palPlante",
1613  "RA", status );
1614  vvd ( dec, 0.01142220305739771601, 1e-6, "palPlante",
1615  "DEC", status );
1616  vvd ( r, 2.288902494080167624, 1e-8, "palPlante",
1617  "R", status );
1618  viv ( j, 0, "palPlante", "J", status );
1619 
1620  u[0] = 1.0005;
1621  u[1] = -0.3;
1622  u[2] = 55000.;
1623  u[3] = 2.8;
1624  u[4] = 0.1;
1625  u[5] = -0.2;
1626  u[6] = -0.01;
1627  u[7] = 0.5;
1628  u[8] = 0.22;
1629  u[9] = 2.8;
1630  u[10] = -0.015;
1631  u[11] = 55001.;
1632  u[12] = 0;
1633 
1634  /* palPlantu */
1635 
1636  palPlantu ( 55001., -1.23, 0.456, u, &ra, &dec, &r, &j );
1637  vvd ( ra, 0.3531814831241686647, 1e-6, "palPlantu",
1638  "RA", status );
1639  vvd ( dec, 0.06940344580567131328, 1e-6, "palPlantu",
1640  "DEC", status );
1641  vvd ( r, 3.031687170873274464, 1e-8, "palPlantu",
1642  "R", status );
1643  viv ( j, 0, "palPlantu", "J", status );
1644 
1645  /* palPv2el */
1646 
1647  pv[0] = 0.3;
1648  pv[1] = -0.2;
1649  pv[2] = 0.1;
1650  pv[3] = -0.9e-7;
1651  pv[4] = 0.8e-7;
1652  pv[5] = -0.7e-7;
1653 
1654  palPv2el ( pv, 50000, 0.00006, 1,
1655  &jform, &epoch, &orbinc, &anode, &perih,
1656  &aorq, &e, &aorl, &dm, &j );
1657  viv ( jform, 1, "palPv2el", "JFORM", status );
1658  vvd ( epoch, 50000, 1e-10, "palPv2el",
1659  "EPOCH", status );
1660  vvd ( orbinc, 1.52099895268912, 1e-12, "palPv2el",
1661  "ORBINC", status );
1662  vvd ( anode, 2.720503180538650, 1e-12, "palPv2el",
1663  "ANODE", status );
1664  vvd ( perih, 2.194081512031836, 1e-12, "palPv2el",
1665  "PERIH", status );
1666  vvd ( aorq, 0.2059371035373771, 1e-12, "palPv2el",
1667  "AORQ", status );
1668  vvd ( e, 0.9866822985810528, 1e-12, "palPv2el",
1669  "E", status );
1670  vvd ( aorl, 0.2012758344836794, 1e-12, "palPv2el",
1671  "AORL", status );
1672  vvd ( dm, 0.1840740507951820, 1e-12, "palPv2el",
1673  "DM", status );
1674  viv ( j, 0, "palPv2el", "J", status );
1675 
1676  /* palPv2ue */
1677  palPv2ue ( pv, 50000., 0.00006, u, &j );
1678  vvec( 13, u, expectedue2, "palPv2ue", status );
1679  viv ( j, 0, "palPv2ue", "J", status );
1680 
1681  /* Planets */
1682  palRdplan ( 40999.9, 0, 0.1, -0.9, &ra, &dec, &diam );
1683  vvd ( ra, 5.772270359389275837, 1e-6, "palRdplan",
1684  "ra 0", status );
1685  vvd ( dec, -0.2089207338795416192, 1e-7, "palRdplan",
1686  "dec 0", status );
1687  vvd ( diam, 9.415338935229717875e-3, 1e-10, "palRdplan",
1688  "diam 0", status );
1689  palRdplan ( 41999.9, 1, 1.1, -0.9, &ra, &dec, &diam );
1690  vvd ( ra, 3.866363420052936653, 1e-6, "palRdplan",
1691  "ra 1", status );
1692  vvd ( dec, -0.2594430577550113130, 1e-7, "palRdplan",
1693  "dec 1", status );
1694  vvd ( diam, 4.638468996795023071e-5, 1e-14, "palRdplan",
1695  "diam 1", status );
1696  palRdplan ( 42999.9, 2, 2.1, 0.9, &ra, &dec, &diam );
1697  vvd ( ra, 2.695383203184077378, 1e-6, "palRdplan",
1698  "ra 2", status );
1699  vvd ( dec, 0.2124044506294805126, 1e-7, "palRdplan",
1700  "dec 2", status );
1701  vvd ( diam, 4.892222838681000389e-5, 1e-14, "palRdplan",
1702  "diam 2", status );
1703  palRdplan ( 43999.9, 3, 3.1, 0.9, &ra, &dec, &diam );
1704  vvd ( ra, 2.908326678461540165, 1e-7, "palRdplan",
1705  "ra 3", status );
1706  vvd ( dec, 0.08729783126905579385, 1e-7, "palRdplan",
1707  "dec 3", status );
1708  vvd ( diam, 8.581305866034962476e-3, 1e-7, "palRdplan",
1709  "diam 3", status );
1710  palRdplan ( 44999.9, 4, -0.1, 1.1, &ra, &dec, &diam );
1711  vvd ( ra, 3.429840787472851721, 1e-6, "palRdplan",
1712  "ra 4", status );
1713  vvd ( dec, -0.06979851055261161013, 1e-7, "palRdplan",
1714  "dec 4", status );
1715  vvd ( diam, 4.540536678439300199e-5, 1e-14, "palRdplan",
1716  "diam 4", status );
1717  palRdplan ( 45999.9, 5, -1.1, 0.1, &ra, &dec, &diam );
1718  vvd ( ra, 4.864669466449422548, 1e-6, "palRdplan",
1719  "ra 5", status );
1720  vvd ( dec, -0.4077714497908953354, 1e-7, "palRdplan",
1721  "dec 5", status );
1722  vvd ( diam, 1.727945579027815576e-4, 1e-14, "palRdplan",
1723  "diam 5", status );
1724  palRdplan ( 46999.9, 6, -2.1, -0.1, &ra, &dec, &diam );
1725  vvd ( ra, 4.432929829176388766, 1e-6, "palRdplan",
1726  "ra 6", status );
1727  vvd ( dec, -0.3682820877854730530, 1e-7, "palRdplan",
1728  "dec 6", status );
1729  vvd ( diam, 8.670829016099083311e-5, 1e-14, "palRdplan",
1730  "diam 6", status );
1731  palRdplan ( 47999.9, 7, -3.1, -1.1, &ra, &dec, &diam );
1732  vvd ( ra, 4.894972492286818487, 1e-6, "palRdplan",
1733  "ra 7", status );
1734  vvd ( dec, -0.4084068901053653125, 1e-7, "palRdplan",
1735  "dec 7", status );
1736  vvd ( diam, 1.793916783975974163e-5, 1e-14, "palRdplan",
1737  "diam 7", status );
1738  palRdplan ( 48999.9, 8, 0, 0, &ra, &dec, &diam );
1739  vvd ( ra, 5.066050284760144000, 1e-6, "palRdplan",
1740  "ra 8", status );
1741  vvd ( dec, -0.3744690779683850609, 1e-7, "palRdplan",
1742  "dec 8", status );
1743  vvd ( diam, 1.062210086082700563e-5, 1e-14, "palRdplan",
1744  "diam 8", status );
1745 
1746  /* palUe2el */
1747  palUe2el ( u, 1, &jform, &epoch, &orbinc, &anode, &perih,
1748  &aorq, &e, &aorl, &dm, &j );
1749  viv ( jform, 1, "palUe2el", "JFORM", status );
1750  vvd ( epoch, 50000.00000000000, 1e-10, "palUe2el",
1751  "EPOCH", status );
1752  vvd ( orbinc, 1.520998952689120, 1e-12, "palUe2el",
1753  "ORBINC", status );
1754  vvd ( anode, 2.720503180538650, 1e-12, "palUe2el",
1755  "ANODE", status );
1756  vvd ( perih, 2.194081512031836, 1e-12, "palUe2el",
1757  "PERIH", status );
1758  vvd ( aorq, 0.2059371035373771, 1e-12, "palUe2el",
1759  "AORQ", status );
1760  vvd ( e, 0.9866822985810528, 1e-12, "palUe2el",
1761  "E", status );
1762  vvd ( aorl, 0.2012758344836794, 1e-12, "palUe2el",
1763  "AORL", status );
1764  viv ( j, 0, "palUe2el", "J", status );
1765 
1766  /* palUe2pv */
1767  palUe2pv( 50010., u, pv, &j );
1768 
1769  /* Update the final two elements of the expecte UE array */
1770  expectedue2[11] = 50010.;
1771  expectedue2[12] = 0.7194308220038886856;
1772 
1773  vvec( 13, u, expectedue2, "palUe2pv", status );
1774  vvec( 6, pv, expectedpv, "palUe2pv", status );
1775  viv ( j, 0, "palUe2pv", "J", status );
1776 
1777 }
void palPertel(int jform, double date0, double date1, double epoch0, double orbi0, double anode0, double perih0, double aorq0, double e0, double am0, double *epoch1, double *orbi1, double *anode1, double *perih1, double *aorq1, double *e1, double *am1, int *jstat)
Definition: palPertel.c:171
void palPv2ue(const double pv[6], double date, double pmass, double u[13], int *jstat)
Definition: palPv2ue.c:114
void palPlante(double date, double elong, double phi, int jform, double epoch, double orbinc, double anode, double perih, double aorq, double e, double aorl, double dm, double *ra, double *dec, double *r, int *jstat)
Definition: palPlante.c:269
void palPertue(double date, double u[13], int *jstat)
Definition: palPertue.c:212
void palPv2el(const double pv[6], double date, double pmass, int jformr, int *jform, double *epoch, double *orbinc, double *anode, double *perih, double *aorq, double *e, double *aorl, double *dm, int *jstat)
Definition: palPv2el.c:201
void palPlanel(double date, int jform, double epoch, double orbinc, double anode, double perih, double aorq, double e, double aorl, double dm, double pv[6], int *jstat)
Definition: palPlanel.c:200
void palUe2el(const double u[13], int jformr, int *jform, double *epoch, double *orbinc, double *anode, double *perih, double *aorq, double *e, double *aorl, double *dm, int *jstat)
static void viv(int ival, int ivalok, const char *func, const char *test, int *status)
Definition: palTest.c:65
static void vvd(double val, double valok, double dval, const char *func, const char *test, int *status)
Definition: palTest.c:99
void palEl2ue(double date, int jform, double epoch, double orbinc, double anode, double perih, double aorq, double e, double aorl, double dm, double u[13], int *jstat)
Definition: palEl2ue.c:178
static void vvec(int len, double *vec, double *expected, const char *func, int *status)
Definition: palTest.c:173
void palRdplan(double date, int np, double elong, double phi, double *ra, double *dec, double *diam)
Definition: palRdplan.c:101
void palPlanet(double date, int np, double pv[6], int *j)
Definition: palPlanet.c:82
void palPlantu(double date, double elong, double phi, const double u[13], double *ra, double *dec, double *r, int *jstat)
Definition: palPlantu.c:126
void palUe2pv(double date, double u[13], double pv[], int *jstat)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: