Package: orekit-factory
Orekit-factoryA collection of utilities to bootstrap an orekit-based python application.Installation$pipinstallorekit-factoryUsageThe utilities provided by theorekitfactorymodule can be broken out into the categories below.  See the python docs for complete details.Application initializationTheorekitfactory.init_orekit()method reduces the boilerplate for starting python-based orekit applications. It performs the following steps, then returns a handle to the orekit VM:Downloads the default orekit data zip to a data directory. Note the option to re-download the file, if it exists, or simply use the cached version.Setup the data context using that default data zip.A basic example:importorekitimportorekitfactoryvm=orekit.initVM()orekitfactory.init_orekit()Enumeration utiltiesorekitfactory.to_iers_conventions()- Convert a string to theIERSConventionsorekit enumeration.importorekitfactoryiers_conventions=orekitfactory.to_iers_conventions("iers_2010")Date utilitiesMultiple date utilities improve application's abilities to use AbsoluteDate.orekitfactory.to_absolute_date()- Converts an ISO-8601 string or adatetimeinstance into anAbsoluteDateinstance based on UTC. The data context and time scale can be provided via optional parameters. This method is a no-op if anAbsoluteDateinstance is provided.orekitfactory.DateInterval- This class provides an interval ofAbsoluteDateand provides the standard interval operations likeduration,comparison,overlap, andintersection.orekitfactory.DateIntervalList- A list of non-overlappingDateIntervalinstances. Provides set operations likeunion,intersection, andsubtraction.orekitfactory.DateIntervalListBuilder- A utility class useful when incrementally building up aDateIntervalList.importorekitfactorydate1=orekitfactory.to_absolute_date("2022-08-28T13:15:00Z")date2=orekitfactory.to_absolute_date("2022-08-28T13:16:00Z")date3=orekitfactory.to_absolute_date("2022-08-28T13:17:00Z")date4=orekitfactory.to_absolute_date("2022-08-28T13:18:00Z")ivl1=orekitfactory.DateInterval(date1,date3)ivl2=orekitfactory.DateInterval(date2,date4)ivl3=orekitfactory.DateInterval(date1,date2)dlist=orekitfactory.DateInteralList(intervals=[ivl1,ivl2,ivl3])assert2==len(dlist)print(dlist)dlist2=orekitfactory.DateIntervalList(interval=DateInterval(date1,date5)).subtract(dlist)print(dlist2)Frames and reference ellipsoidsorekitfactory.get_reference_ellipsoid()- A utility function for loadingReferenceEllipsoidinstances from summary strings.orekitfactory.get_frame()- A utility function for loadingFrameinstances based on shortened summary names, or predefined builtins.importorekitfactoryitrf=orekitfactory.get_frame("itrf")wgs84=orekitfactory.get_reference_ellipsoid("wgs84",frame=itrf)# an alternate callswgs84=orekitfactory.get_reference_ellipsoid("wgs84",frame="itrf")wgs84=orekitfactory.get_reference_ellipsoid("wgs84",frameName="itrf")Orbit definitions and propagatorsorekitfactory.check_tle()- Checks the two lines of a TLE for valid format.orekitfactory.to_tle()- Constructs an orekitTLEinstance using the provided UTC time scale, or loading one from the default data context.orekitfactory.to_orbit()- Constructs aKeplerianOrbitinstance from the provided parameters.orekitfactory.to_propgator()- Construct a propagator (SGP4orSDP4as appropriate for a TLE, or aNumericalPropagatorfor keplerian orbits) from the provided orbit.importorekitfactoryassertorekitfactory.check_tle("1 49260U 21088A   22166.94778099  .00000339  00000+0  85254-4 0  9992","2 49260  98.2276 237.1831 0001142  78.2478 281.8849 14.57099002 38060")tle=orekitfactory.to_tle("1 49260U 21088A   22166.94778099  .00000339  00000+0  85254-4 0  9992","2 49260  98.2276 237.1831 0001142  78.2478 281.8849 14.57099002 38060")orbit=orekitfactory.to_orbit(a="7080 km",e=0.0008685,i=85,omega=u.Quantity("261.9642 deg"),w="257.7333 deg",epoch="2022-06-16T17:54:00Z",v=1.2,)sgp4=to_propagator(tle)prop=to_propagator(orbit)Vectors and Rotationsorekitfactory.to_vector()- Simplifies the creation ofVector3Dinstances, avoiding theInvalidArgumenterrors caused by passingintinstead offloatto theVector3Dconstructor.orekitfactory.to_rotation()- Creates aRotationusing the provided axis defintions.importorekitfactorynew_x=orekitfactory.to_vector(1,2,3).normalize()new_y=new_x.crossProduct(Vector3D.PLUS_K)tx=orekitfactory.to_rotation(x=new_x,y=new_y)