Skip to content

Commit

Permalink
Merge pull request #128 from observerly/feature/dusk/Coordinates
Browse files Browse the repository at this point in the history
feat: Added json:"" struct literals to coordinates.go.
  • Loading branch information
michealroberts authored Jun 20, 2022
2 parents 587f230 + 25807c0 commit 4922952
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 92 deletions.
150 changes: 75 additions & 75 deletions coverage.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
mode: atomic
github.com/observerly/dusk/pkg/dusk/astrometry.go:14.52,18.12 2 16490
github.com/observerly/dusk/pkg/dusk/astrometry.go:22.2,22.11 1 16490
github.com/observerly/dusk/pkg/dusk/astrometry.go:18.12,20.3 1 3388
github.com/observerly/dusk/pkg/dusk/astrometry.go:34.73,42.2 4 4
github.com/observerly/dusk/pkg/dusk/coordinates.go:101.108,124.2 10 12982
github.com/observerly/dusk/pkg/dusk/coordinates.go:136.149,151.2 6 16488
github.com/observerly/dusk/pkg/dusk/lawrence.go:15.59,24.12 3 3
github.com/observerly/dusk/pkg/dusk/lawrence.go:28.2,28.11 1 3
github.com/observerly/dusk/pkg/dusk/lawrence.go:24.12,26.3 1 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:37.62,50.11 5 12991
github.com/observerly/dusk/pkg/dusk/lawrence.go:54.2,54.10 1 12991
github.com/observerly/dusk/pkg/dusk/lawrence.go:50.11,52.3 1 12991
github.com/observerly/dusk/pkg/dusk/lawrence.go:64.78,80.11 7 12980
github.com/observerly/dusk/pkg/dusk/lawrence.go:85.2,92.3 3 12980
github.com/observerly/dusk/pkg/dusk/lawrence.go:80.11,82.3 1 4328
github.com/observerly/dusk/pkg/dusk/lawrence.go:101.82,111.12 5 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:116.2,121.3 2 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:111.12,113.3 1 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:130.62,144.2 5 25984
github.com/observerly/dusk/pkg/dusk/lawrence.go:152.58,160.2 3 12996
github.com/observerly/dusk/pkg/dusk/lawrence.go:170.70,178.14 3 12995
github.com/observerly/dusk/pkg/dusk/lawrence.go:182.2,182.11 1 12995
github.com/observerly/dusk/pkg/dusk/lawrence.go:178.14,180.3 1 0
github.com/observerly/dusk/pkg/dusk/lunar.go:32.47,37.11 2 13006
github.com/observerly/dusk/pkg/dusk/lunar.go:41.2,41.10 1 13006
github.com/observerly/dusk/pkg/dusk/lunar.go:37.11,39.3 1 16
Expand Down Expand Up @@ -83,6 +96,64 @@ github.com/observerly/dusk/pkg/dusk/lunar.go:855.30,857.4 1 4
github.com/observerly/dusk/pkg/dusk/lunar.go:874.106,877.16 2 2
github.com/observerly/dusk/pkg/dusk/lunar.go:881.2,884.8 1 2
github.com/observerly/dusk/pkg/dusk/lunar.go:877.16,879.3 1 0
github.com/observerly/dusk/pkg/dusk/trigonometry.go:10.30,12.2 1 291239
github.com/observerly/dusk/pkg/dusk/trigonometry.go:14.30,16.2 1 212437
github.com/observerly/dusk/pkg/dusk/trigonometry.go:18.44,20.2 1 541
github.com/observerly/dusk/pkg/dusk/trigonometry.go:22.30,24.2 1 13105
github.com/observerly/dusk/pkg/dusk/trigonometry.go:26.31,28.2 1 42489
github.com/observerly/dusk/pkg/dusk/trigonometry.go:30.31,32.2 1 16543
github.com/observerly/dusk/pkg/dusk/trigonometry.go:34.31,36.2 1 1
github.com/observerly/dusk/pkg/dusk/trigonometry.go:38.36,40.2 1 25976
github.com/observerly/dusk/pkg/dusk/twilight.go:38.163,49.16 5 9
github.com/observerly/dusk/pkg/dusk/twilight.go:53.2,57.18 1 9
github.com/observerly/dusk/pkg/dusk/twilight.go:49.16,51.3 1 0
github.com/observerly/dusk/pkg/dusk/twilight.go:69.139,74.2 2 3
github.com/observerly/dusk/pkg/dusk/twilight.go:85.142,90.2 2 3
github.com/observerly/dusk/pkg/dusk/twilight.go:101.146,106.2 2 3
github.com/observerly/dusk/pkg/dusk/utils.go:15.34,17.2 1 7
github.com/observerly/dusk/pkg/dusk/utils.go:26.55,31.12 2 12986
github.com/observerly/dusk/pkg/dusk/utils.go:35.2,35.11 1 12986
github.com/observerly/dusk/pkg/dusk/utils.go:31.12,33.3 1 0
github.com/observerly/dusk/pkg/dusk/utils.go:47.84,49.2 1 4
github.com/observerly/dusk/pkg/dusk/utils.go:60.84,62.2 1 12986
github.com/observerly/dusk/pkg/dusk/utils.go:72.85,74.2 1 25
github.com/observerly/dusk/pkg/dusk/utils.go:83.57,85.2 1 2
github.com/observerly/dusk/pkg/dusk/utils.go:93.51,95.2 1 3
github.com/observerly/dusk/pkg/dusk/utils.go:103.52,106.2 2 1
github.com/observerly/dusk/pkg/dusk/astrometry.go:14.52,18.12 2 16490
github.com/observerly/dusk/pkg/dusk/astrometry.go:22.2,22.11 1 16490
github.com/observerly/dusk/pkg/dusk/astrometry.go:18.12,20.3 1 3388
github.com/observerly/dusk/pkg/dusk/astrometry.go:34.73,42.2 4 4
github.com/observerly/dusk/pkg/dusk/epoch.go:31.56,33.2 1 26
github.com/observerly/dusk/pkg/dusk/epoch.go:41.48,46.2 2 124040
github.com/observerly/dusk/pkg/dusk/epoch.go:53.45,55.2 1 79
github.com/observerly/dusk/pkg/dusk/epoch.go:63.60,93.13 15 16493
github.com/observerly/dusk/pkg/dusk/epoch.go:97.2,97.12 1 16493
github.com/observerly/dusk/pkg/dusk/epoch.go:93.13,95.3 1 5505
github.com/observerly/dusk/pkg/dusk/epoch.go:106.74,114.11 4 16491
github.com/observerly/dusk/pkg/dusk/epoch.go:118.2,118.17 1 16491
github.com/observerly/dusk/pkg/dusk/epoch.go:114.11,116.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:127.65,138.2 4 36
github.com/observerly/dusk/pkg/dusk/epoch.go:146.76,154.2 3 77943
github.com/observerly/dusk/pkg/dusk/epoch.go:162.73,170.2 3 13017
github.com/observerly/dusk/pkg/dusk/epoch.go:179.62,190.2 3 6
github.com/observerly/dusk/pkg/dusk/epoch.go:198.73,213.12 6 4
github.com/observerly/dusk/pkg/dusk/epoch.go:217.2,217.11 1 4
github.com/observerly/dusk/pkg/dusk/epoch.go:213.12,215.3 1 4
github.com/observerly/dusk/pkg/dusk/epoch.go:226.77,248.12 10 3
github.com/observerly/dusk/pkg/dusk/epoch.go:252.2,252.11 1 3
github.com/observerly/dusk/pkg/dusk/epoch.go:248.12,250.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:262.70,267.2 2 34
github.com/observerly/dusk/pkg/dusk/epoch.go:276.95,280.13 2 25
github.com/observerly/dusk/pkg/dusk/epoch.go:284.2,284.12 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:280.13,282.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:294.92,312.12 9 25
github.com/observerly/dusk/pkg/dusk/epoch.go:317.2,317.13 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:321.2,324.11 2 25
github.com/observerly/dusk/pkg/dusk/epoch.go:328.2,328.21 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:312.12,314.3 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:317.13,319.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:324.11,326.3 1 1
github.com/observerly/dusk/pkg/dusk/solar.go:23.45,26.2 1 42
github.com/observerly/dusk/pkg/dusk/solar.go:35.50,38.2 1 32
github.com/observerly/dusk/pkg/dusk/solar.go:47.62,50.2 1 31
Expand Down Expand Up @@ -138,74 +209,3 @@ github.com/observerly/dusk/pkg/dusk/transit.go:270.16,272.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:274.47,281.3 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:291.39,304.91 4 1639
github.com/observerly/dusk/pkg/dusk/transit.go:304.91,306.4 1 464
github.com/observerly/dusk/pkg/dusk/utils.go:15.34,17.2 1 7
github.com/observerly/dusk/pkg/dusk/utils.go:26.55,31.12 2 12986
github.com/observerly/dusk/pkg/dusk/utils.go:35.2,35.11 1 12986
github.com/observerly/dusk/pkg/dusk/utils.go:31.12,33.3 1 0
github.com/observerly/dusk/pkg/dusk/utils.go:47.84,49.2 1 4
github.com/observerly/dusk/pkg/dusk/utils.go:60.84,62.2 1 12986
github.com/observerly/dusk/pkg/dusk/utils.go:72.85,74.2 1 25
github.com/observerly/dusk/pkg/dusk/utils.go:83.57,85.2 1 2
github.com/observerly/dusk/pkg/dusk/utils.go:93.51,95.2 1 3
github.com/observerly/dusk/pkg/dusk/utils.go:103.52,106.2 2 1
github.com/observerly/dusk/pkg/dusk/epoch.go:31.56,33.2 1 26
github.com/observerly/dusk/pkg/dusk/epoch.go:41.48,46.2 2 124040
github.com/observerly/dusk/pkg/dusk/epoch.go:53.45,55.2 1 79
github.com/observerly/dusk/pkg/dusk/epoch.go:63.60,93.13 15 16493
github.com/observerly/dusk/pkg/dusk/epoch.go:97.2,97.12 1 16493
github.com/observerly/dusk/pkg/dusk/epoch.go:93.13,95.3 1 5505
github.com/observerly/dusk/pkg/dusk/epoch.go:106.74,114.11 4 16491
github.com/observerly/dusk/pkg/dusk/epoch.go:118.2,118.17 1 16491
github.com/observerly/dusk/pkg/dusk/epoch.go:114.11,116.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:127.65,138.2 4 36
github.com/observerly/dusk/pkg/dusk/epoch.go:146.76,154.2 3 77943
github.com/observerly/dusk/pkg/dusk/epoch.go:162.73,170.2 3 13017
github.com/observerly/dusk/pkg/dusk/epoch.go:179.62,190.2 3 6
github.com/observerly/dusk/pkg/dusk/epoch.go:198.73,213.12 6 4
github.com/observerly/dusk/pkg/dusk/epoch.go:217.2,217.11 1 4
github.com/observerly/dusk/pkg/dusk/epoch.go:213.12,215.3 1 4
github.com/observerly/dusk/pkg/dusk/epoch.go:226.77,248.12 10 3
github.com/observerly/dusk/pkg/dusk/epoch.go:252.2,252.11 1 3
github.com/observerly/dusk/pkg/dusk/epoch.go:248.12,250.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:262.70,267.2 2 34
github.com/observerly/dusk/pkg/dusk/epoch.go:276.95,280.13 2 25
github.com/observerly/dusk/pkg/dusk/epoch.go:284.2,284.12 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:280.13,282.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:294.92,312.12 9 25
github.com/observerly/dusk/pkg/dusk/epoch.go:317.2,317.13 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:321.2,324.11 2 25
github.com/observerly/dusk/pkg/dusk/epoch.go:328.2,328.21 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:312.12,314.3 1 25
github.com/observerly/dusk/pkg/dusk/epoch.go:317.13,319.3 1 0
github.com/observerly/dusk/pkg/dusk/epoch.go:324.11,326.3 1 1
github.com/observerly/dusk/pkg/dusk/lawrence.go:15.59,24.12 3 3
github.com/observerly/dusk/pkg/dusk/lawrence.go:28.2,28.11 1 3
github.com/observerly/dusk/pkg/dusk/lawrence.go:24.12,26.3 1 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:37.62,50.11 5 12991
github.com/observerly/dusk/pkg/dusk/lawrence.go:54.2,54.10 1 12991
github.com/observerly/dusk/pkg/dusk/lawrence.go:50.11,52.3 1 12991
github.com/observerly/dusk/pkg/dusk/lawrence.go:64.78,80.11 7 12980
github.com/observerly/dusk/pkg/dusk/lawrence.go:85.2,92.3 3 12980
github.com/observerly/dusk/pkg/dusk/lawrence.go:80.11,82.3 1 4328
github.com/observerly/dusk/pkg/dusk/lawrence.go:101.82,111.12 5 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:116.2,121.3 2 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:111.12,113.3 1 0
github.com/observerly/dusk/pkg/dusk/lawrence.go:130.62,144.2 5 25984
github.com/observerly/dusk/pkg/dusk/lawrence.go:152.58,160.2 3 12996
github.com/observerly/dusk/pkg/dusk/lawrence.go:170.70,178.14 3 12995
github.com/observerly/dusk/pkg/dusk/lawrence.go:182.2,182.11 1 12995
github.com/observerly/dusk/pkg/dusk/lawrence.go:178.14,180.3 1 0
github.com/observerly/dusk/pkg/dusk/trigonometry.go:10.30,12.2 1 291239
github.com/observerly/dusk/pkg/dusk/trigonometry.go:14.30,16.2 1 212437
github.com/observerly/dusk/pkg/dusk/trigonometry.go:18.44,20.2 1 541
github.com/observerly/dusk/pkg/dusk/trigonometry.go:22.30,24.2 1 13105
github.com/observerly/dusk/pkg/dusk/trigonometry.go:26.31,28.2 1 42489
github.com/observerly/dusk/pkg/dusk/trigonometry.go:30.31,32.2 1 16543
github.com/observerly/dusk/pkg/dusk/trigonometry.go:34.31,36.2 1 1
github.com/observerly/dusk/pkg/dusk/trigonometry.go:38.36,40.2 1 25976
github.com/observerly/dusk/pkg/dusk/twilight.go:38.163,49.16 5 9
github.com/observerly/dusk/pkg/dusk/twilight.go:53.2,57.18 1 9
github.com/observerly/dusk/pkg/dusk/twilight.go:49.16,51.3 1 0
github.com/observerly/dusk/pkg/dusk/twilight.go:69.139,74.2 2 3
github.com/observerly/dusk/pkg/dusk/twilight.go:85.142,90.2 2 3
github.com/observerly/dusk/pkg/dusk/twilight.go:101.146,106.2 2 3
34 changes: 17 additions & 17 deletions pkg/dusk/coordinates.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,86 @@ type Coordinate struct {
/*
ϕ - the latitude in degrees, e.g., altitude, latitude, declination
*/
Latitude float64
Latitude float64 `json:"latitude"`
/*
θ - the longitude in degrees, e.g., azimuth, right ascension, longitude
*/
Longitude float64
Longitude float64 `json:"longitude"`
}

type EquatorialCoordinate struct {
/*
Right Ascension - the right ascension in degrees
*/
RightAscension float64
RightAscension float64 `json:"ra"`
/*
Declination - the declination in degrees
*/
Declination float64
Declination float64 `json:"dec"`
}

type EclipticCoordinate struct {
/*
Longitude - the longitude in degrees
*/
Longitude float64
Longitude float64 `json:"longitude"`
/*
Latitude - the latitude in degrees
*/
Latitude float64
Latitude float64 `json:"latitude"`
/*
Distance - the distance in km
*/
Δ float64
Δ float64 `json:"distance"`
}

type HorizontalCoordinate struct {
/*
altitude (a) or elevation
*/
Altitude float64
Altitude float64 `json:"altitude"`
/*
azimuth (A) or elevation
*/
Azimuth float64
Azimuth float64 `json:"azimuth"`
}

type TemporalHorizontalCoordinate struct {
/*
datetime of horizontal observation
*/
Datetime time.Time
Datetime time.Time `json:"datetime"`
/*
altitude (a) or elevation
*/
Altitude float64
Altitude float64 `json:"altitude"`
/*
azimuth (A) or elevation
*/
Azimuth float64
Azimuth float64 `json:"azimuth"`
}

type TransitHorizontalCoordinate struct {
/*
datetime of horizontal observation
*/
Datetime time.Time
Datetime time.Time `json:"datetime"`
/*
altitude (a) or elevation
*/
Altitude float64
Altitude float64 `json:"altitude"`
/*
azimuth (A) or elevation
*/
Azimuth float64
Azimuth float64 `json:"azimuth"`
/*
Is this particular a Moon rise?
*/
IsRise bool
IsRise bool `json:"isRise"`
/*
Is this particular a Moon set?
*/
IsSet bool
IsSet bool `json:"isSet"`
}

/*
Expand Down

0 comments on commit 4922952

Please sign in to comment.