.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_source_separation.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_source_separation.py: =============================== Local to Equatorial Coordinates =============================== Where do my neutrinos come from? .. GENERATED FROM PYTHON SOURCE LINES 8-17 .. code-block:: default __author__ = "moritz" import numpy as np import pandas as pd from km3astro.coord import local_event, Sun, neutrino_to_source_direction .. GENERATED FROM PYTHON SOURCE LINES 18-21 Detector Coordinates -------------------- Let's define some random events. .. GENERATED FROM PYTHON SOURCE LINES 21-38 .. code-block:: default theta = np.array([10, 45, 70, 23, 20, 11, 24, 54]) * np.pi / 180 phi = np.array([4, 23, 200, 320, 10, 45, 29, 140]) * np.pi / 180 time = pd.to_datetime( [ "2015-01-12T15:10:12", "2015-06-12T13:48:56", "2015-03-09T21:57:52", "2015-03-15T14:24:01", "2015-01-12T15:10:12", "2015-06-12T13:48:56", "2015-03-09T21:57:52", "2015-03-15T14:24:01", ] ).values .. GENERATED FROM PYTHON SOURCE LINES 39-44 Note: Phi, theta: Where the neutrino is pointing to Zenith, azimuth: where the neutrino is coming from .. GENERATED FROM PYTHON SOURCE LINES 46-49 Create event in local coordinates (aka AltAz or Horizontal Coordinates) This returns an ``astropy.SkyCoord`` instance. .. GENERATED FROM PYTHON SOURCE LINES 49-57 .. code-block:: default evt_local = local_event(theta, phi, time, location="orca") sun = Sun(time) sep = evt_local.separation(sun) print(sep) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none [91d55m41.63665769s 101d11m43.36401381s 87d52m39.96833153s 115d30m09.9465609s 82d41m44.34697762s 135d50m15.92986853s 46d42m34.01756926s 116d48m28.00919023s] .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 4.720 seconds) .. _sphx_glr_download_auto_examples_plot_source_separation.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_source_separation.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_source_separation.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_