Celestia icon indicating copy to clipboard operation
Celestia copied to clipboard

Improve spectral type parsing

Open SevenSpheres opened this issue 5 years ago • 2 comments

Celestia's spectral type parsing could be improved. Currently if a spectral type string has a character that "doesn't belong" (including spaces) Celestia ignores everything after it. For example, G2(V) is parsed as G2 instead of G2V. This has already been fixed in Luke's version of buildstardb.pl.

SevenSpheres avatar Oct 16 '19 22:10 SevenSpheres

Well, my buildstardb.pl only works because it actually deletes the special characters like the parentheses, before parsing them. I suppose we could do a similar thing in the stellarclass.cpp that the spectral class parser is originally from, but please, check my code for errors and such.

LukeCEL avatar Oct 19 '19 21:10 LukeCEL

Some changes in this area would also be necessary to support the full range of white dwarf spectral types. The "D*#" numbers don't just go to 9, they go to 14 (source), but currently a two-digit number beginning with 1 is parsed as 1. Case in point: Gliese 223.2.

SevenSpheres avatar Apr 12 '20 21:04 SevenSpheres