Esempio n. 1
0
    def test_d_property(self):

        obj = SpaceObject(**self.orb_init)
        assert obj.d == np.sqrt(self.init_obj['parameters']['A'] / np.pi) * 2

        del self.orb_init['parameters']['A']
        self.orb_init['parameters']['d'] = 2.0
        obj = SpaceObject(**self.orb_init)
        assert obj.d == 2.0

        self.orb_init['parameters']['A'] = 1.0
        obj = SpaceObject(**self.orb_init)
        assert obj.d == 2.0

        self.orb_init['parameters']['diam'] = 3.0
        self.orb_init['parameters']['r'] = 5.0

        obj = SpaceObject(**self.orb_init)
        assert obj.d == 2.0

        del self.orb_init['parameters']['d']
        obj = SpaceObject(**self.orb_init)
        assert obj.d == 3.0

        del self.orb_init['parameters']['diam']
        obj = SpaceObject(**self.orb_init)
        assert obj.d == 5.0 * 2

        del self.orb_init['parameters']['A']
        del self.orb_init['parameters']['r']

        obj = SpaceObject(**self.orb_init)
        #test default value
        x = obj.d

        del obj.parameters['A']
        with self.assertRaises(AttributeError):
            x = obj.d
Esempio n. 2
0
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pyorb
from astropy.time import Time

from sorts.propagator import SGP4
from sorts import SpaceObject
from sorts.plotting import grid_earth

opts = dict(settings=dict(out_frame='TEME', ), )

obj = SpaceObject(SGP4,
                  propagator_options=opts,
                  a=6800e3,
                  e=0.0,
                  i=69,
                  raan=0,
                  aop=0,
                  mu0=0,
                  epoch=Time(57125.7729, format='mjd'),
                  parameters=dict(A=2.0, ))

#change the area every 10 minutes
dt = 600.0

#propagate for 24h
steps = int(24 * 3600.0 / dt)
states = []

for mci in range(100):
    mc_obj = obj.copy()
from sorts.radar.scans import Beampark

from sorts.propagator import SGP4
Prop_cls = SGP4
Prop_opts = dict(settings=dict(out_frame='ITRF', ), )

end_t = 600.0

logger = sorts.profiling.get_logger('scanning')

obj = SpaceObject(
    Prop_cls,
    propagator_options=Prop_opts,
    a=7200e3,
    e=0.02,
    i=75,
    raan=86,
    aop=0,
    mu0=60,
    epoch=53005.0,
    parameters=dict(d=0.1, ),
)

print(obj)


class ObservedScanning(StaticList, ObservedParameters):
    pass


static_ctrl = Static(eiscat3d,
                     azimuth=0,
Esempio n. 4
0
from sorts.scheduler import StaticList, ObservedParameters
from sorts import SpaceObject
from sorts.profiling import Profiler

from sorts.propagator import SGP4
Prop_cls = SGP4
Prop_opts = dict(settings=dict(out_frame='ITRF', ), )
prop = Prop_cls(**Prop_opts)

objs = [
    SpaceObject(
        Prop_cls,
        propagator_options=Prop_opts,
        a=7200e3,
        e=0.1,
        i=75,
        raan=79,
        aop=0,
        mu0=mu0,
        epoch=53005.0,
        parameters=dict(d=1.0, ),
    ) for mu0 in [62.0, 61.9]
]

for obj in objs:
    print(obj)

t = sorts.equidistant_sampling(
    orbit=objs[0].state,
    start_t=0,
    end_t=3600 * 6,
    max_dpos=1e3,
Esempio n. 5
0
 def test_state_init(self):
     obj = SpaceObject(**self.state_init)
Esempio n. 6
0
 def test_cart_init(self):
     obj = SpaceObject(**self.cart_init)
Esempio n. 7
0
 def test_orb_alt_init(self):
     obj = SpaceObject(**self.orb_alt_init)
Esempio n. 8
0
 def test_update_error(self):
     obj = SpaceObject(**self.orb_init)
     with self.assertRaises(ValueError):
         obj.orbit.update(a=obj.orbit.a + 100.0, x=obj.orbit.x + 100.0)
Esempio n. 9
0
    def test_return_sizes(self):

        obj = SpaceObject(**self.orb_init)

        t = np.array([0.0], dtype=np.float)

        x = obj.get_position(t)
        v = obj.get_velocity(t)
        xv = obj.get_state(t)

        self.assertEqual(x.shape, (3, 1))
        self.assertEqual(v.shape, (3, 1))
        self.assertEqual(xv.shape, (6, 1))

        nt.assert_array_equal(x[:, 0], xv[:3, 0])
        nt.assert_array_equal(v[:, 0], xv[3:, 0])

        t = np.array([0.0, 1.0], dtype=np.float)

        x = obj.get_position(t)
        v = obj.get_velocity(t)
        xv = obj.get_state(t)

        self.assertEqual(x.shape, (3, 2))
        self.assertEqual(v.shape, (3, 2))
        self.assertEqual(xv.shape, (6, 2))

        nt.assert_array_equal(x[:, :], xv[:3, :])
        nt.assert_array_equal(v[:, :], xv[3:, :])

        t = 1.0

        x = obj.get_position(t)
        v = obj.get_velocity(t)
        xv = obj.get_state(t)

        self.assertEqual(x.shape, (3, 1))
        self.assertEqual(v.shape, (3, 1))
        self.assertEqual(xv.shape, (6, 1))

        nt.assert_array_equal(x[:], xv[:3])
        nt.assert_array_equal(v[:], xv[3:])
Esempio n. 10
0
    orekit_data=orekit_data,
    settings=dict(
        in_frame='GCRS',
        out_frame='GCRS',
        drag_force=False,
        radiation_pressure=False,
    ),
)

t = np.linspace(0, 3600 * 24.0 * 2, num=5000)

obj = SpaceObject(Orekit,
                  propagator_options=orekit_options,
                  a=7000e3,
                  e=0.0,
                  i=69,
                  raan=0,
                  aop=0,
                  mu0=0,
                  epoch=Time(57125.7729, format='mjd'),
                  parameters=dict(d=0.2, ))

print(obj)

states = obj.get_state(t)

fig = plt.figure(figsize=(15, 15))
ax = fig.add_subplot(111, projection='3d')
ax.plot(states[0, :], states[1, :], states[2, :], "-b")

max_range = np.linalg.norm(states[0:3, 0]) * 2
from sorts import SpaceObject, Simulation
from sorts import MPI_single_process, MPI_action, iterable_step, store_step, cached_step
from sorts.radar.scans import Fence

from sorts.propagator import SGP4
Prop_cls = SGP4
Prop_opts = dict(settings=dict(out_frame='ITRF', ), )

objs = [
    SpaceObject(
        Prop_cls,
        propagator_options=Prop_opts,
        a=7200e3,
        e=0.1,
        i=inc,
        raan=79,
        aop=0,
        mu0=60,
        epoch=53005.0,
        parameters=dict(d=0.1, ),
        oid=ind,
    ) for ind, inc in enumerate(np.linspace(69, 75, num=10))
]


class ObservedTracking(PriorityTracking, ObservedParameters):
    pass


scheduler = ObservedTracking(
    radar=eiscat3d,
from sorts.propagator import SGP4

Prop_cls = SGP4
Prop_opts = dict(settings=dict(out_frame='ITRF', ), )

end_t = 600.0
scan = Fence(azimuth=90, num=40, dwell=0.1, min_elevation=30)

objs = [
    SpaceObject(
        Prop_cls,
        propagator_options=Prop_opts,
        a=a,
        e=0.1,
        i=75,
        raan=79,
        aop=0,
        mu0=60,
        epoch=53005.0,
        parameters=dict(d=0.3, ),
    ) for a in np.linspace(7200e3, 8400e3, 4)
]


class ObservedScanning(StaticList, ObservedParameters):
    pass


scan_sched = Scanner(eiscat3d, scan)
scan_sched.t = np.arange(0, end_t, scan.dwell())
Esempio n. 13
0
Prop_opts = dict(
    settings = dict(
        out_frame='ITRF',
    ),
)

logger = sorts.profiling.get_logger('tracking')

objs = [
    SpaceObject(
        Prop_cls,
        propagator_options = Prop_opts,
        a = 7200e3, 
        e = 0.1, 
        i = 75, 
        raan = 79,
        aop = 0,
        mu0 = 60,
        mjd0 = 53005.0,
        d = 1.0,
        oid = 1,
    ),
    SpaceObject(
        Prop_cls,
        propagator_options = Prop_opts,
        a = 7200e3, 
        e = 0.1, 
        i = 69, 
        raan = 74,
        aop = 0,
        mu0 = 0,