EXOSIMS package

Subpackages

Submodules

EXOSIMS.MissionSim module

class EXOSIMS.MissionSim.MissionSim(scriptfile=None, nopar=False, verbose=True, logfile=None, loglevel='INFO', checkInputs=True, **specs)[source]

Bases: object

Mission Simulation (backbone) class

This class is responsible for instantiating all objects required to carry out a mission simulation.

Parameters:
  • scriptfile (string) – Full path to JSON script file. If not set, assumes that dictionary has been passed through specs.

  • nopar (bool) – Ignore any provided ensemble module in the script or specs and force the prototype SurveyEnsemble. Defaults True

  • verbose (bool) – Input to vprint(), toggling verbosity of print statements. Defaults True.

  • logfile (str of None) – Path to the log file. If None, logging is turned off. If supplied but empty string (‘’), a temporary file is generated.

  • loglevel (str) – The level of log, defaults to ‘INFO’. Valid levels are: CRITICAL, ERROR, WARNING, INFO, DEBUG (case sensitive).

  • checkInputs (bool) – Validate inputs against selected modules. Defaults True.

  • **specs (dict) – Input Specification

StarCatalog

StarCatalog class object (only retained if keepStarCatalog is True)

Type:

StarCatalog module

PlanetPopulation

PlanetPopulation class object

Type:

PlanetPopulation module

PlanetPhysicalModel

PlanetPhysicalModel class object

Type:

PlanetPhysicalModel module

OpticalSystem

OpticalSystem class object

Type:

OpticalSystem module

ZodiacalLight

ZodiacalLight class object

Type:

ZodiacalLight module

BackgroundSources

Background Source class object

Type:

BackgroundSources module

PostProcessing

PostProcessing class object

Type:

PostProcessing module

Completeness

Completeness class object

Type:

Completeness module

TargetList

TargetList class object

Type:

TargetList module

SimulatedUniverse

SimulatedUniverse class object

Type:

SimulatedUniverse module

Observatory

Observatory class object

Type:

Observatory module

TimeKeeping

TimeKeeping class object

Type:

TimeKeeping module

SurveySimulation

SurveySimulation class object

Type:

SurveySimulation module

SurveyEnsemble

SurveyEnsemble class object

Type:

SurveyEnsemble module

modules

Dictionary of all modules, except StarCatalog

Type:

dict

verbose

Boolean used to create the vprint function, equivalent to the python print function with an extra verbose toggle parameter (True by default). The vprint function can be accessed by all modules from EXOSIMS.util.vprint.

Type:

bool

seed

Number used to seed the NumPy generator. Generated randomly by default.

Type:

int

logfile

Path to the log file. If None, logging is turned off. If supplied but empty string (‘’), a temporary file is generated.

Type:

str

loglevel

The level of log, defaults to ‘INFO’. Valid levels are: CRITICAL, ERROR, WARNING, INFO, DEBUG (case sensitive).

Type:

str

DRM2array(key, DRM=None)[source]

Creates an array corresponding to one element of the DRM dictionary.

Parameters:
  • key (str) – Name of an element of the DRM dictionary

  • DRM (list(dict)) – Design Reference Mission, contains the results of a survey simulation

Returns:

Array containing all the DRM values of the selected element

Return type:

ndarray or Quantity(ndarray)

checkScript(scriptfile, prettyprint=False, tofile=None)[source]

Calls CheckScript and checks the script file against the mission outspec.

Parameters:
  • scriptfile (str) – The path to the scriptfile being used by the sim

  • prettyprint (bool) – Outputs the results of Checkscript in a readable format.

  • tofile (str) – Name of the file containing all output specifications (outspecs). Default to None.

Returns:

Output string containing the results of the check.

Return type:

str

check_ioscripts() None[source]

Collect all input and output scripts against selected module inits and report and discrepancies.

filter_status(key, status, DRM=None, obsMode=None)[source]

Finds the values of one DRM element, corresponding to a status value, for detection or characterization.

Parameters:
  • key (string) – Name of an element of the DRM dictionary

  • status (integer) – Status value for detection or characterization

  • DRM (list of dicts) – Design Reference Mission, contains the results of a survey simulation

  • obsMode (string) – Observing mode type (‘det’ or ‘char’)

Returns:

Array containing all the DRM values of the selected element, and filtered by the value of the corresponding status array

Return type:

elemStat (ndarray / astropy Quantity array)

genOutSpec(tofile: str | None = None, modnames: bool = False) Dict[str, Any][source]

Join all _outspec dicts from all modules into one output dict and optionally write out to JSON file on disk.

Parameters:
  • tofile (str) – Name of the file containing all output specifications (outspecs). Defaults to None.

  • modnames (bool) – If True, populate outspec dictionary with the module it originated from, instead of the actual value of the keyword. Defaults False.

Returns:

Dictionary containing the full Input Specification, including all filled-in default values. Combination of all individual module _outspec attributes.

Return type:

dict

genWaypoint(targetlist=[], duration=365, tofile=None, charmode=False)[source]

generates a ballpark estimate of the expected number of star visits and the total completeness of these visits for a given mission duration

Parameters:
  • duration (int) – The length of time allowed for the waypoint calculation, defaults to 365

  • tofile (str) – Name of the file containing a plot of total completeness over mission time, by default genWaypoint does not create this plot

  • charmode (bool) – Run the waypoint calculation using either the char mode instead of the det mode

Returns:

Output dictionary containing the number of stars visited, the total completeness achieved, and the amount of time spent integrating.

Return type:

dict

get_logger(logfile, loglevel)[source]

Set up logging object so other modules can use logging.info(), logging.warning, etc.

Parameters:
  • logfile (string) – Path to the log file. If None, logging is turned off. If supplied but empty string (‘’), a temporary file is generated.

  • loglevel (string) – The level of log, defaults to ‘INFO’. Valid levels are: CRITICAL, ERROR, WARNING, INFO, DEBUG (case sensitive).

Returns:

Mission Simulation logger.

Return type:

logger (logging object)

reset_sim(genNewPlanets=True, rewindPlanets=True, seed=None)[source]

Convenience method that simply calls the SurveySimulation reset_sim method.

run_ensemble(nb_run_sim, run_one=None, genNewPlanets=True, rewindPlanets=True, kwargs={})[source]

Convenience method that simply calls the SurveyEnsemble run_ensemble method.

run_sim()[source]

Convenience method that simply calls the SurveySimulation run_sim method.

EXOSIMS.e2eTests module

End to End Test Suite for EXOSIMS

Run as:

>python e2eTests.py

This code will sequentially execute all script files found in: EXOSIMS_ROOT/EXOSIMS/Scripts/TestScripts and print a summary of the results. A script execution includes instantiating a MissionSim object using the script, running a simulation via run_sim(), resetting the simulation using reset_sim(), and finally re-running the simulation a second time. Possible outcomes for each test are:

PASS

FAIL - Instantiation

FAIL - Execution

FAIL - Reset

EXOSIMS.e2eTests.run_e2e_tests()[source]