starplot 0.20.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. starplot/__init__.py +59 -0
  2. starplot/callables.py +176 -0
  3. starplot/cli.py +29 -0
  4. starplot/config.py +80 -0
  5. starplot/coordinates.py +7 -0
  6. starplot/data/__init__.py +22 -0
  7. starplot/data/catalogs.py +356 -0
  8. starplot/data/constellations.py +71 -0
  9. starplot/data/db.py +33 -0
  10. starplot/data/dsos.py +85 -0
  11. starplot/data/ecliptic.py +201 -0
  12. starplot/data/library/constellation_names.parquet +0 -0
  13. starplot/data/library/dso_names.parquet +0 -0
  14. starplot/data/library/readme.md +1 -0
  15. starplot/data/library/star_designations.parquet +0 -0
  16. starplot/data/stars.py +79 -0
  17. starplot/data/translations.py +408 -0
  18. starplot/data/utils.py +35 -0
  19. starplot/geometry.py +319 -0
  20. starplot/mixins.py +360 -0
  21. starplot/models/__init__.py +21 -0
  22. starplot/models/base.py +77 -0
  23. starplot/models/comet.py +302 -0
  24. starplot/models/constellation.py +151 -0
  25. starplot/models/dso.py +317 -0
  26. starplot/models/milky_way.py +30 -0
  27. starplot/models/moon.py +130 -0
  28. starplot/models/objects.py +29 -0
  29. starplot/models/observer.py +125 -0
  30. starplot/models/optics.py +342 -0
  31. starplot/models/planet.py +137 -0
  32. starplot/models/satellite.py +138 -0
  33. starplot/models/star.py +253 -0
  34. starplot/models/sun.py +62 -0
  35. starplot/plots/__init__.py +7 -0
  36. starplot/plots/base.py +1023 -0
  37. starplot/plots/galaxy.py +372 -0
  38. starplot/plots/horizon.py +543 -0
  39. starplot/plots/map.py +515 -0
  40. starplot/plots/optic.py +469 -0
  41. starplot/plots/zenith.py +217 -0
  42. starplot/plotters/__init__.py +9 -0
  43. starplot/plotters/arrow.py +174 -0
  44. starplot/plotters/constellations.py +298 -0
  45. starplot/plotters/debug.py +21 -0
  46. starplot/plotters/dsos.py +294 -0
  47. starplot/plotters/experimental.py +722 -0
  48. starplot/plotters/gradients.py +153 -0
  49. starplot/plotters/legend.py +253 -0
  50. starplot/plotters/milkyway.py +51 -0
  51. starplot/plotters/stars.py +319 -0
  52. starplot/plotters/text.py +802 -0
  53. starplot/profile.py +16 -0
  54. starplot/projections.py +184 -0
  55. starplot/styles/__init__.py +6 -0
  56. starplot/styles/base.py +1344 -0
  57. starplot/styles/ext/antique.yml +175 -0
  58. starplot/styles/ext/blue_dark.yml +163 -0
  59. starplot/styles/ext/blue_gold.yml +147 -0
  60. starplot/styles/ext/blue_light.yml +123 -0
  61. starplot/styles/ext/blue_medium.yml +142 -0
  62. starplot/styles/ext/blue_night.yml +185 -0
  63. starplot/styles/ext/cb_wong.yml +124 -0
  64. starplot/styles/ext/color_print.yml +111 -0
  65. starplot/styles/ext/gradient_presets.yml +158 -0
  66. starplot/styles/ext/grayscale.yml +94 -0
  67. starplot/styles/ext/grayscale_dark.yml +136 -0
  68. starplot/styles/ext/map.yml +12 -0
  69. starplot/styles/ext/nord.yml +158 -0
  70. starplot/styles/ext/optic.yml +20 -0
  71. starplot/styles/ext/publication.yml +8 -0
  72. starplot/styles/extensions.py +129 -0
  73. starplot/styles/fonts-library/gfs-didot/DESCRIPTION.en_us.html +9 -0
  74. starplot/styles/fonts-library/gfs-didot/GFSDidot-Regular.ttf +0 -0
  75. starplot/styles/fonts-library/gfs-didot/METADATA.pb +16 -0
  76. starplot/styles/fonts-library/gfs-didot/OFL.txt +94 -0
  77. starplot/styles/fonts-library/inter/Inter-Bold.ttf +0 -0
  78. starplot/styles/fonts-library/inter/Inter-BoldItalic.ttf +0 -0
  79. starplot/styles/fonts-library/inter/Inter-ExtraBold.ttf +0 -0
  80. starplot/styles/fonts-library/inter/Inter-ExtraLight.ttf +0 -0
  81. starplot/styles/fonts-library/inter/Inter-ExtraLightItalic.ttf +0 -0
  82. starplot/styles/fonts-library/inter/Inter-Italic.ttf +0 -0
  83. starplot/styles/fonts-library/inter/Inter-Light.ttf +0 -0
  84. starplot/styles/fonts-library/inter/Inter-LightItalic.ttf +0 -0
  85. starplot/styles/fonts-library/inter/Inter-Regular.ttf +0 -0
  86. starplot/styles/fonts-library/inter/Inter-SemiBold.ttf +0 -0
  87. starplot/styles/fonts-library/inter/Inter-SemiBoldItalic.ttf +0 -0
  88. starplot/styles/fonts-library/inter/LICENSE.txt +92 -0
  89. starplot/styles/fonts.py +15 -0
  90. starplot/styles/helpers.py +93 -0
  91. starplot/styles/markers.py +308 -0
  92. starplot/utils.py +169 -0
  93. starplot/warnings.py +21 -0
  94. starplot-0.20.5.dist-info/METADATA +146 -0
  95. starplot-0.20.5.dist-info/RECORD +98 -0
  96. starplot-0.20.5.dist-info/WHEEL +4 -0
  97. starplot-0.20.5.dist-info/entry_points.txt +3 -0
  98. starplot-0.20.5.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,201 @@
1
+ ANGLE = 23.4
2
+
3
+ RA_DECS = [
4
+ (0.0, 0.0),
5
+ (23.8875, -0.732),
6
+ (23.775, -1.4634),
7
+ (23.6625, -2.1934),
8
+ (23.5497, -2.9216),
9
+ (23.4369, -3.6472),
10
+ (23.3242, -4.3696),
11
+ (23.2108, -5.0881),
12
+ (23.0975, -5.8021),
13
+ (22.9839, -6.511),
14
+ (22.8697, -7.2141),
15
+ (22.7553, -7.9108),
16
+ (22.6406, -8.6003),
17
+ (22.5256, -9.2821),
18
+ (22.4097, -9.9555),
19
+ (22.2939, -10.6199),
20
+ (22.1772, -11.2745),
21
+ (22.06, -11.9188),
22
+ (21.9425, -12.552),
23
+ (21.8242, -13.1735),
24
+ (21.7053, -13.7827),
25
+ (21.5858, -14.3788),
26
+ (21.4658, -14.9614),
27
+ (21.3453, -15.5295),
28
+ (21.2239, -16.0828),
29
+ (21.1017, -16.6204),
30
+ (20.9792, -17.1418),
31
+ (20.8558, -17.6463),
32
+ (20.7317, -18.1334),
33
+ (20.6069, -18.6023),
34
+ (20.4817, -19.0525),
35
+ (20.3556, -19.4835),
36
+ (20.2289, -19.8946),
37
+ (20.1014, -20.2853),
38
+ (19.9733, -20.655),
39
+ (19.845, -21.0032),
40
+ (19.7158, -21.3295),
41
+ (19.5861, -21.6334),
42
+ (19.4558, -21.9144),
43
+ (19.325, -22.1721),
44
+ (19.1939, -22.4061),
45
+ (19.0622, -22.6161),
46
+ (18.9303, -22.8017),
47
+ (18.7981, -22.9627),
48
+ (18.6656, -23.0989),
49
+ (18.5328, -23.2099),
50
+ (18.3997, -23.2956),
51
+ (18.2664, -23.3559),
52
+ (18.1331, -23.3908),
53
+ (18.0, -23.4),
54
+ (17.8667, -23.3908),
55
+ (17.7333, -23.3559),
56
+ (17.6, -23.2956),
57
+ (17.4669, -23.2099),
58
+ (17.3342, -23.0989),
59
+ (17.2017, -22.9627),
60
+ (17.0694, -22.8017),
61
+ (16.9375, -22.6161),
62
+ (16.8058, -22.4061),
63
+ (16.6747, -22.1721),
64
+ (16.5439, -21.9144),
65
+ (16.4136, -21.6334),
66
+ (16.2839, -21.3295),
67
+ (16.1547, -21.0032),
68
+ (16.0264, -20.655),
69
+ (15.8983, -20.2853),
70
+ (15.7708, -19.8946),
71
+ (15.6442, -19.4835),
72
+ (15.5181, -19.0525),
73
+ (15.3928, -18.6023),
74
+ (15.2681, -18.1334),
75
+ (15.1439, -17.6463),
76
+ (15.0206, -17.1418),
77
+ (14.8981, -16.6204),
78
+ (14.7758, -16.0828),
79
+ (14.6544, -15.5295),
80
+ (14.5339, -14.9614),
81
+ (14.4139, -14.3788),
82
+ (14.2944, -13.7827),
83
+ (14.1756, -13.1735),
84
+ (14.0572, -12.552),
85
+ (13.9397, -11.9188),
86
+ (13.8225, -11.2745),
87
+ (13.7058, -10.6199),
88
+ (13.59, -9.9555),
89
+ (13.4742, -9.2821),
90
+ (13.3592, -8.6003),
91
+ (13.2444, -7.9108),
92
+ (13.13, -7.2141),
93
+ (13.0158, -6.511),
94
+ (12.9022, -5.8021),
95
+ (12.7889, -5.0881),
96
+ (12.6756, -4.3696),
97
+ (12.5628, -3.6472),
98
+ (12.45, -2.9216),
99
+ (12.3372, -2.1934),
100
+ (12.2247, -1.4634),
101
+ (12.1122, -0.732),
102
+ (12.0, 0.0),
103
+ (11.8875, 0.732),
104
+ (11.775, 1.4634),
105
+ (11.6625, 2.1934),
106
+ (11.5497, 2.9216),
107
+ (11.4369, 3.6472),
108
+ (11.3242, 4.3696),
109
+ (11.2108, 5.0881),
110
+ (11.0975, 5.8021),
111
+ (10.9839, 6.511),
112
+ (10.8697, 7.2141),
113
+ (10.7553, 7.9108),
114
+ (10.6406, 8.6003),
115
+ (10.5256, 9.2821),
116
+ (10.4097, 9.9555),
117
+ (10.2939, 10.6199),
118
+ (10.1772, 11.2745),
119
+ (10.06, 11.9188),
120
+ (9.9425, 12.552),
121
+ (9.8242, 13.1735),
122
+ (9.7053, 13.7827),
123
+ (9.5858, 14.3788),
124
+ (9.4658, 14.9614),
125
+ (9.3453, 15.5295),
126
+ (9.2239, 16.0828),
127
+ (9.1017, 16.6204),
128
+ (8.9792, 17.1418),
129
+ (8.8558, 17.6463),
130
+ (8.7317, 18.1334),
131
+ (8.6069, 18.6023),
132
+ (8.4817, 19.0525),
133
+ (8.3556, 19.4835),
134
+ (8.2289, 19.8946),
135
+ (8.1014, 20.2853),
136
+ (7.9733, 20.655),
137
+ (7.845, 21.0032),
138
+ (7.7158, 21.3295),
139
+ (7.5861, 21.6334),
140
+ (7.4558, 21.9144),
141
+ (7.325, 22.1721),
142
+ (7.1939, 22.4061),
143
+ (7.0622, 22.6161),
144
+ (6.9303, 22.8017),
145
+ (6.7981, 22.9627),
146
+ (6.6656, 23.0989),
147
+ (6.5328, 23.2099),
148
+ (6.3997, 23.2956),
149
+ (6.2664, 23.3559),
150
+ (6.1331, 23.3908),
151
+ (6.0, 23.4),
152
+ (5.8667, 23.3908),
153
+ (5.7333, 23.3559),
154
+ (5.6, 23.2956),
155
+ (5.4669, 23.2099),
156
+ (5.3342, 23.0989),
157
+ (5.2017, 22.9627),
158
+ (5.0694, 22.8017),
159
+ (4.9375, 22.6161),
160
+ (4.8058, 22.4061),
161
+ (4.6747, 22.1721),
162
+ (4.5439, 21.9144),
163
+ (4.4136, 21.6334),
164
+ (4.2839, 21.3295),
165
+ (4.1547, 21.0032),
166
+ (4.0264, 20.655),
167
+ (3.8983, 20.2853),
168
+ (3.7708, 19.8946),
169
+ (3.6442, 19.4835),
170
+ (3.5181, 19.0525),
171
+ (3.3928, 18.6023),
172
+ (3.2681, 18.1334),
173
+ (3.1439, 17.6463),
174
+ (3.0206, 17.1418),
175
+ (2.8981, 16.6204),
176
+ (2.7758, 16.0828),
177
+ (2.6544, 15.5295),
178
+ (2.5339, 14.9614),
179
+ (2.4139, 14.3788),
180
+ (2.2944, 13.7827),
181
+ (2.1756, 13.1735),
182
+ (2.0572, 12.552),
183
+ (1.9397, 11.9188),
184
+ (1.8225, 11.2745),
185
+ (1.7058, 10.6199),
186
+ (1.59, 9.9555),
187
+ (1.4742, 9.2821),
188
+ (1.3592, 8.6003),
189
+ (1.2444, 7.9108),
190
+ (1.13, 7.2141),
191
+ (1.0158, 6.511),
192
+ (0.9022, 5.8021),
193
+ (0.7889, 5.0881),
194
+ (0.6756, 4.3696),
195
+ (0.5628, 3.6472),
196
+ (0.45, 2.9216),
197
+ (0.3372, 2.1934),
198
+ (0.2247, 1.4634),
199
+ (0.1122, 0.732),
200
+ (0.0, 0.0),
201
+ ]
Binary file
@@ -0,0 +1 @@
1
+ this directory only exists until all data from sky.db is deprecated
starplot/data/stars.py ADDED
@@ -0,0 +1,79 @@
1
+ from functools import cache
2
+ from pathlib import Path
3
+
4
+ from ibis import _
5
+ from shapely import Polygon, MultiPolygon
6
+
7
+ from starplot.config import settings
8
+ from starplot.data import db
9
+ from starplot.data.catalogs import Catalog, SpatialQueryMethod, BIG_SKY_MAG11
10
+ from starplot.data.translations import language_name_column, LANGUAGE_NAME_COLUMNS
11
+
12
+
13
+ @cache
14
+ def table(
15
+ con,
16
+ catalog: Catalog | Path | str = BIG_SKY_MAG11,
17
+ table_name="stars",
18
+ language: str = "en-us",
19
+ ):
20
+ if isinstance(catalog, Catalog):
21
+ stars = catalog._load(connection=con, table_name=table_name)
22
+ else:
23
+ stars = con.read_parquet(str(catalog), table_name=table_name)
24
+
25
+ designation_columns = ["name", "bayer", "flamsteed"] + LANGUAGE_NAME_COLUMNS
26
+ designation_columns_missing = {
27
+ col for col in designation_columns if col not in stars.columns
28
+ }
29
+
30
+ if designation_columns_missing and "hip" in stars.columns:
31
+ designations = con.table("star_designations")
32
+ designations = designations.mutate(
33
+ name=getattr(designations, language_name_column(language))
34
+ )
35
+ stars_joined = stars.join(
36
+ designations,
37
+ stars.hip == designations.hip,
38
+ how="left",
39
+ )
40
+ stars = stars_joined.select(*stars.columns, *designation_columns_missing)
41
+
42
+ return stars
43
+
44
+
45
+ def load(
46
+ catalog: Catalog | Path | str,
47
+ extent: Polygon | MultiPolygon = None,
48
+ filters=None,
49
+ sql=None,
50
+ ):
51
+ filters = filters or []
52
+ con = db.connect()
53
+ stars = table(con=con, catalog=catalog, language=settings.language)
54
+
55
+ if (
56
+ catalog.spatial_query_method == SpatialQueryMethod.HEALPIX.value
57
+ and catalog.healpix_nside
58
+ and extent is not None
59
+ ):
60
+ healpix_indices = catalog.healpix_ids_from_extent(extent)
61
+ stars = stars.filter(stars.healpix_index.isin(healpix_indices))
62
+ stars = con.create_table("stars_temp", obj=stars, temp=True, overwrite=True)
63
+
64
+ stars = stars.mutate(
65
+ geometry=_.geometry.cast("geometry"), # cast WKB to geometry type
66
+ )
67
+
68
+ if extent:
69
+ stars = stars.filter(stars.geometry.intersects(extent))
70
+
71
+ if filters:
72
+ stars = stars.filter(*filters)
73
+
74
+ if sql:
75
+ result = stars.alias("_").sql(sql).select("pk").execute()
76
+ pks = result["pk"].to_list()
77
+ stars = stars.filter(_.pk.isin(pks))
78
+
79
+ return stars
@@ -0,0 +1,408 @@
1
+ LABELS = {
2
+ "en-us": {
3
+ "legend": "legend",
4
+ "star magnitude": "star magnitude",
5
+ "star": "star",
6
+ "deep sky object": "deep sky object",
7
+ "open cluster": "open cluster",
8
+ "globular cluster": "globular cluster",
9
+ "nebula": "nebula",
10
+ "galaxy": "galaxy",
11
+ "dark nebula": "dark nebula",
12
+ "association of stars": "association of stars",
13
+ "double star": "double star",
14
+ "emission nebula": "emission nebula",
15
+ "galaxy pair": "galaxy pair",
16
+ "galaxy triplet": "galaxy triplet",
17
+ "galaxy cluster": "galaxy cluster",
18
+ "group of galaxies": "group of galaxies",
19
+ "hii ionized region": "hii ionized region",
20
+ "nova star": "nova star",
21
+ "planetary nebula": "planetary nebula",
22
+ "reflection nebula": "reflection nebula",
23
+ "star cluster nebula": "star cluster nebula",
24
+ "supernova remnant": "supernova remnant",
25
+ "unknown": "unknown",
26
+ "planet": "planet",
27
+ "mercury": "mercury",
28
+ "venus": "venus",
29
+ "mars": "mars",
30
+ "jupiter": "jupiter",
31
+ "saturn": "saturn",
32
+ "uranus": "uranus",
33
+ "neptune": "neptune",
34
+ "pluto": "pluto",
35
+ "sun": "sun",
36
+ "moon": "moon",
37
+ "north": "north",
38
+ "east": "east",
39
+ "south": "south",
40
+ "west": "west",
41
+ "ecliptic": "ecliptic",
42
+ "celestial equator": "celestial equator",
43
+ "n": "n",
44
+ "e": "e",
45
+ "s": "s",
46
+ "w": "w",
47
+ "milky way": "milky way",
48
+ },
49
+ "es": {
50
+ "star": "estrella",
51
+ "deep sky object": "objeto de cielo profundo",
52
+ "open cluster": "cúmulo abierto",
53
+ "globular cluster": "cúmulo globular",
54
+ "nebula": "nebulosa",
55
+ "galaxy": "galaxia",
56
+ "dark nebula": "nebulosa oscura",
57
+ "association of stars": "asociación estelar",
58
+ "double star": "estrella doble",
59
+ "emission nebula": "nebulosa de emisión",
60
+ "galaxy pair": "galaxia doble",
61
+ "galaxy triplet": "galaxia triple",
62
+ "galaxy cluster": "cúmulo de galaxias",
63
+ "group of galaxies": "grupo de galaxias",
64
+ "hii ionized region": "región ionizada hii",
65
+ "nova star": "estrella nova",
66
+ "planetary nebula": "nebulosa planetaria",
67
+ "reflection nebula": "nebulosa de reflexión",
68
+ "star cluster nebula": "nebulosa de cúmulo abierto",
69
+ "supernova remnant": "remanente de supernova",
70
+ "unknown": "desconocido",
71
+ "mercury": "mercurio",
72
+ "venus": "venus",
73
+ "mars": "marte",
74
+ "jupiter": "júpiter",
75
+ "saturn": "saturno",
76
+ "uranus": "urano",
77
+ "neptune": "neptuno",
78
+ "pluto": "plutón",
79
+ "sun": "sol",
80
+ "moon": "luna",
81
+ "north": "norte",
82
+ "east": "este",
83
+ "south": "sur",
84
+ "west": "oeste",
85
+ "ecliptic": "eclíptica",
86
+ "celestial equator": "ecuador celeste",
87
+ "n": "n",
88
+ "e": "e",
89
+ "s": "s",
90
+ "w": "o",
91
+ "milky way": "vía láctea",
92
+ },
93
+ "fr": {
94
+ "legend": "légende",
95
+ "star magnitude": "magnitude des étoiles",
96
+ "star": "étoile",
97
+ "deep sky object": "objet du ciel profond",
98
+ "open cluster": "amas ouvert",
99
+ "globular cluster": "amas globulaire",
100
+ "nebula": "nébuleuse",
101
+ "galaxy": "galaxie",
102
+ "dark nebula": "nébuleuse obscure",
103
+ "association of stars": "amas d'étoiles",
104
+ "double star": "étoile double",
105
+ "emission nebula": "nébuleuse en émission",
106
+ "galaxy pair": "paire de galaxies",
107
+ "galaxy triplet": "triplet de galaxies",
108
+ "galaxy cluster": "amas de galaxies",
109
+ "group of galaxies": "groupes de galaxies",
110
+ "hii ionized region": "région d'hydrogène ionisé",
111
+ "nova star": "nova",
112
+ "planetary nebula": "nébuleuse planétaire",
113
+ "reflection nebula": "nébuleuse par réflexion",
114
+ "star cluster nebula": "nébuleuse d’amas d’étoiles",
115
+ "supernova remnant": "rémanent de supernova",
116
+ "unknown": "inconnu",
117
+ "planet": "planète",
118
+ "mercury": "mercure",
119
+ "venus": "venus",
120
+ "mars": "mars",
121
+ "jupiter": "jupiter",
122
+ "saturn": "saturne",
123
+ "uranus": "uranus",
124
+ "neptune": "neptune",
125
+ "pluto": "pluton",
126
+ "sun": "soleil",
127
+ "moon": "lune",
128
+ "north": "nord",
129
+ "east": "est",
130
+ "south": "sud",
131
+ "west": "ouest",
132
+ "ecliptic": "écliptique",
133
+ "celestial equator": "équateur céleste",
134
+ "n": "n",
135
+ "e": "e",
136
+ "s": "s",
137
+ "w": "o",
138
+ "milky way": "voie lactée",
139
+ },
140
+ "it": {
141
+ "legend": "legenda",
142
+ "star magnitude": "magnitudine stellare",
143
+ "star": "stella",
144
+ "deep sky object": "oggetto del profondo cielo",
145
+ "open cluster": "ammasso aperto",
146
+ "globular cluster": "ammasso globulare",
147
+ "nebula": "nebulosa",
148
+ "galaxy": "galassia",
149
+ "dark nebula": "nebulosa oscura",
150
+ "association of stars": "ammasso stellare",
151
+ "double star": "stella doppia",
152
+ "emission nebula": "nebulosa a emissione",
153
+ "galaxy pair": "coppia di galassie",
154
+ "galaxy triplet": "trio di galassie",
155
+ "galaxy cluster": "ammasso di galassie",
156
+ "group of galaxies": "gruppo di galassie",
157
+ "hii ionized region": "regione hii",
158
+ "nova star": "nova",
159
+ "planetary nebula": "nebulosa planetaria",
160
+ "reflection nebula": "nebulosa a riflessione",
161
+ "star cluster nebula": "nebulosa di ammasso stellare",
162
+ "supernova remnant": "resto di supernova",
163
+ "unknown": "sconosciuto",
164
+ "planet": "pianeta",
165
+ "mercury": "mercurio",
166
+ "venus": "venere",
167
+ "mars": "marte",
168
+ "jupiter": "giove",
169
+ "saturn": "saturno",
170
+ "uranus": "urano",
171
+ "neptune": "nettuno",
172
+ "pluto": "plutone",
173
+ "sun": "sole",
174
+ "moon": "luna",
175
+ "north": "nord",
176
+ "east": "est",
177
+ "south": "sud",
178
+ "west": "ovest",
179
+ "ecliptic": "eclittica",
180
+ "celestial equator": "equatore celeste",
181
+ "n": "n",
182
+ "e": "e",
183
+ "s": "s",
184
+ "w": "o",
185
+ "milky way": "via lattea",
186
+ },
187
+ "zh-cn": {
188
+ "legend": "图例",
189
+ "star magnitude": "星等",
190
+ "star": "恒星",
191
+ "deep sky object": "深空天体",
192
+ "open cluster": "疏散星团",
193
+ "globular cluster": "球状星团",
194
+ "nebula": "星云",
195
+ "galaxy": "星系",
196
+ "dark nebula": "暗星云",
197
+ "association of stars": "星协",
198
+ "double star": "双星",
199
+ "emission nebula": "发射星云",
200
+ "galaxy pair": "星系对",
201
+ "galaxy triplet": "三重星系",
202
+ "galaxy cluster": "星系团",
203
+ "group of galaxies": "星系群",
204
+ "hii ionized region": "hii电离氢区",
205
+ "nova star": "新星",
206
+ "planetary nebula": "行星状星云",
207
+ "reflection nebula": "反射星云",
208
+ "star cluster nebula": "星团星云",
209
+ "supernova remnant": "超新星遗迹",
210
+ "unknown": "未知天体",
211
+ "planet": "行星",
212
+ "mercury": "水星",
213
+ "venus": "金星",
214
+ "mars": "火星",
215
+ "jupiter": "木星",
216
+ "saturn": "土星",
217
+ "uranus": "天王星",
218
+ "neptune": "海王星",
219
+ "pluto": "冥王星",
220
+ "sun": "太阳",
221
+ "moon": "月球",
222
+ "north": "北",
223
+ "east": "东",
224
+ "south": "南",
225
+ "west": "西",
226
+ "ecliptic": "黄道",
227
+ "celestial equator": "天赤道",
228
+ "n": "北",
229
+ "e": "东",
230
+ "s": "南",
231
+ "w": "西",
232
+ "milky way": "银河",
233
+ },
234
+ "zh-tw": {
235
+ "legend": "圖例",
236
+ "star magnitude": "星等",
237
+ "star": "恆星",
238
+ "deep sky object": "深空天體",
239
+ "open cluster": "疏散星團",
240
+ "globular cluster": "球狀星團",
241
+ "nebula": "星雲",
242
+ "galaxy": "星系",
243
+ "dark nebula": "暗星雲",
244
+ "association of stars": "星協",
245
+ "double star": "雙星",
246
+ "emission nebula": "發射星雲",
247
+ "galaxy pair": "星系對",
248
+ "galaxy triplet": "三重星系",
249
+ "galaxy cluster": "星系團",
250
+ "group of galaxies": "星系群",
251
+ "hii ionized region": "hii電離氫區",
252
+ "nova star": "新星",
253
+ "planetary nebula": "行星狀星雲",
254
+ "reflection nebula": "反射星雲",
255
+ "star cluster nebula": "星團星雲",
256
+ "supernova remnant": "超新星遺蹟",
257
+ "unknown": "未知天體",
258
+ "planet": "行星",
259
+ "mercury": "水星",
260
+ "venus": "金星",
261
+ "mars": "火星",
262
+ "jupiter": "木星",
263
+ "saturn": "土星",
264
+ "uranus": "天王星",
265
+ "neptune": "海王星",
266
+ "pluto": "冥王星",
267
+ "sun": "太陽",
268
+ "moon": "月球",
269
+ "north": "北",
270
+ "east": "東",
271
+ "south": "南",
272
+ "west": "西",
273
+ "ecliptic": "黃道",
274
+ "celestial equator": "天赤道",
275
+ "n": "北",
276
+ "e": "東",
277
+ "s": "南",
278
+ "w": "西",
279
+ "milky way": "銀河",
280
+ },
281
+ "fa": {
282
+ "legend": "راهنما",
283
+ "star magnitude": "قدر ستاره",
284
+ "star": "ستاره",
285
+ "deep sky object": "جرم عمیق آسمانی",
286
+ "open cluster": "خوشه باز",
287
+ "globular cluster": "خوشه کروی",
288
+ "nebula": "سحابی",
289
+ "galaxy": "کهکشان",
290
+ "dark nebula": "سحابی تاریک",
291
+ "association of stars": "انجمن ستارگان",
292
+ "double star": "ستاره دوتایی",
293
+ "emission nebula": "سحابی گسیلی",
294
+ "galaxy pair": "جفت کهکشان",
295
+ "galaxy triplet": "سه‌گانه کهکشانی",
296
+ "galaxy cluster": "خوشه کهکشانی",
297
+ "group of galaxies": "گروه کهکشان‌ها",
298
+ "hii ionized region": "ناحیه یونیزه هیدروژن",
299
+ "nova star": "ستاره نوا",
300
+ "planetary nebula": "سحابی سیاره‌ای",
301
+ "reflection nebula": "سحابی بازتابی",
302
+ "star cluster nebula": "سحابی خوشه ستاره‌ای",
303
+ "supernova remnant": "بقایای ابرنواختر",
304
+ "unknown": "ناشناخته",
305
+ "planet": "سیاره",
306
+ "mercury": "تیر",
307
+ "venus": "ناهید",
308
+ "mars": "بهرام",
309
+ "jupiter": "مشتری",
310
+ "saturn": "کیوان",
311
+ "uranus": "اورانوس",
312
+ "neptune": "نپتون",
313
+ "pluto": "پلوتون",
314
+ "sun": "خورشید",
315
+ "moon": "ماه",
316
+ "north": "شمال",
317
+ "east": "شرق",
318
+ "south": "جنوب",
319
+ "west": "غرب",
320
+ "ecliptic": "دایره البروج",
321
+ "celestial equator": "استوای آسمانی",
322
+ "n": "ش",
323
+ "e": "ق",
324
+ "s": "ج",
325
+ "w": "غ",
326
+ "milky way": "کهکشان راه شیری",
327
+ },
328
+ "lt": {
329
+ "legend": "legenda",
330
+ "star": "žvaigždė",
331
+ "deep sky object": "tolimojo kosmoso objektas",
332
+ "open cluster": "padrikasis spiečius",
333
+ "globular cluster": "kamuolinis spiečius",
334
+ "nebula": "ūkas",
335
+ "galaxy": "galaktika",
336
+ "dark nebula": "tamsusis ūkas",
337
+ "association of stars": "žvaigždžių asociacija",
338
+ "double star": "dvinarė žvaigždė",
339
+ "emission nebula": "emisinis ūkas",
340
+ "galaxy pair": "galaktikų pora",
341
+ "galaxy triplet": "galaktikų trejetas",
342
+ "galaxy cluster": "galaktikų spiečius",
343
+ "group of galaxies": "galaktikų grupė",
344
+ "hii ionized region": "hii jonizuotas regionas",
345
+ "nova star": "nova (žvaigždė)",
346
+ "planetary nebula": "planetinis ūkas",
347
+ "reflection nebula": "atspindžio ūkas",
348
+ "star cluster nebula": "žvaigždžių spiečiaus ūkas",
349
+ "supernova remnant": "supernovos liekana",
350
+ "unknown": "nežinomas",
351
+ "mercury": "Merkurijus",
352
+ "venus": "Venera",
353
+ "mars": "Marsas",
354
+ "jupiter": "Jupiteris",
355
+ "saturn": "Saturnas",
356
+ "uranus": "Uranas",
357
+ "neptune": "Neptūnas",
358
+ "pluto": "Plutonas",
359
+ "sun": "Saulė",
360
+ "moon": "Mėnulis",
361
+ "north": "Šiaurė",
362
+ "east": "Rytai",
363
+ "south": "Pietūs",
364
+ "west": "Vakarai",
365
+ "ecliptic": "Ekliptika",
366
+ "celestial equator": "Dangaus pusiaujas",
367
+ "n": "Š",
368
+ "e": "R",
369
+ "s": "P",
370
+ "w": "V",
371
+ "milky way": "Paukščių Takas",
372
+ },
373
+ }
374
+
375
+
376
+ LANGUAGES = [
377
+ "en-us",
378
+ "es",
379
+ "fa",
380
+ "fr",
381
+ "it",
382
+ "lt",
383
+ "zh-cn",
384
+ "zh-tw",
385
+ ]
386
+
387
+
388
+ def language_name_column(language: str, column_prefix: str = "name") -> str:
389
+ # if language.lower() not in LANGUAGES:
390
+ # raise ValueError("Unsupported language")
391
+
392
+ language_name = language.replace("-", "_").lower()
393
+ return f"{column_prefix}_{language_name}"
394
+
395
+
396
+ def translate(text: str, language: str) -> str:
397
+ if not text:
398
+ return text
399
+
400
+ translation = LABELS[language.lower()].get(text.lower())
401
+
402
+ if not translation:
403
+ return text
404
+
405
+ return translation.title()
406
+
407
+
408
+ LANGUAGE_NAME_COLUMNS = [language_name_column(lang) for lang in LANGUAGES]