Edit coord.py
The Coordinate class to transform local detector coordinates (dir_𝑥, dir_𝑦, dir_𝑧 ) into other astronomical coordinate systems.
Inputs:
- Local Cartesian directional cosines: dir_x, dir_y, dir_z.
- Observation time(s) in Modified Julian Date (MJD).
- Detector location (defaults to KM3NeT ARCA if not provided).
Outputs:
- AltAz (Horizontal): Azimuth (𝜙) and Zenith (θ) angles in degrees.
- ICRS (Equatorial): Right Ascension (RA) and Declination (Dec) in degrees.
- Galactic: Galactic Longitude (𝑙) and Latitude (𝑏) in degrees.
- FK5 (J2000): RA and Dec in the FK5 frame in degrees.
Implementation:
- Uses Astropy for precise astronomical coordinate transformations.
- Handles single or multiple input events (array-compatible).
# Inputs
dir_x = [0.5, 0.6, 0.7]
dir_y = [0.5, 0.4, 0.3]
dir_z = [0.707, 0.8, 0.9]
mjd = [59300.5, 59301.5, 59302.5]
# Instantiate the Coordinate class
coordinate = Coordinate(dir_x, dir_y, dir_z, mjd)
# Transformations
phi, theta = coordinate.to_altaz() # AltAz
icrs = coordinate.to_icrs() # ICRS
galactic = coordinate.to_galactic() # Galactic
fk5 = coordinate.to_fk5() # FK5
# Example Output
print("AltAz:", phi, theta)
print("ICRS:", icrs)
print("Galactic:", galactic)
print("FK5:", fk5)
This tool simplifies the analysis of directional event data from detectors, enabling direct comparison with celestial sources in other coordinate systems.