Class LazyLoadedCelestialBodies
- java.lang.Object
-
- org.orekit.bodies.LazyLoadedCelestialBodies
-
- All Implemented Interfaces:
CelestialBodies
public class LazyLoadedCelestialBodies extends Object implements CelestialBodies
This class lazily loads auxiliary data when it is needed by a requested body. It is designed to match the behavior ofCelestialBodyFactory
in Orekit 10.0.- Since:
- 10.1
- Author:
- Luc Maisonobe, Evan Ward
- See Also:
CelestialBodyFactory
-
-
Constructor Summary
Constructors Constructor Description LazyLoadedCelestialBodies(DataProvidersManager dataProvidersManager, TimeScales timeScales, Frame gcrf)
Create a celestial body factory with the given auxiliary data sources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCelestialBodyLoader(String name, CelestialBodyLoader loader)
Add a loader for celestial bodies.void
addDefaultCelestialBodyLoader(String supportedNames)
Add the default loaders for all predefined celestial bodies.void
addDefaultCelestialBodyLoader(String name, String supportedNames)
Add the default loaders for celestial bodies.void
clearCelestialBodyCache()
Clear all loaded celestial bodies.void
clearCelestialBodyCache(String name)
Clear the specified celestial body from the internal cache.void
clearCelestialBodyLoaders()
Clear loaders for all celestial bodies.void
clearCelestialBodyLoaders(String name)
Clear loaders for one celestial body.CelestialBody
getBody(String name)
Get a celestial body.CelestialBody
getEarth()
Get the Earth singleton body.CelestialBody
getEarthMoonBarycenter()
Get the Earth-Moon barycenter singleton bodies pair.CelestialBody
getJupiter()
Get the Jupiter singleton body.CelestialBody
getMars()
Get the Mars singleton body.CelestialBody
getMercury()
Get the Mercury singleton body.CelestialBody
getMoon()
Get the Moon singleton body.CelestialBody
getNeptune()
Get the Neptune singleton body.CelestialBody
getPluto()
Get the Pluto singleton body.CelestialBody
getSaturn()
Get the Saturn singleton body.CelestialBody
getSolarSystemBarycenter()
Get the solar system barycenter aggregated body.CelestialBody
getSun()
Get the Sun singleton body.CelestialBody
getUranus()
Get the Uranus singleton body.CelestialBody
getVenus()
Get the Venus singleton body.
-
-
-
Constructor Detail
-
LazyLoadedCelestialBodies
public LazyLoadedCelestialBodies(DataProvidersManager dataProvidersManager, TimeScales timeScales, Frame gcrf)
Create a celestial body factory with the given auxiliary data sources.- Parameters:
dataProvidersManager
- supplies JPL ephemerides auxiliary data files.timeScales
- set of time scales to use when loading bodies.gcrf
- Earth centered frame aligned with ICRF.
-
-
Method Detail
-
addCelestialBodyLoader
public void addCelestialBodyLoader(String name, CelestialBodyLoader loader)
Add a loader for celestial bodies.- Parameters:
name
- name of the body (may be one of the predefined names or a user-defined name)loader
- custom loader to add for the body- See Also:
addDefaultCelestialBodyLoader(String)
,clearCelestialBodyLoaders(String)
,clearCelestialBodyLoaders()
-
addDefaultCelestialBodyLoader
public void addDefaultCelestialBodyLoader(String supportedNames)
Add the default loaders for all predefined celestial bodies.- Parameters:
supportedNames
- regular expression for supported files names (may be null if the default JPL file names are used)The default loaders look for DE405 or DE406 JPL ephemerides.
- See Also:
- DE405 JPL ephemerides,
DE406 JPL ephemerides,
addCelestialBodyLoader(String, CelestialBodyLoader)
,addDefaultCelestialBodyLoader(String)
,clearCelestialBodyLoaders(String)
,clearCelestialBodyLoaders()
-
addDefaultCelestialBodyLoader
public void addDefaultCelestialBodyLoader(String name, String supportedNames)
Add the default loaders for celestial bodies.- Parameters:
name
- name of the body (if not one of the predefined names, the method does nothing)supportedNames
- regular expression for supported files names (may be null if the default JPL file names are used)The default loaders look for DE405 or DE406 JPL ephemerides.
- See Also:
- DE405 JPL ephemerides,
DE406 JPL ephemerides,
addCelestialBodyLoader(String, CelestialBodyLoader)
,addDefaultCelestialBodyLoader(String)
,clearCelestialBodyLoaders(String)
,clearCelestialBodyLoaders()
-
clearCelestialBodyLoaders
public void clearCelestialBodyLoaders(String name)
Clear loaders for one celestial body.Calling this method also clears the celestial body that has been loaded via this
CelestialBodyLoader
.- Parameters:
name
- name of the body- See Also:
addCelestialBodyLoader(String, CelestialBodyLoader)
,clearCelestialBodyLoaders()
,clearCelestialBodyCache(String)
-
clearCelestialBodyLoaders
public void clearCelestialBodyLoaders()
Clear loaders for all celestial bodies.Calling this method also clears all loaded celestial bodies.
-
clearCelestialBodyCache
public void clearCelestialBodyCache(String name)
Clear the specified celestial body from the internal cache.- Parameters:
name
- name of the body
-
clearCelestialBodyCache
public void clearCelestialBodyCache()
Clear all loaded celestial bodies.Calling this method will remove all loaded bodies from the internal cache. Subsequent calls to
getBody(String)
or similar methods will result in a reload of the requested body from the configured loader(s).
-
getSolarSystemBarycenter
public CelestialBody getSolarSystemBarycenter()
Description copied from interface:CelestialBodies
Get the solar system barycenter aggregated body.Both the
inertially oriented frame
andbody oriented frame
for this aggregated body are aligned withICRF
(and therefore alsoGCRF
)- Specified by:
getSolarSystemBarycenter
in interfaceCelestialBodies
- Returns:
- solar system barycenter aggregated body
-
getSun
public CelestialBody getSun()
Description copied from interface:CelestialBodies
Get the Sun singleton body.- Specified by:
getSun
in interfaceCelestialBodies
- Returns:
- Sun body
-
getMercury
public CelestialBody getMercury()
Description copied from interface:CelestialBodies
Get the Mercury singleton body.- Specified by:
getMercury
in interfaceCelestialBodies
- Returns:
- Sun body
-
getVenus
public CelestialBody getVenus()
Description copied from interface:CelestialBodies
Get the Venus singleton body.- Specified by:
getVenus
in interfaceCelestialBodies
- Returns:
- Venus body
-
getEarthMoonBarycenter
public CelestialBody getEarthMoonBarycenter()
Description copied from interface:CelestialBodies
Get the Earth-Moon barycenter singleton bodies pair.Both the
inertially oriented frame
andbody oriented frame
for this bodies pair are aligned withICRF
(and therefore alsoGCRF
)- Specified by:
getEarthMoonBarycenter
in interfaceCelestialBodies
- Returns:
- Earth-Moon barycenter bodies pair
-
getEarth
public CelestialBody getEarth()
Description copied from interface:CelestialBodies
Get the Earth singleton body.- Specified by:
getEarth
in interfaceCelestialBodies
- Returns:
- Earth body
-
getMoon
public CelestialBody getMoon()
Description copied from interface:CelestialBodies
Get the Moon singleton body.- Specified by:
getMoon
in interfaceCelestialBodies
- Returns:
- Moon body
-
getMars
public CelestialBody getMars()
Description copied from interface:CelestialBodies
Get the Mars singleton body.- Specified by:
getMars
in interfaceCelestialBodies
- Returns:
- Mars body
-
getJupiter
public CelestialBody getJupiter()
Description copied from interface:CelestialBodies
Get the Jupiter singleton body.- Specified by:
getJupiter
in interfaceCelestialBodies
- Returns:
- Jupiter body
-
getSaturn
public CelestialBody getSaturn()
Description copied from interface:CelestialBodies
Get the Saturn singleton body.- Specified by:
getSaturn
in interfaceCelestialBodies
- Returns:
- Saturn body
-
getUranus
public CelestialBody getUranus()
Description copied from interface:CelestialBodies
Get the Uranus singleton body.- Specified by:
getUranus
in interfaceCelestialBodies
- Returns:
- Uranus body
-
getNeptune
public CelestialBody getNeptune()
Description copied from interface:CelestialBodies
Get the Neptune singleton body.- Specified by:
getNeptune
in interfaceCelestialBodies
- Returns:
- Neptune body
-
getPluto
public CelestialBody getPluto()
Description copied from interface:CelestialBodies
Get the Pluto singleton body.- Specified by:
getPluto
in interfaceCelestialBodies
- Returns:
- Pluto body
-
getBody
public CelestialBody getBody(String name)
Get a celestial body. The names of the common bodies are defined as constants inCelestialBodyFactory
.If no
CelestialBodyLoader
has been added by callingaddCelestialBodyLoader
or ifclearCelestialBodyLoaders
has been called afterwards, theaddDefaultCelestialBodyLoader
method will be called automatically, once with the default name for JPL DE ephemerides and once with the default name for IMCCE INPOP files.- Specified by:
getBody
in interfaceCelestialBodies
- Parameters:
name
- name of the celestial body- Returns:
- celestial body
-
-