.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_toolbox.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_toolbox.py: ======================== Multiple exemple of how to use km3astro.toolbox ======================== .. GENERATED FROM PYTHON SOURCE LINES 7-78 .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Starting test of toolbox TESTING PRINT EQ TO XXX 277.07590884254364 44.998016547196954 97.07590884254364 135.00198345280305 198.69958733530385 -29.298042519442944 TESTING PRINT LOC TO XXX 70.60907662723504 -1.8544530008294475 277.07 45.0 198.6997444343682 -29.302665851512437 TESTING TRANSFORM FILE | .. code-block:: default # Author: Tedjditi Hichem import km3astro.toolbox as ktb from km3net_testdata import data_path def main(): ########################################################## # Alert Coordinates # -------------------- # Let's define one event. det = "antares" date = "2007-10-04" time = "03:03:03" phi = 97.07 theta = 135.0 az = 277.07 ze = 45.00 ra = 70.613 dec = -1.852 l = 198.7 b = -29.298 ########################################################## # Let's do some transformation with toolbox.function print("Starting test of toolbox") print() print("TESTING PRINT EQ TO XXX") ktb.print_eq_to_utm(ra, dec, date, time, det) ktb.print_eq_to_loc(ra, dec, date, time, det) ktb.print_eq_to_gal(ra, dec, date, time) print() print("TESTING PRINT LOC TO XXX") ktb.print_loc_to_eq(phi, theta, date, time, det) ktb.print_loc_to_utm(phi, theta, date, time, det) ktb.print_loc_to_gal(phi, theta, date, time, det) print() print("TESTING TRANSFORM FILE") ########################################################## # Let's transform a file with a list of alert # -------------------- ########################################################## # Let's take one list of event. file0 = data_path("astro/antares_astro_objects_benchmark.csv") ########################################################## # Let's define the frame of the alert and the frame to transform to. frame_from = "ParticleFrame" frame_to = "equatorial" ktb.transform_file( file0, frame_from, frame_to, detector_from="antares", detector_to="antares", name="test_toolbox.csv", ) if __name__ == "__main__": main() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.171 seconds) .. _sphx_glr_download_auto_examples_plot_toolbox.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_toolbox.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_toolbox.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_