The limitation is not in just the STC reader.
The binary DB is also in float {32-bit}, as are all other handlers except the actual position information.
The position is held as an eigen 128-bit int, int128_t if you want a nice way of saying it.
Fixing this would require a rewrite and redesign of several steps.
The fix however, would break backwards compatibility with longtime DB.
It still needs to happens however.
I had a fork where I had rebuilt the DB with double instead of float{single} for positions, along with preserving RaDec.
It didn't add much time to loading, nor did keeping the Radec I added to the DB.
This was before I found other ways to generate to display realtime RaDec of selection focus items.
It was also nice since I could search via celx for stars via RaDecDist functions I added.
Sadly however, HDD failures do happen, and it was way back when the original forum was active.
I remember I had to modify the CPP DB builder because I could not figure out how to force perl to use double.
It shouldn't be very hard to switch to using doubles since eigen returns vector3d, which is three doubles in a record.
Code: Select all
Eigen::Vector3d pos =
astro::equatorialToCelestialCart((double) RA * 24.0 / 360.0,
(double) dec,
(double) distance);
x = (float) pos.x();
y = (float) pos.y();
z = (float) pos.z();
Or if there is a way to force perl to use doubles, this can be changed in buildstardb.pl as needed..
Code: Select all
foreach my $HIP (sort { $a <=> $b } keys %stars)
{
my $dist = PlxToDistance($stars{$HIP}{'Plx'});
my $theta = $stars{$HIP}{'RArad'} + pi;
my $phi = $stars{$HIP}{'DErad'} - pi / 2;
my @xyz = (
$dist * cos($theta) * sin($phi),
$dist * cos($phi),
-$dist * sin($theta) * sin($phi)
);
my $xc = $eqToCel[0][0] * $xyz[0] + $eqToCel[1][0] * $xyz[1] + $eqToCel[2][0] * $xyz[2];
my $yc = $eqToCel[0][1] * $xyz[0] + $eqToCel[1][1] * $xyz[1] + $eqToCel[2][1] * $xyz[2];
my $zc = $eqToCel[0][2] * $xyz[0] + $eqToCel[1][2] * $xyz[1] + $eqToCel[2][2] * $xyz[2];
my $absMag = AppMagToAbsMag($stars{$HIP}{'Vmag'}, $stars{$HIP}{'Plx'});
my $spType = ParseSpType($stars{$HIP}{'SpType'});
print DATFILE pack('LfffsS', $HIP, $xc, $yc, $zc, $absMag * 256, $spType);
print TXTFILE sprintf("%u %.9f %+.9f %.6f %.2f %s\n", $HIP,
rad2deg($stars{$HIP}{'RArad'}), rad2deg($stars{$HIP}{'DErad'}),
$dist, $stars{$HIP}{'Vmag'}, $stars{$HIP}{'SpType'});
}
Though I am not a real C/C++ programmer, so there may be some gotchas I don't know about.
Janus.