Task Manager (corrections.TaskManager)

class corrections.TaskManager(todo_file, cleanup=False, overwrite=False, summary=None, summary_interval=100)[source]

A TaskManager which keeps track of which targets to process.

__init__(todo_file, cleanup=False, overwrite=False, summary=None, summary_interval=100)[source]

Initialize the TaskManager which keeps track of which targets to process.

Parameters:
  • todo_file (string) – Path to the TODO-file.
  • cleanup (boolean, optional) – Perform cleanup/optimization of TODO-file before during initialization. Default=False.
  • overwrite (boolean, optional) – Overwrite any previously calculated results. Default=False.
Raises:

FileNotFoundError – If TODO-file could not be found.

close()[source]
get_number_tasks(starid=None, camera=None, ccd=None, datasource=None)[source]

Get number of tasks due to be processed.

Returns:Number of tasks due to be processed.
Return type:int
get_random_task()[source]

Get random task to be processed. :returns: Dictionary of settings for task. :rtype: dict or None

get_task(starid=None, camera=None, ccd=None, datasource=None)[source]

Get next task to be processed.

Returns:Dictionary of settings for task.
Return type:dict or None
save_results(result)[source]
start_task(taskid)[source]

Mark a task as STARTED in the TODO-list.

write_summary()[source]

Write summary of progress to file. The summary file will be in JSON format.