<jupyter_start><jupyter_text>NS Merger Training Workshop  Centro Residenziale Universitario di Bertinoro, 12-16 November 2018 https://nsmergerworkshop.wordpress.com/    Electromagnetic follow-up of gravitational-wave events*by <NAME> ,<NAME>  and M.Branchesi  and many others* The tutorial focuses on some  basic strategies for working with gravitational-wave  sky localization maps in the context of the EM-followUP activity. Here we propose the use of [Aladin](http://aladin.u-strasbg.fr/), [TOPCAT](http://www.star.bris.ac.uk/~mbt/topcat/) and [GWsky](https://github.com/ggreco77/GWsky). The following main topics are addressed.1. Gravitational-Wave sky localization map: visualization and tiling2. Access to existing catalogs using the Multi-Order Coverage map (MOC)3. Planning for EM follow-up observations  The gravitational-wave (GW) astronomyThe era of gravitational-wave (GW) astronomy began with the detection of binary black hole (BBH) mergers, by the [Advanced Laser Interferometer Gravitational-Wave Observatory](http://iopscience.iop.org/article/10.1088/0264-9381/32/7/074001/meta;jsessionid=C8FA1A8959EC5DE7B54BED96DDBEF1CD.c4.iopscience.cld.iop.org) (LIGO) detectors, during the first of the Advanced Detector Observation Runs. Three detections, [GW150914](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.116.061102), [GW151226](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.116.241103), and [GW170104](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.118.221101), and a lower significance candidate, [LVT151012](https://journals.aps.org/prx/abstract/10.1103/PhysRevX.6.041015), have been announced so far. The [Advanced Virgo detector](http://iopscience.iop.org/article/10.1088/0264-9381/32/2/024001/meta) joined the second observation run on August 1, 2017. Three-Way Detection of Gravitational WavesOn August 14, a signal was seen at LIGO-Livingston; 8 milliseconds later, LIGO-Hanford reported a detection; and 6 milliseconds after that, Virgo detected a signal. A statistical analysis by the LIGO and Virgo collaborations suggested that such a multi-site detection would occur in random signals at most once in 27,000 years. **The first simultaneous detection of gravitational radiation by the LIGO and Virgo detectors greatly improves localization of the source and permits a novel test of general relativity - [GW170814: A Three-Detector Observation of Gravitational Waves from a Binary Black Hole Coalescence](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.119.141101fulltext).**The LIGO and Virgo team alerted the astronomical community to the detection, but no corresponding signal has been found in any part of the electromagnetic spectrum or in neutrinos. The lack of an optical counterpart isn’t really a surprise *two such black holes in a close orbit are likely to sweep their immediate vicinity clear of gas and dust and the gravitational radiation released by the merger does not agitate what little material remains enough to emit electromagnetic energy*.  [Focus: Three-Way Detection of Gravitational Waves](https://physics.aps.org/articles/v10/110). Observations of a Binary Neutron Star MergerOn August 17, 2017 astronomers around the world were alerted to gravitational waves observed by the Advanced LIGO and Advanced Virgo detectors. This gravitational wave event, now known as GW170817, appeared to be the result of the merger of two neutron stars (BNS). Less than two seconds after the GW170817 signal, NASA's [Fermi](https://fermi.gsfc.nasa.gov/) satellite observed a gamma-ray burst, now known as GRB170817A, and within minutes of these initial detections telescopes around the world began an extensive observing campaign. The [Swope telescope](http://obs.carnegiescience.edu/swope) in Chile was the first to report a bright optical source (SSS17a/AT2017gfo) in the galaxy NGC 4993 and several other teams independently detected the same transient over the next minutes and hours. For the next several weeks astronomers observed this location with instruments sensitive across the electromagnetic spectrum; these observations provide a comprehensive view of this cataclysmic event starting ~100 seconds before merger until several weeks after. The observations support the hypothesis that two neutron stars merged in NGC 4993 - producing gravitational waves, a short-duration gamma-ray burst, and a kilonova. This observation firmly connects kilonovae with the BNS merger, providing evidence that kilonovae result from the radioactive decay of the heavy elements formed by neutron capture during a BNS merger - including gold and platinum - solving a decades long mystery of where about half of all elements heavier than iron are produced. GW170817 marks a new era of multi-messenger astronomy, where the same event is observed by both gravitational waves and electromagnetic waves [The Dawn of Multi-Messenger Astrophysics: Observations of a Binary Neutron Star Merger](http://ligo.org/science/Publication-GW170817MMA/).<jupyter_code>display(Image(url='http://ligo.org/science/Publication-GW170817MMA/images/BNS.png',width=600, height=500))<jupyter_output><empty_output><jupyter_text>**Fig.1.**  shows an artist's illustration of two merging neutron stars. The narrow beams represent the gamma-ray burst while the rippling spacetime grid indicates the isotropic gravitational waves that characterize the merger. Swirling clouds of material ejected from the merging stars are a possible source of the light that was seen at lower energies.  The gravitational-wave events detected so farThe gif shows the sky localizations of the gravitational-wave events detected so far in galactic projection. GW150914, GW151226, GW170104 and GW170814 are generated from the merger of two black holes.  GW170817 is the first observation of gravitational-waves from a pair of inspiraling neutron stars. Electromagnetic emission from the resulting collision was also observed in multiple wavelength bands. This occured on August 17, 2017 and represents the first time a cosmic event was observed with both gravitational waves and light.<jupyter_code>from IPython.display import Image
from IPython.display import display
display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/sky_localizations_v2.gif?raw=true'))<jupyter_output><empty_output><jupyter_text>**FIG.2.** Sky localizations computed using LALinference for a selection of GW events. The addition of Virgo shows a dramatic increase in the sky localizations of GW170814 and GW170817. *Credit Background image: Mellinger*.  Gravitational wave sky localizationProviding prompt localizations for GW signals helps to maximise the chance that electromagnetic observatories can catch a counterpart. Sky maps will be produced at several different latencies, with updates coming from more computationally expensive algorithms that refine our understanding of the source. For Compact Binary Coalescences (CBCs), rapid sky localization is performed using [bayestar](https://journals.aps.org/prd/abstract/10.1103/PhysRevD.93.024013), a Bayesian parameter-estimation code that computes source location using output from the detection pipeline. It can produce sky maps  with latencies of only a few seconds.At higher latency, compact binary coalescences (CBCs) parameter estimation is performed using the stochastic sampling algorithms of [LALInference](https://journals.aps.org/prd/abstract/10.1103/PhysRevD.91.042003). LALInference constructs posterior probability distributions for system parameters (not just location, but also mass, orientation, etc.) by matching GW templates to the detector strain. Sky locations can  be reported with latency of  *days/weeks/months* - [Prospects for Observing and Localizing Gravitational-Wave Transients with Advanced LIGO and Advanced Virgo](https://www.emis.de/journals/LRG/Articles/lrr-2016-1/title.html).<jupyter_code>display(Image(url='https://www.emis.de/journals/LRG/Articles/lrr-2016-1/f4.png'))<jupyter_output><empty_output><jupyter_text>**FIG.3.** Source localization by triangulation for the aLIGO–AdV network. The locations of the three detectors are indicated by black dots, with LIGO Hanford labeled H; LIGO Livingston as L, and Virgo as V. The locus of constant time delay (with associated timing uncertainty) between two detectors forms an annulus on the sky concentric about the baseline between the two sites (labeled by the two detectors). For three detectors, these annuli may intersect in two locations. One is centered on the true source direction (S), while the other (′ S) is its mirror image with respect to the geometrical plane passing through the three sites. For four or more detectors there is a unique intersection region of all of the annuli. However the triangulation approach underestimates how well a source can be localized, since it does not include all the relevant information. Its predictions can be improved by introducing the requirement of phase consistency between detectors.  LIGO/Virgo probability sky maps Probability sky maps associated with a gravitational-wave signal detected by the Advanced LIGO and Virgo are given as all-sky images stored in the [HEALPix](http://healpix.sourceforge.net/)(Hierarchical Equal Area isoLatitude Pixelisation) projection.The  sphere  is  hierarchically tessellated into curvilinear quadrilaterals; the resolution of the tessellation can be increased by the division of each pixel into four new ones.  The lowest resolution partition is comprised of twelve base pixels.The pixel position on the sky is uniquely specified by the index in the array and the array’s length.The resolution of the grid is expressed by the parameter Nside,and the total number of pixels equal to Npix = 12 x Nside2. In such context, the value stored at each pixel represents the probability that the gravitational-wave source is located within that pixel (see [LIGO-Virgo EM Follow-Up Tutorial](http://nbviewer.jupyter.org/github/lpsinger/ligo-virgo-emfollowup-tutorial/blob/master/ligo-virgo-emfollowup-tutorial.ipynb)).<jupyter_code>display(Image(url='https://healpix.jpl.nasa.gov/images/healpixGridRefinement.jpg'))<jupyter_output><empty_output><jupyter_text>**FIG.4.** It shows the partitioning of a sphere at progressively higher resolutions, from left to right. The green sphere represents the lowest resolution possible with the HEALPix base partitioning of the sphere surface into 12 equal sized pixels. The yellow sphere has a HEALPix grid of 48 pixels, the red sphere has 192 pixels, and the blue sphere has a grid of 768 pixels (more information [here](https://healpix.jpl.nasa.gov/)).   3D sky maps[Singer et al.(2016)](https://arxiv.org/pdf/1603.07333v2.pdf) discuss a rapid algorithm for obtaining a three-dimensional probability estimates of sky location and luminosity distance from observations of binary compact object mergers with Advanced LIGO and Virgo. Combining the reconstructed gravitational wave volumes with positions and redshifts of possible host  galaxies  provides  a  manageable  list  of  sky location  targets  to  search  for  the  electromagnetic counterpart of the gravitational wave signal.The marginal distance posterior distribution integrated over the whole sky is reported in the header *with*        DISTMEAN    /Posterior mean distance (Mpc)       DISTSTB     / Posterior standard deviation of distance (Mpc)   1. Working with the sky localizations  of GW150914, GW151226 and GW170104The exercise focuses on the GUI/script command to organize the Aladin stack planes and generate a defined MOC contour plot. Reference manual on Aladin script commands is [here](http://aladin.u-strasbg.fr/java/AladinScriptManual.gml).            The expected time to finish the exercise is 30 minutes    1.1 Organize the Aladin stack planes   1.1.1 Launch [Aladin Desktop v10.076 ](https://aladin.u-strasbg.fr/java/nph-aladin.pl?frame=downloading)  * java -jar -Xmx1g Aladin.jar  1.1.2 Create three stack folders: GW150914, GW151226, GW170104  * [Using Aladin GUI](https://drive.google.com/open?id=1F8mk2PHhkoboy_i0esd7fRzsvTUq-Iee)* [Using Aladin Console](https://drive.google.com/open?id=1aVL5jXcvbX2MfDICvXv6W2pFdvT7sObC)      * [Open Aladin Console](https://drive.google.com/open?id=1iK9Zqq_SlKJBYUKlj0TDZ5jc9RQdk_SB)    1.1.3. Load the refined sky localizations (LALInference) from the LIGO and Virgo Open Science Center   *  GW150914 https://losc.ligo.org/s/events/GW150914/P1500227/LALInference_skymap.fits.gz*  GW151226 https://losc.ligo.org/s/events/GW151226/P1500227/LALInference_skymap_2.fits.gz*  GW170104 https://losc.ligo.org/s/events/GW170104/P1500227/LALInference_f.fits.gz    * [Using Aladin GUI](https://drive.google.com/open?id=1Q7m-ui-506ZtQdGblC-QhygjT3RRdugQ)    * [Using Aladin Console](https://drive.google.com/open?id=1I0gKvyzebUJ3FBSccppLdhQf__UFZc-r)    * Typing the URL at the Command box (at the top of the main Aladin window)       1.1.4. Rename the sky localizations files in * GW150914_lal* GW151226_lal* GW170104_lal    * Using Aladin GUI (right-click on the plane to open the *Properties* window)    * [Using Aladin Console](https://drive.google.com/open?id=12HxyKZNmIEe1CwOeDijLg2pno8KtdJgz)   1.1.5. Move the sky localization files in the specific folders       *  Using Aladin GUI (drag the file in the folder)* [Using Aladin Console](https://drive.google.com/open?id=135CXJolfqMypXTgsA78kKlWGTUdlzIIT)   1.2  MOC contour plot generation[The Multi-Order Coverage](http://ivoa.net/documents/MOC/20140602/REC-MOC-1.0-20140602.pdf) (MOC) method is based on the HEALPix tessellation algorithm and it is essentially a  simple  way  to  map  irregular  and  complex  sky  regions  into  hierarchically  grouped  predefined  cells. The operations  between  MOC  maps  (union,  intersection,  subtraction,  difference, complement)  are  extremely simple and fast  (generally a few milliseconds) even for very complex  sky regions. In addition to this, same data  servers, such as VizieR, can be “queried by MOC” in  order  to  return  data  (catalog  sources/list  of images) only insidethe MOC coverage. Each  line  encloses  a  given  percentage  of  the  total  probability.  These contours were constructed using a “water-filling” algorithm: the pixels from most probable to least are ranked, and finally the pixels are summed up to get a fixed level of probability [Singer et al. 2014](https://arxiv.org/abs/1404.5623). The enclosed area within a given probability level of a GW sky map can be effectively described through the Multi-Order  Coverage  (MOC)  method.The HEALPix pixels(ipix) inside  a  given  contour  plot are  extracted and the ipixtable is used to generate the MOC coverage; for more details see [Handling gravitational-wave sky maps with Multi-Order Coverage](http://nbviewer.jupyter.org/gist/ggreco77/d43e5a1141b99f918672e70adc05864d).   1.2.1. Create the 50% and the 90% credible levels (enclosed probability)for each skymap in 1.1.3. Move the MOC files in the specific folders. Set asDrawing method: perimeter * [Using Aladin GUI](https://drive.google.com/open?id=12iITUITYvLhVUyxStLnEdtKltmQBP4CT)* [Using Aladin Console](https://drive.google.com/open?id=1UE-cfGNlfd1pm7yKCESH-mN8KQXG6Zym)     1.2.2. Check the values of Area (50%) and the Area (90%) obtained in 1.2.1 with the values reported here * [GW170814 Interactive Skymap](http://www.virgo-gw.eu/skymap.html)    * [The values are reported in a pop-up window](http://www.virgo-gw.eu/images/skymap/show2.jpg)           1.2.3. Save the current view in a .jpg image in AITOFF projection using as hips-background DSS colored     From File --> Save the current view --> JPEG  2. GW170814: A Three-Detector Observation of Gravitational Waves from a Binary Black Hole Coalescence[GW170814](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.119.141101) is the fourth published detection of gravitational waves. As was the case with the first three published detections, the waves were generated by the coalescence of a pair of stellar-mass black holes. When we compare its position reconstruction in the Universe with the previous events, the sky localization of GW170814 is the narrowest. This new and exciting result was reached through a triple-coincident detection, coordinated by a body of more than 1,000 international scientists forming the LIGO and Virgo Collaboration (LVC).         The expected time to finish the exercise is 25 minutes<jupyter_code>display(Image(url='http://www.virgo-gw.eu/docs/GW170814/three_skymaps.png'))<jupyter_output><empty_output><jupyter_text>**Fig.5.** See also the **[Astronomy Picture of the Day](https://apod.nasa.gov/apod/ap170928.html)** - 2017 September 28 -  The event was recorded on 2017 August 14, and so christened GW170814, by the LIGO observatory sites in Hanford, Washington and Livingston, Louisiana, and the more recently operational Virgo Observatory near Pisa, Italy. The signal was emitted in the final moments of the coalescence of two black holes of 31 and 25 solar masses located about 1.8 billion light-years away. But comparing the timing of the gravitational wave detections at all three sites allowed astronomers to vastly improve the location of the signal's origin on the sky. Just above the Magellanic clouds and generally toward the constellation Eridanus, the only sky region consistent with signals in all three detectors is indicated by the yellow contour line in this all-sky map. The all-sky projection includes the arc of our Milky Way Galaxy. An improved three-detector location of the gravitational wave source allowed rapid follow-up observations by other, more conventional, electromagnetic wave observatories that can search for potentially related signals. The addition of the Virgo detector also allowed the gravitational wave polarization to be measured, a property that further confirms predictions of Einstein's general relativity.   2.1. Create the stack folder GW170814  2.2. Load three sky localizations from the LIGO and Virgo Open Science Center. For educational purposes Nside = 512 for all sky maps and they are stored in an external site. * GW170814: [rapid LIGO localization](https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/bayestar_no_virgo_512.fits?raw=true) right-click Copy Link Location* GW170814: [rapid LIGO and Virgo localization](https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/bayestar_with_virgo_512.fits?raw=true) right-click Copy Link Location* GW170814: [refined LIGO and Virgo localization](https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/LALInference_v1_512.fits?raw=true) right-click Copy Link Location     2.3. Rename the skymaps and move them in the folder created in 2.1.  2.4. Build the 10%, 50% and 90% credible levels (enclosed probability) for the rapid sky localizations with Virgo and without Virgo. Set asDrawing method: perimeter and stored the files in a folder (moc_gw170814_lalinference). Execute the tasks written a macro.<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/macro_cl.gif?raw=true'))<jupyter_output><empty_output><jupyter_text>2.5. How many times the location of GW170814 has been improved thanks to the presence of Virgo? * [Answer to the online poll](http://freeonlinesurveys.com/p/GdVKMlz0?qid=1002143) 2.6. Build the 90% credible levels of the refined LIGO and Virgo localization.  2.7. Calculate the intersection area between the rapid LIGO/Virgo sky localization and the refined one * [Using Aladin GUI](https://github.com/ggreco7/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/cmoc_inter_GUI.png?raw=true)        * [*MOC operation button*](https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/MOCoperationButton.png?raw=true)* [Using Aladin Console](https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/cmoc_int_script.png?raw=true)  2.8. How much the  intersection area is worth? * [Answer to the online poll](http://freeonlinesurveys.com/p/D2wEn83c?qid=1002147) 2.9. Calculate the intersection area between the final LIGO/Virgo sky localization (90% c.l.) and (i) the PanSTARRS DR1 and (ii) GALEX GR6 AIScolor compositions. To obtain the coverage of  PanSTARRS and GALEX GR6 AIS you can use the [data collection tree](https://www.youtube.com/watch?v=IG_6Eh9EKKk) by checking the coverage box when the info window appears after clicking on the selected collection.<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/int.gif?raw=true'))<jupyter_output><empty_output><jupyter_text>Focus on Aladin Macro Controller for repetitive tasksTo   facilitate   repetitive   tasks   Aladin provides a macro controller which is based on Aladin script commands.   It allows for the script commands to include input variables that allow for the execution of a set of commands for a list of object names. The macro controller window  is divided into 3 parts:1) The   top  panel   allows   the   input  of   ascript. The variables can be specified as  `$1`  `$2` etc.2) The middle panel allows the input oflists   of   values   to   be   taken   by   thevariables.3) The lower panel controls the executionof the script.The script  and  the input  values for the variables may be saved  for future use by using the File menu of the macro controller window      File-> Save Script When   writing   a   script,   Aladin automatically   recognizes   the   syntax   and colours the various elements of the script to ease the editing. The commands are also *clickable* to provide immediate help.  2.1 GW170814 in Virtual Reality Just for fun! Identify the xxxxxx and if they are within the localization region!<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/gw170817_vr.png?raw=true'))<jupyter_output><empty_output><jupyter_text>3.  Load instrument FoVYou can describe your FoV in a simple XML/VOTable document and you can load this file in Aladin to draw it.       From File --> load Instrument FoV --> server selector --> Create your ownYou are directed to the page [Instrument Footprint Editor](http://aladin.u-strasbg.fr/footprint_editor/) in which we can draw your suitable FoV. Save the file  from  the  page  and  load  in  Aladin  using  the Load  it... button  in  the Server  selector window.  Once  all previous  operations  have  been  carried  out,  specify  a  position  in  the  Target  (ICRS,  name)  and  press  the  SUBMIT  button. The FoVs will be drawn as new Aladin plans. 3.1. VST tiling of GW170814You are at [ESO-Paranal Observatory](http://www.eso.org/sci/facilities/paranal.html?sess=85f05d678758d4fba2a22c8ba1b2bd07) in Chile and your team are planning to observe the LIGO and Virgo trigger G297595 (confirmed as GW170814), with the VLT Survey Telescope (VST) equipped  with  OMEGACAM.  The  observations are  divided  in 9 regions - 3° x  3° -  centered  on the following coordinates RA, Dec (ICRSd):| Pointings |  RA[deg] | DEC[deg]  | |-----------|----------|-----------||   p1   | 041.06842 | -45.48795 |         |   p2   | 036.78869 | -45.48795 |          |   p3   | 045.34815 | -45.48795 |          |   p4   | 042.42450 | -42.48795 |          |   p5   | 042.42450 | -39.48795 ||   p6   | 039.71234 | -48.48795 ||   p7   | 044.97423 | -36.48795 ||   p8   | 046.17326 | -33.80461 | |   p9   | 046.17326 | -51.48795 | |   p10  | 047.59596 | -42.43116 ||   p11  | 048.41606 | -39.37287 |**Table 1** VST observation of GW170814<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/vst_gw170814_2.png?raw=true'))<jupyter_output><empty_output><jupyter_text>**Fig.6.** The pointing sequence is taken from [GCN 21498](https://gcn.gsfc.nasa.gov/other/G297595.gcn3) and [GRAWITA](https://www.grawita.inaf.it/) paper in preparation.Your team ask you to prepare a sky chart showing the coverage of the skymap performed by those tiles. The chart should show:  3.1. The FoV footprints of VST reported in the table above * [Instrument footprint editor](4.-Load-instrument-FoV)* [short video tutorial](https://drive.google.com/open?id=12XnxCYO9XNmBe-zmLyHL67K2KsqzB459)     3.2. the MOC contour of 10% - 50% - 90% confidence levels setting as Drawing method: perimeter    *...the time is going...*  3.3 Create a Macro Controller for the repetitive task in 3.1 and save the macros and the input values for future applications.      Script:           load /your/path/footprint.vot           get FoV(MyFootprint)  $1  $2           sync    Parameters:         Copy in a file the values of Table 1 and load it from the File Menu of the Macros<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/macros_fov.gif?raw=true'))<jupyter_output><empty_output><jupyter_text>3.4 Launch the macros from the script console using the macros command [here](https://aladin.u-strasbg.fr/java/AladinScriptManual.gml)            The expected time to finish the exercise is 20 minutes  4. VST Observation of GW150914[GRAWITA: VLT Survey Telescope observations of the gravitational wave sources GW150914 and GW151226](https://arxiv.org/pdf/1710.05915.pdf)| Pointings |  RA[deg] | DEC[deg]  | |-----------|----------|-----------||   p1   | 58.208846  | -56.949515 |   |   p2   | 60.652964  | -59.855304 | |   p3   | 68.948300  | -64.802918 ||   p4   | 74.729746  | -66.793713 ||   p5   | 82.166543  | -67.952724 ||   p6   | 91.163807  | -71.180392 ||   p7   | 100.348601 | -71.180473 ||   p8   | 118.562044 | -71.090518 ||   p9   | 122.909379 | -67.971038 ||   p10  |131.090822  | -67.972011 |**Table 1** VST observation of GW150914, see https://www.grawita.inaf.it/highlights/   4.1 Measure the intersection area of the VST survey reported [here](https://www.grawita.inaf.it/VSTbrowse/VST20151013/) and the 90% c.l. of the cWB and LALInference skymaps of GW150914.    4.2 FIltering the sources in Table 4 that fall in the intersection between the VST survey and 90% of the LALInference skymap.    5. GW 170817: sky localizations of the *golden binary*Fig.7 shows the localization of the gravitational-wave, gamma-ray, and optical signals. The left panel shows a projection of the 90% credible regions from LIGO (light green), LIGO-Virgo (dark green), triangulation from the time delay between Fermi and INTEGRAL (light blue), and Fermi GBM (dark blue). The inset shows the location of the apparent host galaxy NGC 4993 in the Swope optical discovery image at 10.9 hours after the merger (top right) and the DLT40 pre-discovery image from 20.5 days prior to merger (bottom right).              The expected time to finish the exercise is 25 minutes<jupyter_code>display(Image(url='http://ligo.org/science/Publication-GW170817MMA/images/Fig1.png',width=500, height=500))<jupyter_output><empty_output><jupyter_text>**Fig.7**.  Localization of the gravitational-wave, gamma-ray, and optical signals.  5.1. Create the stack folder *GW170817*  5.2. Load the refined sky localization from the  LIGO and Virgo Open Science Center  * https://dcc.ligo.org/public/0146/G1701985/001/LALInference_v2.fits.gz 5.3. Create the 5%, 10%, 50% and 90% MOC contour plots setting as Drawing method: perimeter  5.4. draw the location of the optical transient SSS17a/2017gfo reported in  GCN 21529 * Using Aladin Console ([draw - graphical overlay commands](http://aladin.u-strasbg.fr/java/AladinScriptManual.gmldraw))  5.5. In which confidence level the position of SSS17a/2017gfo fall? * [Answer to the online poll](http://freeonlinesurveys.com/p/KptvducH?qid=1002155)   5.6. Show the GLADE galaxies in 90% of probability threshold using the distance information in the header * [Query Catalogs from MOC contour plots](https://drive.google.com/open?id=1ju-2IZP27LY7yat67lmqBV2xr7SBjJ76) * Send Aladin planes to TOPCAT via SAMP (right-click on the selected plane --> broadcast selected tables to --> TOPCAT)* [Create a new subset from the GLADE catalog using TOPCAT and resend to Aladin](https://drive.google.com/open?id=19-I6TybrLH6a21mipE0TvdMD-gybg7Fo) 5.7. Search for information on NGC 4993 following the Section 3 of the tutorial[An introduction to the CDS services and tools](https://www.asterics2020.eu/dokuwiki/lib/exe/fetch.php?media=open:wp4:school3:cdstutorial_4asterics.pdf)  5.8. apply a filter label the galaxies in order of their Absolute B Magnitude       {draw rainbow(${BMAG}) square}<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/filter.png?raw=true'))<jupyter_output><empty_output><jupyter_text>5.9. Make thumbnails of the selected brightest sources: Tools → Thumbnail view generator  5.10. Save the Thumbnail using a macro and load the parameter using: File → Use selected plane  sources as params.      Script:           reset           grid on                      "GAL_GW170817-$2_DSS" = get DSS.STScI(POSS2UKSTU_Red,10,10) $3           sync           pause 1           save /home/gius/Desktop/GAL_GW170817-$2_chart.fits     Parameters:         Use selected plane sources as params        6.1 GW170817 in Virtual Reality Just for fun! Identify the Magellanic Clouds and if they are within the localization region!<jupyter_code>display(Image(url='https://github.com/ggreco77/Electromagnetic-follow-up-of-gravitational-wave-events/blob/master/gwsky17.png?raw=true'))<jupyter_output><empty_output><jupyter_text>7. GWsky: an interactive script to tile the sky localization of gravitational-wave signals. GWsky is an easy-to-use, interactive Python script to effectively tile the sky localization of a gravitational-wave event providing accurate telescope pointings. The Field-of-View footprints for each electromagnetic or neutrino observatory are displayed in real time in the Aladin Sky Atlas software using a dedicated interoperability application. Each Field of View is accompanied by descriptive statistics to manage the sequence of pointings. The ability to manage interactively and quickly a set of strategies – when a GW sky localization is issued – may be especially useful for a large class of space/ground-based telescopes to formulate requests of target-of-opportunity observations.Full documentation, source code, and installation instructions are available [here](https://docs.google.com/presentation/d/1xBCXg4apU6FMxnbzlbYdynrXuQENYqb00wk2p2UShGs/edit?usp=sharing)<jupyter_code>from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0797827903091061, 'fraction_numerical': 0.05038236617183985, 'mean_word_length': 4.62091385226657, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 0, '>': 72, 'https://': 59, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '436179', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 10317, 'n_tokens_neox': 8927, 'n_words': 3452, 'path': 'Tutorial_day1.ipynb', 'repo_name': 'ggreco77/NS-Merger-Training-Workshop', 'size': '31137'}