adam.batch_propagation_results module¶
batch_propagation_results.py
-
class
adam.batch_propagation_results.
ApsResults
(client, job_uuid)¶ Bases:
object
API for retrieving job details
-
__init__
(client, job_uuid)¶ Initialize self. See help(type(self)) for accurate signature.
-
check_status
()¶
-
get_results
(force_update=True)¶
-
job_id
()¶
-
json
()¶
-
wait_for_complete
(max_wait_sec=60, print_waiting=False)¶ Polls the job until the job completes.
- Parameters
max_wait_sec (int) – the maximum time in seconds to run the wait. Defaults to 60.
print_waiting (boolean) – Whether to print the waiting status messages. Defaults to False.
- Returns
the job status.
- Return type
str
-
-
class
adam.batch_propagation_results.
MonteCarloResults
(results_processor, job_uuid)¶ Bases:
adam.batch_propagation_results.ApsResults
API for retrieving propagation results and summaries
-
class
PositionOrbitType
(value)¶ Bases:
enum.Enum
The type of orbit position in relation to a target body.
-
CLOSE_APPROACH
= 'CLOSE_APPROACH'¶
-
IMPACT
= 'IMPACT'¶
-
MISS
= 'MISS'¶
-
-
__init__
(results_processor, job_uuid)¶ Initialize self. See help(type(self)) for accurate signature.
-
get_ephemeris_as_dataframe
(run_index: int, orbit_event_type: Optional[adam.batch_propagation_results.OrbitEventType] = None) → pandas.core.frame.DataFrame¶ Get ephemeris content and convert it to a pandas DataFrame.
- Parameters
run_index (int) – The run number of the ephemeris
orbit_event_type (Optional[OrbitEventType]) – The OrbitEventType of the ephemeris
- Returns
The STK ephemeris in a pandas DataFrame.
- Return type
pandas.DataFrame
-
get_ephemeris_content
(run_index: int, orbit_event_type: Optional[adam.batch_propagation_results.OrbitEventType] = None, force_update: bool = False) → str¶ Retrieves an ephemeris file and returns the text content.
This doesn’t use the ADAM REST wrapper, since that class assumes the response will be in json, and this is an ephemeris. For now, it’s fine to use requests directly.
- Parameters
run_index (int) – The run number of the ephemeris
orbit_event_type (Optional[OrbitEventType]) – The OrbitEventType of the ephemeris
force_update (bool) – Whether the results should be reloaded from the server
- Returns
The ephemeris content, as a string.
- Return type
str
-
get_final_positions
(position_orbit_type: adam.batch_propagation_results.MonteCarloResults.PositionOrbitType, force_update=False)¶ Get the final positions of all propagated objects in the job.
- Parameters
position_orbit_type (PositionOrbitType) – the type of orbit position to filter.
force_update (boolean) – whether the request should be re-executed.
- Returns
A list of the final orbit positions, filtered by the position_orbit_type.
- Return type
list
-
get_result_ephemeris
(run_number, force_update=False) → pandas.core.frame.DataFrame¶ Get an ephemeris for a particular run in the batch as a Pandas DataFrame
- Parameters
force_update (boolean) – whether the request should be re-executed.
- Returns
Ephemeris from file as a Pandas DataFrame
- Return type
ephemeris
-
get_result_ephemeris_count
(force_update=False)¶ Get the number of ephemerides.
- Parameters
force_update (boolean) – whether the request should be re-executed.
- Returns
the number of ephemerides generated from the propagation.
- Return type
int
-
get_result_raw_ephemeris
(run_number, force_update=False)¶ Get an ephemeris for a particular run in the batch.
- Parameters
force_update (boolean) – whether the request should be re-executed.
- Returns
the ephemeris file as a string.
- Return type
str
-
get_states_content
(orbit_event_type: adam.batch_propagation_results.OrbitEventType, force_update: bool = False) → str¶ Retrieves a states file and returns the content as a string.
This doesn’t use the ADAM REST wrapper, since that class assumes the response will be in json, and this is an ephemeris. For now, it’s fine to use requests directly.
- Parameters
orbit_event_type (OrbitEventType) – The type of OrbitEvent for which to retrieve the states output.
force_update (bool) – Whether the results should be reloaded from the server
- Returns
The content of the state file.
- Return type
str
-
get_states_dataframe
(orbit_event_type: adam.batch_propagation_results.OrbitEventType, force_update: bool = False) → pandas.core.frame.DataFrame¶ Retrieves a states file and returns it as a pandas DataFrame.
This doesn’t use the ADAM REST wrapper, since that class assumes the response will be in json, and this is an ephemeris. For now, it’s fine to use requests directly.
- Parameters
orbit_event_type (OrbitEventType) – The type of OrbitEvent for which to retrieve the states output.
force_update (bool) – Whether the results should be reloaded from the server
- Returns
The STK ephemeris in a pandas DataFrame.
- Return type
pandas.DataFrame
-
get_summary
(force_update=False)¶ Get the propagation results summary.
- Parameters
force_update (boolean) – True if calling this method should be re-executed, otherwise False (default).
- Returns
summary (MonteCarloSummary)
-
list_all_ephemerides_files
() → Dict¶ Lists all ephemerides from the job results.
Performs all the paging without user intervention.
- Returns
Dict containing the ephemerides paths
-
list_result_ephemerides_files
(page_size: int = 100, page_token: str = None) → Dict¶ List one page of ephemerides files from the job results.
- Parameters
page_size (int) – The size of the results to retrieve
page_token (str) – Which page to retrieve
- Returns
Dict containing the ephemerides paths
-
list_state_files
(force_update: bool = False) → List[str]¶ List the state files generated during the propagation.
- Parameters
force_update (bool) – Whether the results should be reloaded from the server
- Returns
a list of URL strings for the state files.
- Return type
list (str)
-
class
-
class
adam.batch_propagation_results.
MonteCarloSummary
(misses, close_approach, impacts, pc)¶ Bases:
object
-
__init__
(misses, close_approach, impacts, pc)¶ Initialize self. See help(type(self)) for accurate signature.
-
get_close_approaches
()¶
-
get_impacts
()¶
-
get_misses
()¶
-
get_pc
()¶
-
-
class
adam.batch_propagation_results.
OrbitEventType
(value)¶ Bases:
enum.Enum
Events of interest, from an orbit propagation.
This is the same as PositionOrbitType, but with updated naming to be consistent with the server-side enum.
-
CLOSE_APPROACH
= 'CLOSE_APPROACH'¶
-
IMPACT
= 'IMPACT'¶
-
MISS
= 'MISS'¶
-
-
class
adam.batch_propagation_results.
ResultsClient
(rest=<adam.rest_proxy.AuthenticatingRestProxy object>)¶ Bases:
object
Module for managing results interactions.
-
__init__
(rest=<adam.rest_proxy.AuthenticatingRestProxy object>)¶ Initialize the Results Service API client.
- Parameters
rest (RestProxy) – a RestProxy that makes calls to the ADAM API.
-
get_monte_carlo_results
(job)¶ Get the job results for a specific job for a specific project.
- Parameters
job (Job) – The job id or Job object that has the Job ID in it
- Returns
a result object that can be used to query for data about the submitted job
- Return type
result (MonteCarloResults)
-