Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update coord.py #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update coord.py #1

wants to merge 1 commit into from

Conversation

Amidn
Copy link

@Amidn Amidn commented Jan 24, 2025

The Coordinate class provides a simple and efficient way to transform local detector coordinates (dir_𝑥, dir_𝑦, dir_𝑧 ) into various astronomical coordinate systems. It is designed for use with KM3NeT data or any local detector-based directional information.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant