Exemplo n.º 1
0
    def __init__(self, *args, **kwargs):

        #Constants used
        Cts = AL_BF.ConstantsBook()  #Constants for planets

        # Define bodies involved
        self.Spacecraft = AL_2BP.Spacecraft()
        self.earthephem = pk.planet.jpl_lp('earth')
        self.marsephem = pk.planet.jpl_lp('mars')
        self.jupiterephem = pk.planet.jpl_lp('jupiter')
        self.venusephem = pk.planet.jpl_lp('venus')

        self.sun = AL_2BP.Body('Sun', 'yellow', mu=Cts.mu_S_m)
        self.earth = AL_2BP.Body('Earth', 'blue', mu=Cts.mu_E_m)
        self.mars = AL_2BP.Body('Mars', 'red', mu=Cts.mu_M_m)
        self.jupiter = AL_2BP.Body('Jupiter', 'green', mu=Cts.mu_J_m)
        self.venus = AL_2BP.Body('Venus', 'brown', mu=Cts.mu_V_m)

        departure = kwargs.get('departure', "Earth")
        arrival = kwargs.get('arrival', "Mars")

        if departure == 'Earth':
            self.departure = self.earth
            self.departureephem = self.earthephem
        elif departure == 'Mars':
            self.departure = self.mars
            self.departureephem = self.marsephem

        if arrival == 'Mars':
            self.arrival = self.mars
            self.arrivalephem = self.marsephem
        elif arrival == 'Jupiter':
            self.arrival = self.jupiter
            self.arrivalephem = self.jupiterephem
        elif arrival == 'Venus':
            self.arrival = self.venus
            self.arrivalephem = self.venusephem
        elif arrival == 'Earth':
            self.arrival = self.earth
            self.arrivalephem = self.earthephem

        # Settings
        self.color = ['blue', 'green', 'black', 'red', 'yellow', 'orange']

        # Choose odd number to compare easily in middle point
        self.Nimp = kwargs.get('Nimp', 11)
Exemplo n.º 2
0
from FitnessFunction import Fitness
import AstroLibraries.AstroLib_Basic as AL_BF 
from AstroLibraries import AstroLib_2BP as AL_2BP
from AstroLibraries import AstroLib_Ephem as AL_Eph
from AstroLibraries import AstroLib_Plots as AL_Plot
from AstroLibraries import AstroLib_Trajectories as AL_TR
from AstroLibraries import AstroLib_ShapingMethod as AL_Sh


import LoadConfigFiles as CONFIG

# # In[]
# ##############################################
# ############# VALIDATION #####################
# ##############################################
Cts = AL_BF.ConstantsBook()

def pykepephem():
    # earth = pk.planet.jpl_lp('earth')
    # marsephem = pk.planet.jpl_lp('mars')

    earth = pk.planet.jpl_lp('earth')

    K_0 = earth.eph(0)
    # print(K_0)
    earth.mu_central_body
    print(earth.mu_self)
    elem = earth.osculating_elements(pk.epoch(2345.3, 'mjd2000'))
    print(elem)
    print(np.array(elem))