PCL
EphemerisFile.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.1.19
6 // ----------------------------------------------------------------------------
7 // pcl/EphemerisFile.h - Released 2019-11-07T10:59:34Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2019 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (http://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_EphemerisFile_h
53 #define __PCL_EphemerisFile_h
54 
56 
57 #include <pcl/Defs.h>
58 
59 #include <pcl/Atomic.h>
60 #include <pcl/ChebyshevFit.h>
61 #include <pcl/File.h>
62 #include <pcl/Mutex.h>
63 #include <pcl/Optional.h>
64 #include <pcl/TimePoint.h>
65 
66 #ifdef __PCL_BUILDING_PIXINSIGHT_APPLICATION
67 namespace pi
68 {
69  class JSEphemerisFileObject;
70  class JSEphemerisHandleObject;
71 }
72 #endif
73 
74 namespace pcl
75 {
76 
77 // ----------------------------------------------------------------------------
78 
96 struct PCL_CLASS EphemerisMetadata
97 {
107 };
108 
109 // ----------------------------------------------------------------------------
110 
126 struct PCL_CLASS EphemerisConstant
127 {
129  double value;
130 
134  EphemerisConstant( const IsoString& n = IsoString(), double v = 0 ) :
135  name( n ), value( v )
136  {
137  }
138 
142  EphemerisConstant( const EphemerisConstant& ) = default;
143 
147  EphemerisConstant( EphemerisConstant&& ) = default;
148 
152  EphemerisConstant& operator =( const EphemerisConstant& ) = default;
153 
157  EphemerisConstant& operator =( EphemerisConstant&& ) = default;
158 
163  bool operator ==( const EphemerisConstant& x ) const
164  {
165  return name.CompareIC( x.name ) == 0;
166  }
167 
173  bool operator <( const EphemerisConstant& x ) const
174  {
175  return name.CompareIC( x.name ) < 0;
176  }
177 };
178 
191 
192 // ----------------------------------------------------------------------------
193 
215 {
221 
230 
235  startTime( t ),
236  expansion( T )
237  {
238  }
239 
244 
249 
253  SerializableEphemerisData& operator =( const SerializableEphemerisData& ) = default;
254 
258  SerializableEphemerisData& operator =( SerializableEphemerisData&& ) = default;
259 };
260 
279 
280 // ----------------------------------------------------------------------------
281 
309 {
321 
337 
347 
353 
362  SerializableEphemerisDataList data[ 2 ];
363 
364  /*
365  * Absolute magnitude. H is the visual magnitude of the object as seen at 1
366  * au of the Earth, 1 au from the Sun, and with a phase angle of 0 degrees.
367  *
368  * <b>References</b>
369  *
370  * E. Bowell et al., <em>Asteroids II</em>, R. P. Binzel et al. (eds.), The
371  * University of Arizona Press, Tucson, 1989, pp. 549-554.
372  *
373  * Urban, Sean E., Kenneth Seidelmann, P., ed. (2013), <em>The Explanatory
374  * Supplement to the Astronomical Almanac</em> 3rd Edition, Section 10.4.3.
375  */
377 
378  /*
379  * Slope parameter. See the H data member for references.
380  */
382 
383  /*
384  * Color index B-V in magnitudes.
385  */
386  Optional<double> B_V;
387 
388  /*
389  * Diameter of the object in km.
390  */
392 
397  const IsoString& origin,
398  const String& name = String(),
399  const String& desc = String() ) :
400  objectId( id.Trimmed() ),
401  originId( origin.Trimmed() ),
402  objectName( name.Trimmed() ),
403  description( desc )
404  {
405  }
406 
411 
416 
421 
426 };
427 
434 
435 // ----------------------------------------------------------------------------
436 
451 struct PCL_CLASS EphemerisObject
452 {
465 
479 
487 
492 
506 
511 
516 
521 
525  EphemerisObject( const IsoString& objectId_,
526  const IsoString& originId_,
527  const String& objectName_ = String(),
528  const String& objectDescription_ = String(),
533  objectId( objectId_ ),
534  originId( originId_ ),
535  objectName( objectName_ ),
536  objectDescription( objectDescription_ ),
537  H( H_ ),
538  G( G_ ),
539  B_V( B_V_ ),
540  D( D_ )
541  {
542  }
543 
547  EphemerisObject( const EphemerisObject& ) = default;
548 
552  EphemerisObject( EphemerisObject&& ) = default;
553 
557  EphemerisObject& operator =( const EphemerisObject& ) = default;
558 
562  EphemerisObject& operator =( EphemerisObject&& ) = default;
563 };
564 
571 
572 // ----------------------------------------------------------------------------
573 
613 class PCL_CLASS EphemerisFile
614 {
615 public:
616 
624  {
625  }
626 
634  EphemerisFile( const String& filePath )
635  {
636  Open( filePath );
637  }
638 
643  m_file( std::move( x.m_file ) ),
644  m_startTime( x.m_startTime ),
645  m_endTime( x.m_endTime ),
646  m_constants( std::move( x.m_constants ) ),
647  m_index( std::move( x.m_index ) )
648  {
649  }
650 
654  EphemerisFile& operator =( EphemerisFile&& x )
655  {
656  m_file = std::move( x.m_file );
657  m_startTime = x.m_startTime;
658  m_endTime = x.m_endTime;
659  m_constants = std::move( x.m_constants );
660  m_index = std::move( x.m_index );
661  return *this;
662  }
663 
668  EphemerisFile( const EphemerisFile& ) = delete;
669 
674  EphemerisFile& operator =( const EphemerisFile& ) = delete;
675 
679  virtual ~EphemerisFile() noexcept( false );
680 
698  void Open( const String& filePath );
699 
713  void Close();
714 
719  bool IsOpen() const
720  {
721  return m_file.IsOpen();
722  }
723 
728  const String& FilePath() const
729  {
730  return m_file.FilePath();
731  }
732 
739  {
740  return m_startTime;
741  }
742 
748  {
749  return m_endTime;
750  }
751 
764  const EphemerisConstantList& Constants() const
765  {
766  return m_constants;
767  }
768 
773  bool IsConstantAvailable( const IsoString& name ) const
774  {
775  return BinarySearch( m_constants.Begin(), m_constants.End(),
776  EphemerisConstant( name ) ) != m_constants.End();
777  }
778 
786  double ConstantValue( const IsoString& name ) const
787  {
789  BinarySearch( m_constants.Begin(), m_constants.End(), EphemerisConstant( name ) );
790  if ( i == m_constants.End() )
791  throw Error( "Undefined ephemeris constant '" + name + '\'' );
792  return i->value;
793  }
794 
802  EphemerisObjectList Objects() const
803  {
804  EphemerisObjectList objects;
805  for ( const Index& ix : m_index )
806  objects << EphemerisObject( ix.objectId, ix.originId,
807  ix.objectName, ix.objectDescription,
808  ix.H, ix.G, ix.B_V, ix.D );
809  return objects;
810  }
811 
835  bool IsObjectAvailable( const IsoString& object, const IsoString& origin = IsoString() ) const
836  {
837  Array<Index>::const_iterator i = BinarySearch( m_index.Begin(), m_index.End(), Index( object, origin ) );
838  if ( i != m_index.End() )
839  return true;
840  String name = object.UTF8ToUTF16();
841  for ( const Index& index : m_index )
842  if ( index.objectName.CompareIC( name ) == 0 )
843  if ( origin.IsEmpty() || index.originId == origin )
844  return true;
845  return false;
846  }
847 
861  String ObjectName( const IsoString& object, const IsoString& origin = IsoString() ) const
862  {
863  Array<Index>::const_iterator i = BinarySearch( m_index.Begin(), m_index.End(), Index( object, origin ) );
864  if ( i != m_index.End() )
865  return i->objectName;
866  return String();
867  }
868 
874  {
875  return m_metadata;
876  }
877 
890  int NumberOfHandles() const
891  {
892  return m_handleCount.Load();
893  }
894 
943  static void Serialize( const String& filePath,
944  TimePoint startTime, TimePoint endTime,
945  const SerializableEphemerisObjectDataList& data,
946  const EphemerisMetadata& metadata = EphemerisMetadata(),
947  const EphemerisConstantList& constants = EphemerisConstantList() );
948 
997  static const EphemerisFile& FundamentalEphemerides();
998 
1020  static const EphemerisFile& ShortTermFundamentalEphemerides();
1021 
1060  static const EphemerisFile& AsteroidEphemerides();
1061 
1083  static const EphemerisFile& ShortTermAsteroidEphemerides();
1084 
1105  static const EphemerisFile& NutationModel();
1106 
1133  static const EphemerisFile& ShortTermNutationModel();
1134 
1170  static String DeltaTDataFilePath();
1171 
1194  static String DeltaATDataFilePath();
1195 
1212  static String CIP_ITRSDataFilePath();
1213 
1230  static void OverrideFundamentalEphemerides( const String& filePath );
1231 
1249  static void OverrideShortTermFundamentalEphemerides( const String& filePath );
1250 
1267  static void OverrideAsteroidEphemerides( const String& filePath );
1268 
1285  static void OverrideShortTermAsteroidEphemerides( const String& filePath );
1286 
1303  static void OverrideNutationModel( const String& filePath );
1304 
1322  static void OverrideShortTermNutationModel( const String& filePath );
1323 
1343  static void OverrideDeltaTDataFilePath( const String& filePath );
1344 
1364  static void OverrideDeltaATDataFilePath( const String& filePath );
1365 
1386  static void OverrideCIP_ITRSDataFilePath( const String& filePath );
1387 
1388 private:
1389 
1394  struct IndexNode
1395  {
1396  int32 jdi = 0; // Starting point of time span covered by this expansion, int( JD ).
1397  float jdf = 0; // Ditto, frac( JD ).
1398  uint8 n[ 4 ] = {}; // For each component: number of Chebyshev coefficients in this expansion.
1399  int64 position = 0; // File byte position of first Chebyshev coefficient.
1400 
1401  constexpr bool operator ==( const IndexNode& n ) const
1402  {
1403  return jdi == n.jdi && jdf == n.jdf;
1404  }
1405 
1406  constexpr bool operator <( const IndexNode& n ) const
1407  {
1408  return jdi < n.jdi || jdi == n.jdi && jdf < n.jdf;
1409  }
1410 
1411  constexpr int NumberOfComponents() const
1412  {
1413  return (n[0] > 0) ? ((n[1] > 0) ? ((n[2] > 0) ? ((n[3] > 0) ? 4 : 3) : 2) : 1) : 0;
1414  }
1415 
1416  constexpr int NumberOfCoefficients() const
1417  {
1418  return n[0] + n[1] + n[2] + n[3];
1419  }
1420 
1421  TimePoint StartTime() const
1422  {
1423  return TimePoint( jdi, jdf );
1424  }
1425  };
1426 
1431  struct Index
1432  {
1433  IsoString objectId; // Object identifier (mandatory, case-sensitive).
1434  IsoString originId; // Identifier of the origin of coordinates (mandatory, case-sensitive).
1435  String objectName; // Object name (optional, case-insensitive).
1436  String objectDescription; // Object description (optional, arbitrary)
1437  Optional<double> H; // Absolute magnitude.
1438  Optional<double> G; // Slope parameter.
1439  Optional<double> B_V; // Color index B-V in magnitudes.
1440  Optional<double> D; // Diameter of the object in km.
1441  Array<IndexNode> nodes[ 2 ]; // Expansion indexes: 0=function 1=derivative.
1442 
1443  Index( const IsoString& objectId_,
1444  const IsoString& originId_ = IsoString(),
1445  const String& objectName_ = String(),
1446  const String& objectDescription_ = String() ) :
1447  objectId( objectId_.Trimmed() ),
1448  originId( originId_.Trimmed() ),
1449  objectName( objectName_.Trimmed() ),
1450  objectDescription( objectDescription_.Trimmed() )
1451  {
1452  }
1453 
1454  bool operator ==( const Index& x ) const
1455  {
1456  return objectId == x.objectId && originId == x.originId;
1457  }
1458 
1459  bool operator <( const Index& x ) const
1460  {
1461  return (objectId != x.objectId) ? objectId < x.objectId : originId < x.originId;
1462  }
1463 
1464  bool HasDerivative() const
1465  {
1466  return !nodes[1].IsEmpty();
1467  }
1468  };
1469 
1470  mutable File m_file;
1471  mutable AtomicInt m_handleCount;
1472  mutable Mutex m_mutex;
1473  TimePoint m_startTime;
1474  TimePoint m_endTime;
1475  EphemerisMetadata m_metadata;
1476  EphemerisConstantList m_constants;
1477  Array<Index> m_index;
1478 
1479  // Current data files.
1480  // If empty, i.e. if not overridden, use platform defaults.
1481  static String s_ephFilePath;
1482  static String s_ephFilePath_s;
1483  static String s_astFilePath;
1484  static String s_astFilePath_s;
1485  static String s_nutFilePath;
1486  static String s_nutFilePath_s;
1487  static String s_deltaTFilePath;
1488  static String s_deltaATFilePath;
1489  static String s_cipITRSFilePath;
1490 
1496  const Index* FindObject( const IsoString& object, const IsoString& origin ) const
1497  {
1498  if ( origin.IsEmpty() )
1499  {
1500  for ( const Index& index : m_index )
1501  if ( index.objectId == object )
1502  return &index;
1503  }
1504  else
1505  {
1506  Array<Index>::const_iterator i = BinarySearch( m_index.Begin(), m_index.End(), Index( object, origin ) );
1507  if ( i != m_index.End() )
1508  return i;
1509  }
1510  String name = object.UTF8ToUTF16();
1511  for ( const Index& index : m_index )
1512  if ( index.objectName.CompareIC( name ) == 0 )
1513  if ( origin.IsEmpty() || index.originId == origin )
1514  return &index;
1515  throw Error( "Unavailable object '" + name + "\' with origin '" + String( origin ) + "'." );
1516  }
1517 
1518 public:
1519 
1546  class PCL_CLASS Handle
1547  {
1548  public:
1549 
1576  Handle( const EphemerisFile& parent, const IsoString& object, const IsoString& origin = IsoString() )
1577  {
1578  if ( !parent.IsOpen() )
1579  throw Error( "Cannot create a handle to a closed ephemeris file." );
1580  m_parent = &parent;
1581  m_parent->m_handleCount.Increment();
1582  m_index = m_parent->FindObject( object, origin );
1583  }
1584 
1588  Handle( const Handle& x )
1589  {
1590  m_parent = x.m_parent;
1591  m_index = x.m_index;
1592  m_node[0] = x.m_node[0];
1593  m_node[1] = x.m_node[1];
1594  if ( m_parent != nullptr )
1595  m_parent->m_handleCount.Increment();
1596  }
1597 
1602  {
1603  m_parent = x.m_parent;
1604  x.m_parent = nullptr;
1605  m_index = x.m_index;
1606  m_node[0] = x.m_node[0];
1607  m_node[1] = x.m_node[1];
1608  }
1609 
1613  virtual ~Handle()
1614  {
1615  if ( m_parent != nullptr )
1616  m_parent->m_handleCount.Decrement();
1617  }
1618 
1622  Handle& operator =( const Handle& x )
1623  {
1624  if ( m_parent != nullptr )
1625  m_parent->m_handleCount.Decrement();
1626  m_parent = x.m_parent;
1627  m_index = x.m_index;
1628  m_node[0] = x.m_node[0];
1629  m_node[1] = x.m_node[1];
1630  if ( m_parent != nullptr )
1631  m_parent->m_handleCount.Increment();
1632  return *this;
1633  }
1634 
1638  Handle& operator =( Handle&& x )
1639  {
1640  if ( m_parent != nullptr )
1641  m_parent->m_handleCount.Decrement();
1642  m_parent = x.m_parent;
1643  x.m_parent = nullptr;
1644  m_index = x.m_index;
1645  m_node[0] = x.m_node[0];
1646  m_node[1] = x.m_node[1];
1647  return *this;
1648  }
1649 
1674  {
1675  Update( t, 0 );
1676  p = m_node[0].expansion( t - m_node[0].startTime );
1677  }
1678 
1715  {
1716  ComputeState( p, t );
1717 
1718  if ( HasDerivative() )
1719  Update( t, 1 );
1720  else if ( m_node[1].current != m_node[0].current )
1721  {
1722  m_node[1].current = m_node[0].current;
1723  m_node[1].startTime = m_node[0].startTime;
1724  m_node[1].endTime = m_node[0].endTime;
1725  m_node[1].expansion = m_node[0].expansion.Derivative();
1726  }
1727  v = m_node[1].expansion( t - m_node[1].startTime );
1728  }
1729 
1742  {
1743  Vector p;
1744  ComputeState( p, t );
1745  return p;
1746  }
1747 
1763  {
1764  Vector p, v;
1765  ComputeState( p, v, t );
1766  return MultiVector( p, v );
1767  }
1768 
1773  const EphemerisFile& ParentFile() const
1774  {
1775  return *m_parent;
1776  }
1777 
1782  const IsoString& ObjectId() const
1783  {
1784  return m_index->objectId;
1785  }
1786 
1795  const IsoString& OriginId() const
1796  {
1797  return m_index->originId;
1798  }
1799 
1806  const String& ObjectName() const
1807  {
1808  return m_index->objectName;
1809  }
1810 
1821  TimePoint StartTime( int i = 0 ) const
1822  {
1823  return m_node[Range( i, 0, 1 )].startTime;
1824  }
1825 
1836  TimePoint EndTime( int i = 0 ) const
1837  {
1838  return m_node[Range( i, 0, 1 )].endTime;
1839  }
1840 
1850  bool HasDerivative() const
1851  {
1852  return m_index->HasDerivative();
1853  }
1854 
1869  const Optional<double>& H() const
1870  {
1871  return m_index->H;
1872  }
1873 
1877  const Optional<double>& G() const
1878  {
1879  return m_index->G;
1880  }
1881 
1885  const Optional<double>& B_V() const
1886  {
1887  return m_index->B_V;
1888  }
1889 
1894  const Optional<double>& D() const
1895  {
1896  return m_index->D;
1897  }
1898 
1899  private:
1900 
1901  struct NodeInfo
1902  {
1903  int current = -1;
1904  TimePoint startTime;
1905  TimePoint endTime;
1906  ChebyshevFit expansion;
1907  };
1908 
1909  const EphemerisFile* m_parent = nullptr;
1910  const EphemerisFile::Index* m_index = nullptr;
1911  NodeInfo m_node[ 2 ];
1912 
1919  void Update( TimePoint t, int index )
1920  {
1921  if ( !t.IsValid() )
1922  throw Error( "Invalid time point." );
1923  if ( t < m_parent->StartTime() || t > m_parent->EndTime() )
1924  throw Error( "Time point out of range." );
1925 
1926  const Array<IndexNode>& nodes = m_index->nodes[index];
1927  NodeInfo& info = m_node[index];
1928 
1929  for ( int N = int( nodes.Length() ), l = 0, r = N-1; ; )
1930  {
1931  int m = (l + r) >> 1;
1932  const IndexNode& node = nodes[m];
1933  TimePoint t0 = node.StartTime();
1934  if ( t < t0 )
1935  r = m;
1936  else
1937  {
1938  if ( m == N-1 || t < nodes[m+1].StartTime() )
1939  {
1940  if ( m != info.current )
1941  {
1942  m_parent->m_file.SetPosition( node.position );
1943  ChebyshevFit::coefficient_series coefficients;
1944  for ( int i = 0, n = node.NumberOfComponents(); i < n; ++i )
1945  {
1946  Vector c( node.n[i] );
1947  m_parent->m_file.Read( reinterpret_cast<void*>( c.Begin() ), c.Size() );
1948  coefficients << c;
1949  }
1950  info.current = m;
1951  info.startTime = t0;
1952  info.endTime = (m < N-1) ? nodes[m+1].StartTime() : m_parent->EndTime();
1953  info.expansion = ChebyshevFit( coefficients, 0, info.endTime - info.startTime );
1954  }
1955  break;
1956  }
1957 
1958  l = m + 1;
1959  }
1960  }
1961  }
1962  };
1963 
1964 private:
1965 
1966 #if defined( __clang__ )
1967 # pragma GCC diagnostic ignored "-Wunused-private-field"
1968 #endif
1969 
1970  /*
1971  * For the core JavaScript engine we need garbage-collector-safe
1972  * asynchronous destruction of these objects.
1973  */
1974  mutable bool m_finalized = false;
1975 
1976  /*
1977  * In the core JavaScript engine we must identity static objects that can be
1978  * shared and must never be destroyed. This includes fundamental
1979  * ephemerides, nutation, etc.
1980  */
1981  mutable bool m_internal = false;
1982 
1983 #if defined( __clang__ )
1984 # pragma GCC diagnostic warning "-Wunused-private-field"
1985 #endif
1986 
1987 #ifdef __PCL_BUILDING_PIXINSIGHT_APPLICATION
1988  friend class pi::JSEphemerisFileObject;
1989  friend class pi::JSEphemerisHandleObject;
1990 #endif
1991 };
1992 
1993 // ----------------------------------------------------------------------------
1994 
1995 } // pcl
1996 
1997 #endif // __PCL_EphemerisFile_h
1998 
1999 // ----------------------------------------------------------------------------
2000 // EOF pcl/EphemerisFile.h - Released 2019-11-07T10:59:34Z
bool IsEmpty() const
Definition: Array.h:311
Optional< double > D
String description
A full description of the data stored in this XEPH file.
const Optional< double > & G() const
Dynamic list of object identifiers and descriptions.
An instant in any timescale.
Definition: TimePoint.h:102
const Optional< double > & D() const
unsigned char uint8
Definition: Defs.h:576
String copyright
Copyright information applicable to the data stored in this XEPH file.
Adaptive mutual exclusion lock variable.
Definition: Mutex.h:208
Atomic operations on integers.
Definition: Atomic.h:94
64-bit floating point Chebyshev function approximation.
TimePoint EndTime(int i=0) const
PCL root namespace.
Definition: AbstractImage.h:76
TimePoint StartTime(int i=0) const
iterator Begin()
Definition: Array.h:425
MultiVector StateVectors(TimePoint t)
const EphemerisMetadata & Metadata() const
String ObjectName(const IsoString &object, const IsoString &origin=IsoString()) const
const Optional< double > & B_V() const
void Increment()
Definition: Atomic.h:207
bool IsEmpty() const
Definition: String.h:785
virtual void Read(void *buffer, fsize_type len)
Solar system ephemerides from XEPH files.
String title
A title that represents or identifies this XEPH file.
String authors
The names of one or more persons or groups that have created the data in this file.
Calculation of ephemerides from data stored in XEPH files.
const String & FilePath() const
String creatorOS
The operating system on which this file was created.
Definition: EphemerisFile.h:99
const EphemerisFile & ParentFile() const
virtual void SetPosition(fpos_type pos)
EphemerisObjectList Objects() const
TimePoint StartTime() const
const IsoString & ObjectId() const
constexpr const T & Range(const T &x, const T &a, const T &b)
Definition: Utility.h:190
void ComputeState(Vector &p, Vector &v, TimePoint t)
IsoString name
The constant name (case-insensitive).
SerializableEphemerisData(TimePoint t, const ChebyshevFit &T)
EphemerisConstant(const IsoString &n=IsoString(), double v=0)
ustring_base UTF8ToUTF16(size_type i=0, size_type n=maxPos) const
Definition: String.h:12018
64-bit floating point real multivector.
FI BinarySearch(FI i, FI j, const T &v)
Definition: Search.h:170
EphemerisObject(const IsoString &objectId_, const IsoString &originId_, const String &objectName_=String(), const String &objectDescription_=String(), Optional< double > H_=Optional< double >(), Optional< double > G_=Optional< double >(), Optional< double > B_V_=Optional< double >(), Optional< double > D_=Optional< double >())
Unicode (UTF-16) string.
Definition: String.h:7911
EphemerisFile(EphemerisFile &&x)
double ConstantValue(const IsoString &name) const
String organizationName
The name of the organization responsible for this file.
double value
The constant value.
Optional< double > H
Optional< double > G
Dynamic list of ephemeris numerical constants.
signed int int32
Definition: Defs.h:594
String creatorApplication
The software application or program that created this file.
bool IsObjectAvailable(const IsoString &object, const IsoString &origin=IsoString()) const
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2)
Definition: Array.h:2086
EphemerisFile(const String &filePath)
Dynamic list of Chebyshev polynomial expansions for ephemeris serialization.
A simple exception with an associated error message.
Definition: Exception.h:213
SerializableEphemerisObjectData(const IsoString &id, const IsoString &origin, const String &name=String(), const String &desc=String())
Chebyshev polynomial expansion coefficients for ephemeris serialization.
const Optional< double > & H() const
64-bit floating point real vector.
int CompareIC(const GenericString< T, R1, A1 > &s, bool localeAware=true) const
Definition: String.h:3787
size_type Length() const
Definition: Array.h:265
Identifiers and descriptive data of an object available in an ephemeris file.
String briefDescription
A brief (single-line) description of this XEPH file.
Vector StateVector(TimePoint t)
TimePoint creationTime
The date this file was created.
Definition: EphemerisFile.h:98
A numerical constant defined in an ephemeris file (XEPH format).
void ComputeState(Vector &p, TimePoint t)
const EphemerisConstantList & Constants() const
iterator End()
Definition: Array.h:450
bool IsConstantAvailable(const IsoString &name) const
Handle(const EphemerisFile &parent, const IsoString &object, const IsoString &origin=IsoString())
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2)
Definition: Array.h:2075
Dynamic list of per-object data for ephemeris serialization.
constexpr bool IsValid() const
Definition: TimePoint.h:230
bool IsOpen() const
const String & ObjectName() const
Metadata items available in ephemeris files (XEPH format).
Definition: EphemerisFile.h:96
A set of Chebyshev polynomial expansions and associated ancillary data for ephemeris serialization...
Optional< double > B_V
const IsoString & OriginId() const
signed long long int64
Definition: Defs.h:610
TimePoint EndTime() const
A platform-independent interface to the local file system.
Definition: File.h:496
int NumberOfHandles() const
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5387