def test_get_methods(self): propagation_params = {'a': 1} opm_params = {'b': 2} batch = Batch(propagation_params, opm_params) self.assertEqual(propagation_params, batch.get_propagation_params()) self.assertEqual(opm_params, batch.get_opm_params()) self.assertIsNone(batch.get_uuid()) self.assertIsNone(batch.get_calc_state()) self.assertIsNone(batch.get_state_summary()) self.assertIsNone(batch.get_results()) state_summary = StateSummary({'uuid': 'aaa', 'calc_state': 'RUNNING'}) batch.set_state_summary(state_summary) self.assertEqual(state_summary, batch.get_state_summary()) self.assertEqual('aaa', batch.get_uuid()) self.assertEqual('RUNNING', batch.get_calc_state()) results = {'c': 3} batch.set_results(results) self.assertEqual(results, batch.get_results())
# 'perturbation': 3, # sigma perturbation on state vector # 'hypercube': 'FACES', # hypercube propagation type # 'originator': 'Robot', # originator of run # 'object_name': 'TestObj', # object name # 'object_id': 'test1234', # object ID }) batch = Batch(propagation_params, opm_params) print("Submitting OPM:") print(batch.get_opm_params().generate_opm()) # Submit and wait until batch run is ready batches_module = Batches(auth_rest) BatchRunManager(batches_module, [batch]).run() # Get final parts count parts_count = batch.get_state_summary().get_parts_count() print("Final state: %s, part count %s\n" % (batch.get_calc_state(), parts_count)) # Get ephemeris of specified part part_to_get = 0 eph = batch.get_results().get_parts()[part_to_get].get_ephemeris() print("Ephemeris:") print(eph) # Get the end state vector (uncomment to use) # end_state_vector = batch.get_results().get_end_state_vector() # print("State vector at the end of propagation:") # print(end_state_vector) # print("\n")