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

feat: add J2000 timestamp constant to epoch module in @observerly/sidera. #10

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pkg/epoch/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,19 @@ and fractions of days from the start of their epoch.
const J1970 float64 = 2440587.5

/*****************************************************************************************************************/

/*
the epoch of J2000.0 i.e., 1 January 2000 12:00:00 UTC.

The Julian Date for J2000.0 is 2,451,545.0. This date is often used as a reference epoch in
astronomy and celestial mechanics. It is particularly useful for calculating the positions of
celestial objects and for defining the equatorial coordinate system.

This date is notably significant because J2000 is used as a reference epoch for the
International Celestial Reference System (ICRS), which is the current standard for defining
the positions of celestial objects. J2000 is also used as the reference epoch for the
equatorial coordinate system, which is based on the celestial equator and the vernal equinox.
*/
const J2000 float64 = 2451545.0

/*****************************************************************************************************************/
7 changes: 7 additions & 0 deletions pkg/epoch/epoch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ func TestGetJ1970(t *testing.T) {
}

/*****************************************************************************************************************/

func TestGetJ2000(t *testing.T) {
// Test the Julian Date calculation for the J2000.0 epoch:
assert.Equal(t, J2000, 2451545.0)
}

/*****************************************************************************************************************/