-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from observerly/feature/catalog/simbad/Perfor…
…mRadialSearch feat: add (s *SIMBADServiceClient) PerformRadialSearch to catalog module in @observerly/skysolve
- Loading branch information
Showing
3 changed files
with
196 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*****************************************************************************************************************/ | ||
|
||
// @author Michael Roberts <[email protected]> | ||
// @package @observerly/skysolve | ||
// @license Copyright © 2021-2025 observerly | ||
|
||
/*****************************************************************************************************************/ | ||
|
||
package catalog | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/observerly/skysolve/pkg/astrometry" | ||
) | ||
|
||
/*****************************************************************************************************************/ | ||
|
||
func TestSIMBADQueryExecutedSuccessfully(t *testing.T) { | ||
var q = NewSIMBADServiceClient() | ||
|
||
stars, err := q.PerformRadialSearch(astrometry.ICRSEquatorialCoordinate{ | ||
RA: 0, | ||
Dec: 0, | ||
}, 2.5, 100, 10) | ||
|
||
if err != nil { | ||
t.Errorf("Failed to execute query: %v", err) | ||
} | ||
|
||
if len(stars) == 0 { | ||
t.Errorf("No stars returned") | ||
} | ||
|
||
for _, star := range stars { | ||
// Test that the star is within the search radius: | ||
if !IsWithinICRSPolarRadius(star.RA, star.Dec, 2.5) { | ||
t.Errorf("Star is not within the search radius") | ||
} | ||
|
||
fmt.Println(star.Designation) | ||
} | ||
|
||
// The SIMBAD catalog is expected to return a maximum of 100 stars for this query: | ||
if len(stars) > 100 { | ||
t.Errorf("Too many stars returned") | ||
} | ||
} | ||
|
||
/*****************************************************************************************************************/ |