Skip to content

Commit

Permalink
Merge pull request #124 from observerly/feature/dusk/GetObjectTransit
Browse files Browse the repository at this point in the history
feat: Added GetObjectTransit() to dusk module.
  • Loading branch information
michealroberts authored Jun 17, 2022
2 parents 0e2f2f8 + acd0ad4 commit 1250a4c
Show file tree
Hide file tree
Showing 3 changed files with 226 additions and 99 deletions.
206 changes: 107 additions & 99 deletions coverage.txt
Original file line number Diff line number Diff line change
@@ -1,89 +1,4 @@
mode: atomic
github.com/observerly/dusk/pkg/dusk/transit.go:22.77,30.2 3 22
github.com/observerly/dusk/pkg/dusk/transit.go:41.135,42.43 1 8
github.com/observerly/dusk/pkg/dusk/transit.go:51.2,74.3 9 8
github.com/observerly/dusk/pkg/dusk/transit.go:42.43,48.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:86.129,87.43 1 5
github.com/observerly/dusk/pkg/dusk/transit.go:95.2,98.62 2 4
github.com/observerly/dusk/pkg/dusk/transit.go:103.2,107.3 1 4
github.com/observerly/dusk/pkg/dusk/transit.go:87.43,93.3 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:98.62,101.3 2 4
github.com/observerly/dusk/pkg/dusk/transit.go:119.134,120.43 1 5
github.com/observerly/dusk/pkg/dusk/transit.go:128.2,133.16 3 3
github.com/observerly/dusk/pkg/dusk/transit.go:137.2,147.8 4 3
github.com/observerly/dusk/pkg/dusk/transit.go:120.43,125.3 1 2
github.com/observerly/dusk/pkg/dusk/transit.go:133.16,135.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:150.135,153.16 2 2
github.com/observerly/dusk/pkg/dusk/transit.go:157.2,157.47 1 2
github.com/observerly/dusk/pkg/dusk/transit.go:162.2,171.39 5 1
github.com/observerly/dusk/pkg/dusk/transit.go:190.2,190.20 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:153.16,155.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:157.47,159.3 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:171.39,184.91 4 424
github.com/observerly/dusk/pkg/dusk/transit.go:184.91,186.9 2 1
github.com/observerly/dusk/pkg/dusk/trigonometry.go:10.30,12.2 1 275825
github.com/observerly/dusk/pkg/dusk/trigonometry.go:14.30,16.2 1 197023
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 13071
github.com/observerly/dusk/pkg/dusk/trigonometry.go:26.31,28.2 1 39408
github.com/observerly/dusk/pkg/dusk/trigonometry.go:30.31,32.2 1 13454
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/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/coordinates.go:101.108,124.2 10 12982
github.com/observerly/dusk/pkg/dusk/coordinates.go:136.149,151.2 6 13407
github.com/observerly/dusk/pkg/dusk/epoch.go:31.56,33.2 1 18
github.com/observerly/dusk/pkg/dusk/epoch.go:41.48,46.2 2 117862
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 13412
github.com/observerly/dusk/pkg/dusk/epoch.go:97.2,97.12 1 13412
github.com/observerly/dusk/pkg/dusk/epoch.go:93.13,95.3 1 4588
github.com/observerly/dusk/pkg/dusk/epoch.go:106.74,114.11 4 13410
github.com/observerly/dusk/pkg/dusk/epoch.go:118.2,118.17 1 13410
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 17
github.com/observerly/dusk/pkg/dusk/epoch.go:284.2,284.12 1 17
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 17
github.com/observerly/dusk/pkg/dusk/epoch.go:317.2,317.13 1 17
github.com/observerly/dusk/pkg/dusk/epoch.go:321.2,324.11 2 17
github.com/observerly/dusk/pkg/dusk/epoch.go:328.2,328.21 1 17
github.com/observerly/dusk/pkg/dusk/epoch.go:312.12,314.3 1 17
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/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 @@ -162,6 +77,83 @@ 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 277950
github.com/observerly/dusk/pkg/dusk/trigonometry.go:14.30,16.2 1 199148
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 13089
github.com/observerly/dusk/pkg/dusk/trigonometry.go:26.31,28.2 1 39832
github.com/observerly/dusk/pkg/dusk/trigonometry.go:30.31,32.2 1 13882
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/astrometry.go:14.52,18.12 2 13833
github.com/observerly/dusk/pkg/dusk/astrometry.go:22.2,22.11 1 13833
github.com/observerly/dusk/pkg/dusk/astrometry.go:18.12,20.3 1 2643
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 22
github.com/observerly/dusk/pkg/dusk/epoch.go:41.48,46.2 2 118718
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 13836
github.com/observerly/dusk/pkg/dusk/epoch.go:97.2,97.12 1 13836
github.com/observerly/dusk/pkg/dusk/epoch.go:93.13,95.3 1 4589
github.com/observerly/dusk/pkg/dusk/epoch.go:106.74,114.11 4 13834
github.com/observerly/dusk/pkg/dusk/epoch.go:118.2,118.17 1 13834
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 21
github.com/observerly/dusk/pkg/dusk/epoch.go:284.2,284.12 1 21
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 21
github.com/observerly/dusk/pkg/dusk/epoch.go:317.2,317.13 1 21
github.com/observerly/dusk/pkg/dusk/epoch.go:321.2,324.11 2 21
github.com/observerly/dusk/pkg/dusk/epoch.go:328.2,328.21 1 21
github.com/observerly/dusk/pkg/dusk/epoch.go:312.12,314.3 1 21
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/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 21
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/coordinates.go:101.108,124.2 10 12982
github.com/observerly/dusk/pkg/dusk/coordinates.go:136.149,151.2 6 13831
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 All @@ -179,17 +171,33 @@ github.com/observerly/dusk/pkg/dusk/solar.go:189.70,200.2 4 4
github.com/observerly/dusk/pkg/dusk/solar.go:208.74,222.12 6 2
github.com/observerly/dusk/pkg/dusk/solar.go:226.2,229.3 1 2
github.com/observerly/dusk/pkg/dusk/solar.go:222.12,224.3 1 2
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 17
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 13409
github.com/observerly/dusk/pkg/dusk/astrometry.go:22.2,22.11 1 13409
github.com/observerly/dusk/pkg/dusk/astrometry.go:18.12,20.3 1 2219
github.com/observerly/dusk/pkg/dusk/astrometry.go:34.73,42.2 4 4
github.com/observerly/dusk/pkg/dusk/transit.go:23.77,31.2 3 27
github.com/observerly/dusk/pkg/dusk/transit.go:42.135,43.43 1 10
github.com/observerly/dusk/pkg/dusk/transit.go:52.2,75.3 9 10
github.com/observerly/dusk/pkg/dusk/transit.go:43.43,49.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:87.129,88.43 1 6
github.com/observerly/dusk/pkg/dusk/transit.go:96.2,99.62 2 5
github.com/observerly/dusk/pkg/dusk/transit.go:104.2,108.3 1 5
github.com/observerly/dusk/pkg/dusk/transit.go:88.43,94.3 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:99.62,102.3 2 5
github.com/observerly/dusk/pkg/dusk/transit.go:120.134,121.43 1 7
github.com/observerly/dusk/pkg/dusk/transit.go:130.2,135.16 3 4
github.com/observerly/dusk/pkg/dusk/transit.go:139.2,149.8 4 4
github.com/observerly/dusk/pkg/dusk/transit.go:121.43,127.3 1 3
github.com/observerly/dusk/pkg/dusk/transit.go:135.16,137.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:161.135,164.16 2 2
github.com/observerly/dusk/pkg/dusk/transit.go:168.2,168.47 1 2
github.com/observerly/dusk/pkg/dusk/transit.go:173.2,182.39 5 1
github.com/observerly/dusk/pkg/dusk/transit.go:201.2,201.20 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:164.16,166.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:168.47,170.3 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:182.39,195.91 4 424
github.com/observerly/dusk/pkg/dusk/transit.go:195.91,197.9 2 1
github.com/observerly/dusk/pkg/dusk/transit.go:213.123,216.16 2 2
github.com/observerly/dusk/pkg/dusk/transit.go:220.2,220.47 1 2
github.com/observerly/dusk/pkg/dusk/transit.go:230.2,237.39 4 1
github.com/observerly/dusk/pkg/dusk/transit.go:256.2,261.8 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:216.16,218.3 1 0
github.com/observerly/dusk/pkg/dusk/transit.go:220.47,227.3 1 1
github.com/observerly/dusk/pkg/dusk/transit.go:237.39,250.91 4 424
github.com/observerly/dusk/pkg/dusk/transit.go:250.91,252.9 2 1
61 changes: 61 additions & 0 deletions pkg/dusk/transit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

type Transit struct {
Rise *time.Time
Maximum *time.Time
Set *time.Time
Duration time.Duration
}
Expand Down Expand Up @@ -199,3 +200,63 @@ func GetObjectTransitMaximaTime(datetime time.Time, eq EquatorialCoordinate, lat

return maxima, nil
}

/*
GetObjectTransit()
@param datetime - the time to calculate the rise and set times for
@param eq - the EquatorialCoordinate{} of the object to calculate the rise and set times for
@param latitude - the latitude of the observer
@param longitude - the longitude of the observer
@returns a Transit struct which contains the rise, maximum and set times of the object in local time
*/
func GetObjectTransit(datetime time.Time, eq EquatorialCoordinate, latitude float64, longitude float64) (*Transit, error) {
transit, err := GetObjectRiseObjectSetTimes(datetime, eq, latitude, longitude)

if err != nil {
return nil, err
}

if transit.Rise == nil || transit.Set == nil {
return &Transit{
Rise: nil,
Set: nil,
Maximum: nil,
Duration: 0,
}, nil
}

// find the number of minutes between the rise and set times:
minutes := int(math.Ceil(math.Abs(transit.Duration.Minutes())))

// create an empty list of horizontalCoordinate structs:
horizontalCoordinates := make([]TransitHorizontalCoordinate, minutes)

d := *transit.Rise

for i := range horizontalCoordinates {
// Get the current horizontal position of the object:
var hz HorizontalCoordinate = ConvertEquatorialCoordinateToHorizontal(d, longitude, latitude, eq)

horizontalCoordinates[i] = TransitHorizontalCoordinate{
Datetime: d,
Altitude: hz.Altitude,
Azimuth: hz.Azimuth,
}

d = d.Add(time.Minute)

// Since our object's initial direction is rising, we can assume the following comparison:
if (i > 0) && (horizontalCoordinates[i].Altitude < horizontalCoordinates[i-1].Altitude) {
transit.Maximum = &horizontalCoordinates[i-1].Datetime
break
}
}

return &Transit{
Rise: transit.Rise,
Set: transit.Set,
Maximum: transit.Maximum,
Duration: transit.Duration,
}, nil
}
58 changes: 58 additions & 0 deletions pkg/dusk/transit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,61 @@ func TestGetObjectTransitMaximaTimeNoRiseNoSet(t *testing.T) {
}

}

func TestGetObjectTransit(t *testing.T) {
timezone, _ := time.LoadLocation("America/New_York")

var datetime time.Time = time.Date(2015, 6, 6, 0, 0, 0, 0, time.UTC)

got, err := GetObjectTransit(datetime, EquatorialCoordinate{RightAscension: 243.675000, Declination: 25.9613889}, 38.250132, -78.300288)

if err != nil {
t.Errorf("got %v, wanted nil", err)
}

var rise = time.Date(2015, 6, 6, 16, 57, 48, 562000000, timezone)

var set = time.Date(2015, 6, 7, 7, 55, 55, 501000000, timezone)

if rise.After(set) {
t.Errorf("the object must rise before it sets")
}

if got.Rise.String() != rise.String() {
t.Errorf("got %v, wanted %v", *got.Rise, rise)
}

if got.Set.String() != set.String() {
t.Errorf("got %v, wanted %v", *got.Set, set)
}

if got.Maximum == nil {
t.Errorf("got %v, wanted a maxima time", got)
}

if got.Maximum.Before(*got.Rise) || got.Maximum.After(*got.Set) {
t.Errorf("maxima time must be between rise and set")
}
}

func TestGetObjectTransitNoRiseNoSetNoMaximum(t *testing.T) {
var datetime time.Time = time.Date(2015, 6, 6, 0, 0, 0, 0, time.UTC)

got, err := GetObjectTransit(datetime, EquatorialCoordinate{RightAscension: 90, Declination: -60}, 45.250132, -100.300288)

if err != nil {
t.Errorf("got %v, wanted nil", err)
}

if got.Rise != nil {
t.Errorf("got %v, but expected the object to never rise for the given paramaters", got)
}

if got.Set != nil {
t.Errorf("got %v, but expected the object to never set for the given parameters", got)
}

if got.Maximum != nil {
t.Errorf("got %v, but expected the object to never reach a maxima above the horizon for the given paramaters", got)
}
}

0 comments on commit 1250a4c

Please sign in to comment.