gwcelery.tasks.inference module

Source Parameter Estimation with LALInference and Bilby.

exception gwcelery.tasks.inference.NotEnoughData[source]

Bases: Exception

Raised if found data is not enough due to the latency of data transfer

(task)gwcelery.tasks.inference.query_data(trigtime)[source]

Continues to query data until it is found with gwdatafind and return frametypes for the data. If data is not found in 86400 seconds = 1 day, raise NotEnoughData.

(task)gwcelery.tasks.inference.upload_no_frame_files(request, exc, traceback, superevent_id)[source]

Upload notification when no frame files are found.

Parameters
  • request (Context (placeholder)) – Task request variables

  • exc (Exception) – Exception rased by condor.submit

  • traceback (str (placeholder)) – Traceback message from a task

  • superevent_id (str) – The GraceDB ID of a target superevent

(task)gwcelery.tasks.inference.prepare_ini(frametype_dict, event, superevent_id=None)[source]

Determine an appropriate PE settings for the target event and return ini file content for LALInference pipeline

gwcelery.tasks.inference.pre_pe_tasks(event, superevent_id)[source]

Return canvas of tasks executed before parameter estimation starts

(task)gwcelery.tasks.inference._setup_dag_for_lalinference(coinc_psd, ini_contents, rundir, superevent_id)[source]

Create DAG for a lalinference run and return the path to DAG.

Parameters
  • coinc_psd (tuple of byte contents) – Tuple of the byte contents of coinc.xml and psd.xml.gz

  • ini_contents (str) – The content of online_lalinference_pe.ini

  • rundir (str) – The path to a run directory where the DAG file exits

  • superevent_id (str) – The GraceDB ID of a target superevent

Returns

path_to_dag – The path to the .dag file

Return type

str

(task)gwcelery.tasks.inference._setup_dag_for_bilby(event, rundir, preferred_event_id, superevent_id)[source]

Create DAG for a bilby run and return the path to DAG.

Parameters
  • event (json contents) – The json contents retrieved from gracedb.get_event()

  • rundir (str) – The path to a run directory where the DAG file exits

  • preferred_event_id (str) – The GraceDB ID of a target preferred event

  • superevent_id (str) – The GraceDB ID of a target superevent

Returns

path_to_dag – The path to the .dag file

Return type

str

(task)gwcelery.tasks.inference._condor_no_submit(path_to_dag)[source]

Run ‘condor_submit_dag -no_submit’ and return the path to .sub file.

(task)gwcelery.tasks.inference.dag_prepare_task(rundir, superevent_id, preferred_event_id, pe_pipeline, ini_contents=None)[source]

Return a canvas of tasks to prepare DAG.

Parameters
  • rundir (str) – The path to a run directory where the DAG file exits

  • superevent_id (str) – The GraceDB ID of a target superevent

  • preferred_event_id (str) – The GraceDB ID of a target preferred event

  • pe_pipeline (str) – The parameter estimation pipeline used Either ‘lalinference’ OR ‘bilby’

  • ini_contents (str) – The content of online_lalinference_pe.ini Required if pe_pipeline == ‘lalinference’

Returns

canvas – The canvas of tasks to prepare DAG

Return type

canvas of tasks

(task)gwcelery.tasks.inference.job_error_notification(request, exc, traceback, superevent_id, rundir, pe_pipeline)[source]

Upload notification when condor.submit terminates unexpectedly.

Parameters
  • request (Context (placeholder)) – Task request variables

  • exc (Exception) – Exception rased by condor.submit

  • traceback (str (placeholder)) – Traceback message from a task

  • superevent_id (str) – The GraceDB ID of a target superevent

  • rundir (str) – The run directory for PE

  • pe_pipeline (str) – The parameter estimation pipeline used Either lalinference OR bilby

(task)gwcelery.tasks.inference._upload_url(pe_results_path, graceid, pe_pipeline)[source]

Upload url of a page containing all of the plots.

gwcelery.tasks.inference.upload_results_tasks(pe_results_path, filename, graceid, message, tag, uploaded_filename=None)[source]

Return tasks to get the contents of PE result files and upload them to GraceDB.

Parameters
  • pe_results_path (string) – Directory under which the target file located.

  • filename (string) – Name of the target file

  • graceid (string) – GraceDB ID

  • message (string) – Message uploaded to GraceDB

  • tag (str) – Name of tag to add the GraceDB log

  • uploaded_filename (str) – Name of the uploaded file. If not supplied, it is the same as the original file name.

Returns

tasks

Return type

list of celery tasks

(task)gwcelery.tasks.inference.clean_up(rundir)[source]

Clean up a run directory.

Parameters

rundir (str) – The path to a run directory where the DAG file exits

(task)gwcelery.tasks.inference.dag_finished(rundir, preferred_event_id, superevent_id, pe_pipeline)[source]

Upload PE results and clean up run directory

Parameters
  • rundir (str) – The path to a run directory where the DAG file exits

  • preferred_event_id (str) – The GraceDB ID of a target preferred event

  • superevent_id (str) – The GraceDB ID of a target superevent

  • pe_pipeline (str) – The parameter estimation pipeline used Either lalinference OR bilby

Returns

tasks – The work-flow for uploading PE results

Return type

canvas

(task)gwcelery.tasks.inference._download_psd(gid)[source]

Download psd.xml.gz and return its content. If that file does not exist, return None.

(task)gwcelery.tasks.inference.start_pe(ini_contents, preferred_event_id, superevent_id, pe_pipeline)[source]

Run Parameter Estimation on a given event.

Parameters
  • ini_contents (str) – The content of online_lalinference_pe.ini

  • preferred_event_id (str) – The GraceDB ID of a target preferred event

  • superevent_id (str) – The GraceDB ID of a target superevent

  • pe_pipeline (str) – The parameter estimation pipeline used lalinference OR bilby