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

Reading a LIGO-Virgo skymap with healpy [public]

The following code reads in a FITS/Healpix file, and computes values at three sky points. You can see the skymap here.

To use the code, you will have to install the healpypackage.
# This program reads and interpolates a LIGO-Virgo skymap
# Requires "healpy" installation
# We have used a Bayestar skymap from the mock data challenge, visible here
# and here
# Questions 
# LIGO Caltech, 2015

import healpy, math
radian = 180/math.pi

filename = 'skymap_938672.fits'
map,header = healpy.read_map(filename, h=True)

print "Healpix file has nside = ", healpy.get_nside(map)
#for h in header: print h[0], h[1]

def interp_healpix(map, ra, dec):
    # convert to Healpix coordinates
    # ra: right ascension in degrees
    # dec: declination in degrees
    th = (90-dec)/radian   # codeclination in radians
    ph = ra/radian         # maps 24 hours = 360 degrees to 2*pi

    # interpolate at the given point
    return healpy.pixelfunc.get_interp_val(map, th, ph)

# near peak of largest bump
print "Big peak", interp_healpix(map, 278.335, 60.293) * 1.e6

# near peak of second largest bump
print "Second peak", interp_healpix(map, 258.659, 64.800) * 1.e6

# location of likely galaxy PGC063313 at 56 Mpc
print "Likely galaxy", interp_healpix(map, 292.7929, 54.0924)* 1.e6

-- RoyWilliams - 17 Apr 2015

  • 938672and3points.png:
Topic revision: r6 - 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