def get_children(self, uuid): child_response_list = AdamObjects._get_children_json(self, uuid) children = [] for childJson, child_runnable_state, child_type in child_response_list: # All child types should be SinglePropagation, but ignore those # that aren't just in case. if not child_type == 'SinglePropagation': print('Skipping child of unexpected type ' + child_type) continue # Values in [] are guaranteed to be present. Values in .get() may be missing. childOpmParams = OpmParams.fromJsonResponse( childJson['propagationParameters']['opm']) childPropParams = PropagationParams.fromJsonResponse( childJson['propagationParameters'], childJson.get('description')) childProp = SinglePropagation(childPropParams, childOpmParams) childProp.set_uuid(childJson['uuid']) childProp.set_runnable_state(child_runnable_state) childProp.set_ephemeris(childJson.get('ephemeris')) childProp.set_final_state_vector(childJson.get('finalStateVector')) children.append(childProp) return children
def get_dummy_batch(project): return Batch( PropagationParams({ 'start_time': 'today', 'end_time': 'tomorrow', 'project_uuid': project }), OpmParams({ 'epoch': 'today', 'state_vector': [1, 2, 3, 4, 5, 6] }))
def get(self, uuid): response = AdamObjects._get_json(self, uuid) if response is None: return None # Values in [] are guaranteed to be present. Values in .get() may be missing. opmParams = OpmParams.fromJsonResponse( response['templatePropagationParameters']['opm']) propParams = PropagationParams.fromJsonResponse( response['templatePropagationParameters'], response.get('description')) batch_propagation = BatchPropagation(propParams, opmParams) batch_propagation.set_uuid(response['uuid']) batch_propagation.set_summary(response.get('summary')) return batch_propagation
def get(self, uuid): response = AdamObjects._get_json(self, uuid) if response is None: return None opmParams = OpmParams.fromJsonResponse( response['initialPropagationParameters']['opm']) propParams = PropagationParams.fromJsonResponse( response['initialPropagationParameters'], response.get('description')) targetingParams = TargetingParams.fromJsonResponse( response['targetingParameters']) targeted_propagation = TargetedPropagation( propParams, opmParams, targetingParams) uuid = response['uuid'] ephemeris = response.get('ephemeris') maneuver = None if 'maneuverX' in response: maneuver = [response['maneuverX'], response['maneuverY'], response['maneuverZ']] targeted_propagation.set_uuid(uuid) targeted_propagation.set_ephemeris(ephemeris) targeted_propagation.set_maneuver(maneuver) return targeted_propagation