Commit 16d6994e authored by Meg Millhouse's avatar Meg Millhouse
Browse files

Replace depreciated function call in ligo skymap

parent 6b4a9bf8
...@@ -335,15 +335,16 @@ def make_skyview(directory='.', mdc=None, NSIDE=128, inj=None, npost=5000, geo=F ...@@ -335,15 +335,16 @@ def make_skyview(directory='.', mdc=None, NSIDE=128, inj=None, npost=5000, geo=F
else: else:
true_ra = None true_ra = None
true_dec = None true_dec = None
( searched_area, searched_prob, offset, searched_modes, contour_areas, try:
area_probs, contour_modes, searched_prob_dist, contour_dists, skycoords = SkyCoord(true_ra,true_dec,unit='rad')
searched_vol, searched_prob_vol, contour_vols except:
) = postprocess.find_injection_moc(skymap,true_ra=true_ra, true_dec=true_dec, contours=[0.5, 0.9]) skycoords = None
crossmatch = postprocess.crossmatch(skymap, contours=[0.5, 0.9], coordinates=skycoords)
outfile = open('skystats.txt', 'w') outfile = open('skystats.txt', 'w')
outfile.write("# area50 area90 searcharea p_value \n") outfile.write("# area50 area90 searcharea p_value \n")
outfile.write("{0} {1} {2} {3}".format(contour_areas[0], contour_areas[1], searched_area, searched_prob)) outfile.write("{0} {1} {2} {3}".format(crossmatch.contour_areas[0], crossmatch.contour_areas[1], crossmatch.searched_area, crossmatch.searched_prob))
outfile.close() outfile.close()
...@@ -410,7 +411,7 @@ if __name__ == "__main__": ...@@ -410,7 +411,7 @@ if __name__ == "__main__":
print('Warning! Failed to read mdc') print('Warning! Failed to read mdc')
mdc = None mdc = None
make_skyview(args[0], mdc, NSIDE, injpos, npost, geo) xyz = make_skyview(args[0], mdc, NSIDE, injpos, npost, geo)
# Move back to original dir # Move back to original dir
os.chdir(topdir) os.chdir(topdir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment