sim_archive API#
- rubin_sim.sim_archive.add_make_scheduler_snapshot_args(parser)[source]#
Add arguments needed for saving a scheduler to an argument parser.
- Parameters:
parser (
ArgumentParser
)- Return type:
None
- rubin_sim.sim_archive.get_scheduler(config_repo=None, config_script=None, config_branch='main', visits_db=None)[source]#
Generate a CoreScheduler according to a configuration.
- Parameters:
config_repo (
str
) – The git repository with the configuration.config_script (
str
) – The configuration script path (relative to the repository root).config_branch (
str
, optional) – The branch of the repository to use, by default “main”visits_db (
str
orNone
) – Database from which to load pre-existing visits
- Returns:
scheduler – An instance of the Rubin Observatory FBS.
- Return type:
CoreScheduler
- Raises:
ValueError – If the config file is invalid, or has invalid content.
- rubin_sim.sim_archive.get_scheduler_from_config(config_script_path)[source]#
Generate a CoreScheduler according to a configuration in a file.
- Parameters:
config_script_path (
str
) – The configuration script path- Return type:
Tuple
[int
,CoreScheduler
]- Returns:
nside (
int
) – The nside.scheduler (
CoreScheduler
) – An instance of the Rubin Observatory FBS.
- Raises:
ValueError – If the config file is invalid, or has invalid content.
- rubin_sim.sim_archive.get_scheduler_instance_from_repo(config_repo, config_script, config_branch='main')[source]#
Generate a CoreScheduler according to a configuration in git.
- Parameters:
config_repo (
str
) – The git repository with the configuration.config_script (
str
) – The configuration script path (relative to the repository root).config_branch (
str
, optional) – The branch of the repository to use, by default “main”
- Returns:
scheduler – An instance of the Rubin Observatory FBS.
- Return type:
CoreScheduler
- Raises:
ValueError – If the config file is invalid, or has invalid content.
- rubin_sim.sim_archive.save_scheduler(scheduler, file_name)[source]#
Save an instances of the scheduler in a pickle file, compressed according to its extension.
- Parameters:
scheduler (
CoreScheduler
) – The scheduler to save.file_name (
str
) – The file in which to save the schedulers.
- Return type:
None