You are here: GW-Astronomy wiki>LV_EM Web>TechInfo>CurlGetSkymap (2018-05-29, adminuser)Edit Attach

Using Curl with GraceDB [public]

How to fetch a Skymap

The following program builds the curl commands that you can use to communicate with the LIGO-Virgo event database, GraceDB. You should already be able to log in and get a password, then put that in your .netrc file as in the example below, and then you can download the FITS-HEALPIX file with the probability density of the counterpart location.

# Download a LIGO-Virgo skymap using curl.
# Roy Williams <>

# Add a line like this to your ~/.netrc file:
#    machine login albert.einstein@LIGO.ORG password JKJKJKJkjkjkjkj1223
# You can get the password from:

import os

def download_skymap(grace_id, name='bayestar', base_url=''):
    Download a sky map from GraceDb.

    grace_id : string
        The GraceDb identifier of the event
    name : string
        The filename, less the '.fits.gz' extension
    base_url : string
        The base URL of the GraceDb server. By default, the production server.

    command = 'curl --netrc {base_url}/apibasic/events/{grace_id}/files/{name}.fits.gz -o {grace_id}_{name}.fits.gz'.format(
        base_url=base_url, grace_id=grace_id, name=name)

# Example using the function above:
if __name__ == '__main__':
    grace_id = 'T125738'        # identifier for the event
    download_skymap(grace_id)   # fetch the sky map

-- RoyWilliams - 20 Apr 2015
Topic revision: r9 - 2018-05-29, adminuser
Warning: Can't find topic LV_EM.WebLeftBarExample

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GW-Astronomy wiki? Send feedback