gwcelery.tasks.external_skymaps module

Create and upload external sky maps.

(task)gwcelery.tasks.external_skymaps.create_combined_skymap(se_id, ext_id)[source]

Creates and uploads the combined LVC-Fermi skymap, uploading to the external trigger GraceDB page.

(task)gwcelery.tasks.external_skymaps.get_skymap_filename(graceid)[source]

Get the skymap fits filename.

If not available, will try again 10 seconds later, then 20, then 40, etc. until up to 10 minutes after initial attempt.

(task)gwcelery.tasks.external_skymaps._download_skymaps(se_filename, ext_filename, se_id, ext_id)[source]

Download both superevent and external sky map to be combined.

gwcelery.tasks.external_skymaps.combine_skymaps_moc_flat(gw_sky, ext_sky, ext_header)[source]

This function combines a multiordered (MOC) GW sky map with a flattened external one by reweighting the MOC sky map using the values of the flattened one.

Header info is generally inherited from the GW sky map or recalculated using the combined sky map values.

(task)gwcelery.tasks.external_skymaps.combine_skymaps(skymapsbytes, gw_moc=True)[source]

This task combines the two input skymaps, in this case the external trigger skymap and the LVC skymap and writes to a temporary output file. It then returns the contents of the file as a byte array.

There are separate methods in case the GW sky map is multiordered (we just reweight using the external sky map) or flattened (use standard ligo.skymap.combine method).

(task)gwcelery.tasks.external_skymaps.external_trigger(graceid)[source]

Returns the associated external trigger GraceDB ID.

(task)gwcelery.tasks.external_skymaps.external_trigger_heasarc(external_id)[source]

Returns the HEASARC fits file link.

(task)gwcelery.tasks.external_skymaps.get_external_skymap(link, search)[source]

Download the Fermi sky map fits file and return the contents as a byte array. If GRB, will construct a HEASARC url, while if SubGRB, will use the link directly.

If not available, will try again 10 seconds later, then 20, then 40, etc. until up to 10 minutes after initial attempt.

(task)gwcelery.tasks.external_skymaps.get_upload_external_skymap(event, skymap_link=None)[source]

If a Fermi sky map is not uploaded yet, tries to download one and upload to external event. If sky map is not available, passes so that this can be re-run the next time an update GCN notice is received. If GRB, will construct a HEASARC url, while if SubGRB, will use the link directly.

gwcelery.tasks.external_skymaps.create_external_skymap(ra, dec, error, pipeline, notice_type=111)[source]

Create a sky map, either a gaussian or a single pixel sky map, given an RA, dec, and error radius.

If from Fermi, convolves the sky map with both a core and tail Gaussian and then sums these to account for systematic effects as measured in doi:10.1088/0067-0049/216/2/32

If from Swift, converts the error radius from that containing 90% of the credible region to ~68% (see description of Swift error here:https://gcn.gsfc.nasa.gov/swift.html#tc7)

Parameters:
  • ra (float) – right ascension in deg

  • dec (float) – declination in deg

  • error (float) – error radius in deg

Returns:

skymap – sky map array

Return type:

numpy array

gwcelery.tasks.external_skymaps.write_to_fits(skymap, event, notice_type, notice_date)[source]

Write external sky map fits file, populating the header with relevant info.

Parameters:
  • skymap (numpy array) – sky map array

  • event (dict) – Dictionary of Swift external event

Returns:

skymap fits – bytes array of sky map

Return type:

bytes array

(task)gwcelery.tasks.external_skymaps.create_upload_external_skymap(event, notice_type, notice_date)[source]

Create and upload external sky map using RA, dec, and error radius information.

Parameters:

event (dict) – Dictionary of Swift external event

(task)gwcelery.tasks.external_skymaps.plot_overlap_integral(coinc_far_dict, superevent_id, ext_id, var_label='\\\\mathcal{I}_{\\\\Omega}')[source]

Plot and upload visualization of the sky map overlap integral computed by ligo.search.overlap_integral.

Parameters:
  • coinc_far_dict (dict) – Dictionary containing coincidence false alarm rate results from RAVEN

  • superevent_id (str) – superevent GraceDB ID

  • ext_id (str) – external event GraceDB ID

  • var_label (str) – The variable symbol used in plotting