gwcelery.tasks.inference module

Source Parameter Estimation with LALInference, Bilby, and RapidPE.

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. This query will be retried for ~4600 seconds, which is longer than the expected latency of transfer of high-latency data with length of ~4000 seconds.

(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 raised by query_data

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

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

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

Determine LALInference configurations and return ini file content

Parameters:
  • frametype_dict (dict) – Dictionary whose keys are ifos and values are frame types

  • event (dict) – The json contents of a target G event retrieved from gracedb.get_event(), whose mass and spin information are used to determine analysis settings.

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

Returns:

ini_contents

Return type:

str

(task)gwcelery.tasks.inference._setup_dag_for_lalinference(coinc, rundir, event, superevent_id, frametype_dict)[source]

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

Parameters:
  • coinc (byte contents) – Byte contents of coinc.xml. The PSD is expected to be embedded.

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

  • event (dict) – The json contents of a target G event retrieved from gracedb.get_event(), whose mass and spin information are used to determine analysis settings.

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

  • frametype_dict (dict) – Dictionary whose keys are ifos and values are frame types

Returns:

path_to_dag – The path to the .dag file

Return type:

str

(task)gwcelery.tasks.inference._setup_dag_for_bilby(coinc, rundir, event, superevent_id, mode='production')[source]

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

Parameters:
  • coinc (bytes) – Byte contents of coinc.xml. The PSD is expected to be embedded.

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

  • event (dict) – The json contents of a target G event retrieved from gracedb.get_event(), whose mass and spin information are used to determine analysis settings.

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

  • mode (str) – Analysis mode, allowed options are “production” and “fast_test”, default is “production”.

Returns:

path_to_dag – The path to the .dag file

Return type:

str

Notes

–channel-dict o3replay is added to bilby_pipe_gracedb arguments when the gracedb host is different from gracedb.ligo.org or gracedb-test.ligo.org. Condor queue is set to Online_PE if gracedb host is gracedb.ligo.org, and Online_PE_MDC otherwise.

(task)gwcelery.tasks.inference._setup_dag_for_rapidpe(rundir, superevent_id, frametype_dict)[source]

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

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

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

  • frametype_dict (dict) – Dictionary whose keys are ifos and values are frame types

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.

gwcelery.tasks.inference.dag_prepare_task(rundir, event, superevent_id, pe_pipeline, frametype_dict=None, **kwargs)[source]

Return a canvas of tasks to prepare DAG.

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

  • event (dict) – The json contents of a target G event retrieved from gracedb.get_event(), whose mass and spin information are used to determine analysis settings.

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

  • pe_pipeline (str) – The parameter estimation pipeline used, lalinference, bilby, or rapidpe.

  • frametype_dict (dict) – Dictionary whose keys are ifos and values are frame types

Returns:

canvas – The canvas of tasks to prepare DAG

Return type:

canvas of tasks

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

Remove large data products produced by bilby

Parameters:

rundir (str) –

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

Upload notification when condor.submit terminates unexpectedly.

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

  • exc (Exception) – Exception raised 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

  • analysis (str) – Analysis name used as a label in uploaded messages

Notes

Some large bilby data products are cleaned up after the notification if the gracedb host is different from gracedb.ligo.org.

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

Upload PE results

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

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

  • pe_pipeline (str) – The parameter estimation pipeline used, lalinference, bilby, or rapidpe.

(task)gwcelery.tasks.inference.start_pe(frametype_dict, event, superevent_id, pe_pipeline)[source]

Run Parameter Estimation on a given event.

Parameters:
  • frametype_dict (dict) – Dictionary whose keys are ifos and values are frame types

  • event (dict) – The json contents of a target G event retrieved from gracedb.get_event(), whose mass and spin information are used to determine analysis settings.

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

  • pe_pipeline (str) – The parameter estimation pipeline used, lalinference, bilby, or rapidpe.