Esempio n. 1
0
 def set_coe(self, coe, units = None, rv = True):
     if units != None:
         from unit_conversions import converter
         coe[2] = converter(coe[2], units, 'Radians')
         coe[3] = converter(coe[3], units, 'Radians')
         coe[4] = converter(coe[4], units, 'Radians')
         coe[5] = converter(coe[5], units, 'Radians')
     #  reset coe
     self.sma  = coe[0]
     self.e    = coe[1]
     self.i    = coe[2]
     self.RAAN = coe[3]
     self.AOP  = coe[4]
     self.f    = coe[5]
     self.coe  = [self.sma, self.e, self.i, self.RAAN, \
                  self.AOP, self.f]
     #  reset r, v
     if rv:
         from auxiliary import coe2rv
         self.r, self.v = coe2rv(self.coe, self.Mu)
     #  recalculate additional useful orbital parameters
     #+ E: eccentricy anomaly
     #+ M: mean anomaly
     #+ T: orbital period
     #+ n: mean motion
     from auxiliary import f2E, E2M, orbitalperiod
     from math import pi
     self.E = f2E(self.e, self.f)
     self.M = E2M(self.e, self.E)
     self.T = orbitalperiod(self.Mu, self.sma)
     self.n = 2.0*pi / self.T
Esempio n. 2
0
 def set_RAAN(self, RAAN, units = None):
     if units != None:
         from unit_conversions import converter
         RAAN = converter(RAAN, units, 'Radians')
     self.RAAN = RAAN
     #  reset RAAN in coe list
     self.coe[3] = RAAN
     #  reset the r and v vectors
     from auxiliary import coe2rv
     self.r, self.v = coe2rv(self.coe, self.Mu)
Esempio n. 3
0
 def set_AOP(self, AOP, units = None):
     if units != None:
         from unit_conversions import converter
         AOP = converter(AOP, units, 'Radians')
     self.AOP = AOP
     #  reset AOP in coe list
     self.coe[4] = AOP
     #  reset the r and v vectors
     from auxiliary import coe2rv
     self.r, self.v = coe2rv(self.coe, self.Mu)
Esempio n. 4
0
 def set_i(self, i, units = None):
     if units != None:
         from unit_conversions import converter
         i = converter(i, units, 'Radians')
     self.i = i
     #  reset i in coe list
     self.coe[2] = i
     #  reset the r and v vectors
     from auxiliary import coe2rv
     self.r, self.v = coe2rv(self.coe, self.Mu)
Esempio n. 5
0
 def set_f(self, f, units = None):
     if units != None:
         from unit_conversions import converter
         f = converter(f, units, 'Radians')
     self.f = f
     #  reset f in coe list
     self.coe[5] = f
     #  reset the r and v vectors
     from auxiliary import coe2rv
     self.r, self.v = coe2rv(self.coe, self.Mu)
     #  reset
     #+ E: eccentricy anomaly
     #+ M: mean anomaly
     from auxiliary import f2E, E2M
     self.E = f2E(self.e, self.f)
     self.M = E2M(self.e, self.E)