km3astro.coord

Coordinate transformations.

Galactic:

GC at (0, 0), gal. longitude, latitude (l, b)

Horizontal / altaz (km3):

centered at detector position altitude, azimuth (altitude = 90deg - zenith)

EquatorialJ200 / FK5 / ICRS / GCRS

(right ascension, declination)

Equatorial is the same as FK5. FK5 is superseded by the ICRS, so use this instead. Note that FK5/ICRS are _barycentric_ implementations, so if you are looking for geocentric equatorial (i.e. for solar system bodies), use GCRS.

A note on maing conventions: phi and theta refer to neutrino directions, azimuth and zenith to source directions (i.e. the inversed neutrino direction). The former says where the neutrino points to, the latter says where it comes from.

Also radian is the default. Degree can be used, but generally the default is to assume radian.

Module Contents

Classes

Event

Functions

neutrino_to_source_direction(phi, theta[, radian])

Flip the direction.

source_to_neutrino_direction(azimuth, zenith[, radian])

Flip the direction.

Sun(time)

Wrapper around astropy's get_sun, accepting numpy/pandas time objects.

Moon(time)

Wrapper around astropy's get_moon, accepting numpy/pandas time objects.

local_frame(time, location)

Get the (horizontal) coordinate frame of your detector.

local_event(theta, phi, time, location[, radian])

Create astropy events from detector coordinates.

sun_local(time, loc)

Sun position in local coordinates.

moon_local(time, loc)

Moon position in local coordinates.

gc_in_local(time, loc)

Galactic center position in local coordinates.

is_args_fine_for_frame(frame, *args)

build_event(Cframe, *args)

Build a SkyCoord object of the corresponding frame and parameters

transform_to(Skycoord, frame_to[, detector_to])

Transform a Skycoord object to the desired frame

transform_to_new_frame(table, frame, frame_to[, ...])

Transform a pandas DataFrame of sky coordinate parameters to a new pandas.DataFrame of SkyCoord of the initial and desired frame

km3astro.coord.neutrino_to_source_direction(phi, theta, radian=True)[source]

Flip the direction.

Parameters:
phi, theta: neutrino direction
radian: bool [default=True]

receive + return angles in radian? (if false, use degree)

km3astro.coord.source_to_neutrino_direction(azimuth, zenith, radian=True)[source]

Flip the direction.

Parameters:
zenithfloat

neutrino origin

azimuth: float

neutrino origin

radian: bool [default=True]

receive + return angles in radian? (if false, use degree)

km3astro.coord.Sun(time)[source]

Wrapper around astropy’s get_sun, accepting numpy/pandas time objects.

km3astro.coord.Moon(time)[source]

Wrapper around astropy’s get_moon, accepting numpy/pandas time objects.

km3astro.coord.local_frame(time, location)[source]

Get the (horizontal) coordinate frame of your detector.

km3astro.coord.local_event(theta, phi, time, location, radian=True, **kwargs)[source]

Create astropy events from detector coordinates.

km3astro.coord.sun_local(time, loc)[source]

Sun position in local coordinates.

km3astro.coord.moon_local(time, loc)[source]

Moon position in local coordinates.

km3astro.coord.gc_in_local(time, loc)[source]

Galactic center position in local coordinates.

class km3astro.coord.Event(zenith, azimuth, time, location)[source]
classmethod from_zenith(zenith, **initargs)[source]
km3astro.coord.is_args_fine_for_frame(frame, *args)[source]
km3astro.coord.build_event(Cframe, *args)[source]

Build a SkyCoord object of the corresponding frame and parameters

Parameters:
Cframestr

Frame of the Skycoord event to build, either “ParticleFrame”, “UTM”, “equatorial” or “galactic”

*argslist of the sky coordinate parameters
Returns:
SkyCoordastropy.SkyCoord

Sky coordinate object

km3astro.coord.transform_to(Skycoord, frame_to, detector_to='antares')[source]

Transform a Skycoord object to the desired frame

Parameters:
SkyCoordastropy.SkyCoord

The sky coordinate

frame_tostr

The desired frame of transformation, either “ParticleFrame”, “UTM”, “altaz”, “equatorial or “galactic”

detector_tostr [default = “antares”]

The detector of the transformed frame, either “orca”, “arca” or “antares”

km3astro.coord.transform_to_new_frame(table, frame, frame_to, detector='antares', detector_to='antares')[source]

Transform a pandas DataFrame of sky coordinate parameters to a new pandas.DataFrame of SkyCoord of the initial and desired frame

Parameters:
tablepandas.DataFrame(astropy.SkyCoord)

The sky coordinate

framestr

The frame of the table of parameters, either “ParticleFrame”, “UTM”, “altaz”, “equatorial or “galactic”

detectorstr [default = “antares”]

The detector of the sky coordinate parameters, either “orca”, “arca” or “antares”

frame_tostr

The desired frame of transformation, either “ParticleFrame”, “UTM”, “altaz”, “equatorial or “galactic”

detector_tostr [default = “antares”]

The detector of the transformed frame, either “orca”, “arca” or “antares”