:py:mod:`km3astro.toolbox` ========================== .. py:module:: km3astro.toolbox Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: km3astro.toolbox.get_az_zenith km3astro.toolbox.get_phi_theta km3astro.toolbox.get_alt_az km3astro.toolbox.get_ra_dec km3astro.toolbox.get_l_b km3astro.toolbox.global_transform km3astro.toolbox.eq_to_utm km3astro.toolbox.eq_to_loc km3astro.toolbox.eq_to_gal km3astro.toolbox.loc_to_eq km3astro.toolbox.loc_to_utm km3astro.toolbox.loc_to_gal km3astro.toolbox.print_eq_to_utm km3astro.toolbox.print_eq_to_loc km3astro.toolbox.print_eq_to_gal km3astro.toolbox.print_loc_to_eq km3astro.toolbox.print_loc_to_utm km3astro.toolbox.print_loc_to_gal km3astro.toolbox.print_Skycoord km3astro.toolbox.reader_from_file km3astro.toolbox.get_frame_name km3astro.toolbox.get_obstime km3astro.toolbox.split_date_time km3astro.toolbox.Skycoord_breaker km3astro.toolbox.transform_file km3astro.toolbox.build_skycoord_list .. py:function:: get_az_zenith(SC, detector='antares', unit='deg') Get the azimuth and zenith for a given sky coordinate :Parameters: **SC** : astropy.SkyCoordinate The sky coordinate. **detector** : str [default: "antares"] .. **The name of the detector, either "antares", "orca" or "arca"** .. **unit** : str .. **The unit to be used on the output values, either "deg" or "rad"** .. :Returns: (azimuth, zenith): (float, float) .. Azimuth and zenith in the requested unit .. .. !! processed by numpydoc !! .. py:function:: get_phi_theta(SC, detector='antares', unit='deg') Get the phi and theta for a given sky coordinate :Parameters: **SC** : astropy.SkyCoordinate The sky coordinate. **detector** : str [default: "antares"] .. **The name of the detector, either "antares", "orca" or "arca"** .. **unit** : str .. **The unit to be used on the output values, either "deg" or "rad"** .. :Returns: (phi, theta): (float, float) .. phi and theta in the requested unit .. .. !! processed by numpydoc !! .. py:function:: get_alt_az(SC, unit='deg') Get the altitude and azimuth for a given sky coordinate :Parameters: **SC** : astropy.SkyCoordinate The sky coordinate. **unit** : str The unit to be used on the output values, either "deg" or "rad" :Returns: (altitude, azimuth): (float, float) .. altitude and azimuth in the requested unit .. .. !! processed by numpydoc !! .. py:function:: get_ra_dec(SC, unit='deg') Get the right ascension and declination for a given sky coordinate :Parameters: **SC** : astropy.SkyCoordinate The sky coordinate. **unit** : str .. **The unit to be used on the output values, either "deg" or "rad" or "hourangle"** .. :Returns: (ra, dec): (float, float) .. Ra and dec in the requested unit .. .. !! processed by numpydoc !! .. py:function:: get_l_b(SC, unit='deg') Get the galactic longitude and galactic latiture for a given sky coordinate :Parameters: **SC** : astropy.SkyCoordinate The sky coordinate. **unit** : str .. **The unit to be used on the output values, either "deg" or "rad"** .. :Returns: (l, b): (float, float) .. l and b in the requested unit .. .. !! processed by numpydoc !! .. py:function:: global_transform(frame_from, frame_to, *args) Global frame transformation function :Parameters: **frame_from** : str The frame of the input coordinate, either "ParticleFrame" or "UTM" or "equatorial" or "galactic" **frame_to** : str The desired frame of the output sky coordinate **\*args** : list of the coordinate Parameters The sky coordinate parameters. Varies with frame_from and follow "km3astro.coord.build_event" function for reference. :Returns: sky_object: astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: eq_to_utm(ra, dec, date, time, det) Equatorial to UTM frame transformation function :Parameters: **ra** : float Right ascension in degree of the sky object **dec** : float Declination in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector for the UTM coordinate system, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: eq_to_loc(ra, dec, date, time, det) Equatorial to ParticleFrame frame transformation function :Parameters: **ra** : float Right ascension in degree of the sky object **dec** : float Declination in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector for the ParticleFrame coordinate system, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: eq_to_gal(ra, dec, date, time) Equatorial to galactic frame transformation function :Parameters: **ra** : float Right ascension in degree of the sky object **dec** : float Declination in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: loc_to_eq(phi, theta, date, time, det) ParticleFrame to equatorial frame transformation function :Parameters: **phi** : float Phi in degree of the sky object **theta** : float Theta in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector of the sky object, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: loc_to_utm(phi, theta, date, time, det) ParticleFrame to UTM frame transformation function :Parameters: **phi** : float Phi in degree of the sky object **theta** : float Theta in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector of the sky object, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: loc_to_gal(phi, theta, date, time, det) ParticleFrame to galactic frame transformation function :Parameters: **phi** : float Phi in degree of the sky object **theta** : float Theta in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector of the sky object, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_eq_to_utm(ra, dec, date, time, det) Equatorial to UTM frame print function :Parameters: **ra** : float Right ascension in degree of the sky object **dec** : float Declination in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector for the UTM coordinate system, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_eq_to_loc(ra, dec, date, time, det) Equatorial to ParticleFrame frame print function :Parameters: **ra** : float Right ascension in degree of the sky object **dec** : float Declination in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector for the ParticleFrame coordinate system, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_eq_to_gal(ra, dec, date, time) Equatorial to galactic frame print function :Parameters: **ra** : float Right ascension in degree of the sky object **dec** : float Declination in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_loc_to_eq(phi, theta, date, time, det) ParticleFrame to equatorial frame print function :Parameters: **phi** : float Phi in degree of the sky object **theta** : float Theta in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector of the sky object, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_loc_to_utm(phi, theta, date, time, det) ParticleFrame to UTM frame print function :Parameters: **phi** : float Phi in degree of the sky object **theta** : float Theta in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector of the sky object, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_loc_to_gal(phi, theta, date, time, det) ParticleFrame to galactic frame print function :Parameters: **phi** : float Phi in degree of the sky object **theta** : float Theta in degree of the sky object **date** : str Date of the sky object, format "YYYY-MM-DD" **time** : str Time of the sky object, format "HH:MM:SS" **det** : str .. **The name of the detector of the sky object, either "antares", "orca" or "arca"** .. :Returns: **SC** : astropy.SkyCoordinate The sky coordinate. .. !! processed by numpydoc !! .. py:function:: print_Skycoord(SkyCoord) Print Skycoord object .. !! processed by numpydoc !! .. py:function:: reader_from_file(file) read a csv file into a pandas DataFrame .. !! processed by numpydoc !! .. py:function:: get_frame_name(SC) Get the frame name from a SkyCoord object .. !! processed by numpydoc !! .. py:function:: get_obstime(SC) Get the time of observation from a SkyCoord object .. !! processed by numpydoc !! .. py:function:: split_date_time(dt) Split in date and time a string from the observation time of a SkyCoord object :Parameters: **dt** : str the date and time string from a SkyCoord object observation time, format "YYYY-MM-DDTHH:MM:SS" :Returns: (date, time): (str, str) date and time of the sky object .. !! processed by numpydoc !! .. py:function:: Skycoord_breaker(data_SC) Break a pandas DataFrame of SkyCoord into a new DataFrame with every parameters (date, time, ra/l/phi/az, dec/b/theta/alt) :Parameters: **data_SC** : pandas.DataFrame(SkyCoord) pandas DataFrame containing Skycoord object :Returns: **data** : pandas.DataFrame A pandas DataFrame with every parameters of the input SkyCoord object .. !! processed by numpydoc !! .. py:function:: transform_file(file0, frame_from, frame_to, detector_from='orca', detector_to='orca', name='', return_data=False) Transform the input file containing coordinate into a new table of those coordinate in a new frame :Parameters: **file0** : str The path to the csv file containing the coordinate. Should follow the "km3py/test-data/astro/benchmark" format. **frame_from** : str The frame of the coordinate inside file0, either "ParticleFrame" or "UTM" or "equatorial" or "galactic" **frame_to** : str The desired frame of the output sky coordinate **detector_from** : str [default = "orca"] Detector of the file0 coordinate, either "orca", "arca" or "antares" . Mandatory if using frame_from = "ParticleFrame" or "UTM". **detector_to** : str [default = "orca"] Detector to use for the coordinate transformation, either "orca", "arca" or "antares" . Mandatory if using frame_to = "ParticleFrame" or "UTM". **name** : str [default = tempfile] path and name of the output file. :Returns: **data** : csv file Csv file containing the pandas dataframe with the transformed coordinate. .. !! processed by numpydoc !! .. py:function:: build_skycoord_list(table, frame, detector='antares') Transform the input table containing coordinate into a new table of SkyCoord coordinate :Parameters: **table** : pandas.DataFrame The table from the csv file containing the sky parameter. **frame** : str The frame of the coordinate inside the table, either "ParticleFrame" or "UTM" or "equatorial" or "galactic" **detector** : str [default = "antares"] Detector of the coordinate inside the table, either "orca", "arca" or "antares" . Mandatory if using frame_from = "ParticleFrame" or "UTM". :Returns: **list_evt** : pandas.DataFrame(astropy.SkyCoord) DataFrame containing astropy.SkyCoord object corresponding to the sky coordinate in the input table. .. !! processed by numpydoc !!