starplot 0.12.5__py2.py3-none-any.whl → 0.14.0__py2.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.

Potentially problematic release.


This version of starplot might be problematic. Click here for more details.

Files changed (73) hide show
  1. starplot/__init__.py +3 -2
  2. starplot/base.py +408 -95
  3. starplot/callables.py +61 -7
  4. starplot/coordinates.py +6 -0
  5. starplot/data/bayer.py +1532 -3
  6. starplot/data/constellations.py +564 -2
  7. starplot/data/flamsteed.py +2682 -0
  8. starplot/data/library/constellation_borders_inv.gpkg +0 -0
  9. starplot/data/library/constellation_lines_hips.json +3 -1
  10. starplot/data/stars.py +408 -87
  11. starplot/geometry.py +82 -0
  12. starplot/horizon.py +458 -0
  13. starplot/map.py +97 -284
  14. starplot/models/base.py +9 -2
  15. starplot/models/constellation.py +1 -1
  16. starplot/optic.py +32 -14
  17. starplot/plotters/__init__.py +2 -0
  18. starplot/plotters/constellations.py +339 -0
  19. starplot/plotters/dsos.py +5 -1
  20. starplot/plotters/experimental.py +171 -0
  21. starplot/plotters/milkyway.py +41 -0
  22. starplot/plotters/stars.py +143 -13
  23. starplot/styles/base.py +308 -169
  24. starplot/styles/ext/antique.yml +54 -46
  25. starplot/styles/ext/blue_dark.yml +39 -45
  26. starplot/styles/ext/blue_light.yml +49 -30
  27. starplot/styles/ext/blue_medium.yml +53 -50
  28. starplot/styles/ext/cb_wong.yml +16 -7
  29. starplot/styles/ext/grayscale.yml +17 -10
  30. starplot/styles/ext/grayscale_dark.yml +18 -8
  31. starplot/styles/ext/map.yml +10 -7
  32. starplot/styles/ext/nord.yml +38 -38
  33. starplot/styles/ext/optic.yml +7 -5
  34. starplot/styles/fonts-library/gfs-didot/DESCRIPTION.en_us.html +9 -0
  35. starplot/styles/fonts-library/gfs-didot/GFSDidot-Regular.ttf +0 -0
  36. starplot/styles/fonts-library/gfs-didot/METADATA.pb +16 -0
  37. starplot/styles/fonts-library/gfs-didot/OFL.txt +94 -0
  38. starplot/styles/fonts-library/hind/DESCRIPTION.en_us.html +28 -0
  39. starplot/styles/fonts-library/hind/Hind-Bold.ttf +0 -0
  40. starplot/styles/fonts-library/hind/Hind-Light.ttf +0 -0
  41. starplot/styles/fonts-library/hind/Hind-Medium.ttf +0 -0
  42. starplot/styles/fonts-library/hind/Hind-Regular.ttf +0 -0
  43. starplot/styles/fonts-library/hind/Hind-SemiBold.ttf +0 -0
  44. starplot/styles/fonts-library/hind/METADATA.pb +58 -0
  45. starplot/styles/fonts-library/hind/OFL.txt +93 -0
  46. starplot/styles/fonts-library/inter/Inter-Black.ttf +0 -0
  47. starplot/styles/fonts-library/inter/Inter-BlackItalic.ttf +0 -0
  48. starplot/styles/fonts-library/inter/Inter-Bold.ttf +0 -0
  49. starplot/styles/fonts-library/inter/Inter-BoldItalic.ttf +0 -0
  50. starplot/styles/fonts-library/inter/Inter-ExtraBold.ttf +0 -0
  51. starplot/styles/fonts-library/inter/Inter-ExtraBoldItalic.ttf +0 -0
  52. starplot/styles/fonts-library/inter/Inter-ExtraLight.ttf +0 -0
  53. starplot/styles/fonts-library/inter/Inter-ExtraLightItalic.ttf +0 -0
  54. starplot/styles/fonts-library/inter/Inter-Italic.ttf +0 -0
  55. starplot/styles/fonts-library/inter/Inter-Light.ttf +0 -0
  56. starplot/styles/fonts-library/inter/Inter-LightItalic.ttf +0 -0
  57. starplot/styles/fonts-library/inter/Inter-Medium.ttf +0 -0
  58. starplot/styles/fonts-library/inter/Inter-MediumItalic.ttf +0 -0
  59. starplot/styles/fonts-library/inter/Inter-Regular.ttf +0 -0
  60. starplot/styles/fonts-library/inter/Inter-SemiBold.ttf +0 -0
  61. starplot/styles/fonts-library/inter/Inter-SemiBoldItalic.ttf +0 -0
  62. starplot/styles/fonts-library/inter/Inter-Thin.ttf +0 -0
  63. starplot/styles/fonts-library/inter/Inter-ThinItalic.ttf +0 -0
  64. starplot/styles/fonts-library/inter/LICENSE.txt +92 -0
  65. starplot/styles/fonts.py +15 -0
  66. starplot/styles/markers.py +207 -6
  67. starplot/utils.py +19 -0
  68. starplot/warnings.py +16 -0
  69. {starplot-0.12.5.dist-info → starplot-0.14.0.dist-info}/METADATA +12 -12
  70. starplot-0.14.0.dist-info/RECORD +107 -0
  71. starplot-0.12.5.dist-info/RECORD +0 -67
  72. {starplot-0.12.5.dist-info → starplot-0.14.0.dist-info}/LICENSE +0 -0
  73. {starplot-0.12.5.dist-info → starplot-0.14.0.dist-info}/WHEEL +0 -0
@@ -425,7 +425,9 @@
425
425
  [93194, 92420],
426
426
  [92420, 91971]],
427
427
  "men": [[29271, 23467]],
428
- "mic": [[102831, 102989]],
428
+ "mic": [[102831, 103738],
429
+ [103738, 105140],
430
+ [105140, 105382]],
429
431
  "mon": [[31978, 31216],
430
432
  [31216, 30419],
431
433
  [30419, 30419],
starplot/data/stars.py CHANGED
@@ -5,108 +5,429 @@ from pandas import read_parquet
5
5
  from starplot.data import bigsky, DataFiles
6
6
 
7
7
  STAR_NAMES = {
8
+ 677: "Alpheratz",
9
+ 746: "Caph",
10
+ 1067: "Algenib",
11
+ 1547: "Citadelle",
12
+ 2081: "Ankaa",
13
+ 2247: "Felixvarela",
14
+ 2920: "Fulu",
15
+ 3179: "Schedar",
16
+ 3419: "Diphda",
17
+ 3479: "Cocibolca",
18
+ 3821: "Achird",
19
+ 4422: "Castula",
20
+ 5054: "Nenque",
21
+ 5348: "Wurren",
22
+ 5447: "Mirach",
23
+ 5529: "Emiw",
24
+ 5737: "Revati",
25
+ 6193: "Bharani",
26
+ 6411: "Adhil",
27
+ 6643: "Bélénos",
28
+ 6686: "Ruchbah",
29
+ 7097: "Alpherg",
30
+ 7513: "Titawin",
8
31
  7588: "Achernar",
9
- 60718: "Acrux",
10
- 33579: "Adhara",
11
- 68702: "Hadar",
12
- 95947: "Albireo",
13
- 65477: "Alcor",
32
+ 7607: "Nembus",
33
+ 8198: "Torcular",
34
+ 8645: "Baten Kaitos",
35
+ 8796: "Mothallah",
36
+ 8832: "Mesarthim",
37
+ 8886: "Segin",
38
+ 8903: "Sheratan",
39
+ 9487: "Alrescha",
40
+ 9640: "Almach",
41
+ 9884: "Hamal",
42
+ 10826: "Mira",
43
+ 11767: "Polaris",
44
+ 12191: "Buna",
45
+ 12706: "Kaffaljidhma",
46
+ 12961: "Koeia",
47
+ 13061: "Lilii Borea",
48
+ 13192: "Nushagak",
49
+ 13268: "Miram",
50
+ 13288: "Angetenar",
51
+ 13701: "Azha",
52
+ 13847: "Acamar",
53
+ 13993: "Ayeyarwady",
54
+ 14135: "Menkar",
55
+ 14576: "Algol",
56
+ 14668: "Misam",
57
+ 14838: "Botein",
58
+ 14879: "Dalim",
59
+ 15197: "Zibal",
60
+ 15578: "Intan",
61
+ 15863: "Mirfak",
62
+ 16537: "Ran",
63
+ 17096: "Tupi",
64
+ 17378: "Rana",
65
+ 17448: "Atik",
66
+ 17489: "Celaeno",
67
+ 17499: "Electra",
68
+ 17531: "Taygeta",
69
+ 17573: "Maia",
70
+ 17579: "Asterope",
71
+ 17608: "Merope",
14
72
  17702: "Alcyone",
73
+ 17847: "Atlas",
74
+ 17851: "Pleione",
75
+ 18543: "Zaurak",
76
+ 18614: "Menkib",
77
+ 19587: "Beid",
78
+ 19780: "Rhombus",
79
+ 19849: "Keid",
80
+ 20205: "Prima Hyadum",
81
+ 20455: "Secunda Hyadum",
82
+ 20535: "Beemim",
83
+ 20889: "Ain",
84
+ 20894: "Chamukuy",
85
+ 21109: "Hoggar",
86
+ 21393: "Theemin",
15
87
  21421: "Aldebaran",
16
- 105199: "Alderamin",
17
- 15863: "Mirfak",
18
- 50583: "Algieba",
19
- 14576: "Algol",
20
- 31681: "Alhena",
21
- 62956: "Alioth",
22
- 67301: "Benetnash",
23
- 9640: "Almach",
24
- 109268: "Alnair",
88
+ 21594: "Sceptrum",
89
+ 22449: "Tabit",
90
+ 22491: "Mouhoun",
91
+ 23015: "Hassaleh",
92
+ 23416: "Almaaz",
93
+ 23453: "Saclateni",
94
+ 23767: "Haedus",
95
+ 23875: "Cursa",
96
+ 24003: "Mago",
97
+ 24436: "Rigel",
98
+ 24608: "Capella",
99
+ 25336: "Bellatrix",
100
+ 25428: "Elnath",
101
+ 25606: "Nihal",
102
+ 25930: "Mintaka",
103
+ 25985: "Arneb",
104
+ 26207: "Meissa",
105
+ 26241: "Hatysa",
25
106
  26311: "Alnilam",
107
+ 26380: "Bubup",
108
+ 26451: "Tianguan",
109
+ 26634: "Phact",
26
110
  26727: "Alnitak",
27
- 46390: "Alphard",
28
- 76267: "Gemma",
29
- 677: "Sirrah",
30
- 97649: "Altair",
31
- 35904: "Aludra",
32
- 2081: "Ankaa",
33
- 80763: "Antares",
34
- 69673: "Arcturus",
35
- 102098: "Deneb",
36
- 45556: "Turais",
37
- 82273: "Atria",
38
- 41037: "Avior",
39
- 62434: "Mimosa",
40
- 25336: "Bellatrix",
111
+ 27366: "Saiph",
112
+ 27628: "Wazn",
41
113
  27989: "Betelgeuse",
42
- 66657: "Birdun",
114
+ 28360: "Menkalinan",
115
+ 28380: "Mahasim",
116
+ 29034: "Elkurud",
117
+ 29550: "Amadioha",
118
+ 29655: "Propus",
119
+ 30122: "Furud",
120
+ 30324: "Mirzam",
121
+ 30343: "Tejat",
43
122
  30438: "Canopus",
44
- 24608: "Capella",
45
- 746: "Caph",
123
+ 30860: "Lucilinburhuc",
124
+ 30905: "Lusitânia",
125
+ 31681: "Alhena",
126
+ 31685: "Pipit",
127
+ 31895: "Nosaxa",
128
+ 32246: "Mebsuta",
129
+ 32349: "Sirius",
130
+ 32362: "Alzirr",
131
+ 32916: "Nervia",
132
+ 33579: "Adhara",
133
+ 33719: "Citalá",
134
+ 33856: "Unurgunite",
135
+ 34045: "Muliphein",
136
+ 34088: "Mekbuda",
137
+ 34444: "Wezen",
138
+ 35550: "Wasat",
139
+ 35904: "Aludra",
140
+ 36188: "Gomeisa",
46
141
  36850: "Castor",
47
- 3419: "Diphda",
48
- 57632: "Denebola",
49
- 78401: "Dschubba",
142
+ 37265: "Jishui",
143
+ 37279: "Procyon",
144
+ 37284: "Ceibo",
145
+ 37826: "Pollux",
146
+ 38041: "Tapecue",
147
+ 38170: "Azmidi",
148
+ 39429: "Naos",
149
+ 39757: "Tureis",
150
+ 39953: "Regor", # not officially part of IAU recognized names
151
+ 40167: "Tegmine",
152
+ 40526: "Tarf",
153
+ 40687: "Násti",
154
+ 40881: "Piautos",
155
+ 41037: "Avior",
156
+ 41075: "Alsciaukat",
157
+ 41704: "Muscida",
158
+ 42402: "Minchir",
159
+ 42446: "Gakyid",
160
+ 42556: "Meleph",
161
+ 42806: "Asellus Borealis",
162
+ 42911: "Asellus Australis",
163
+ 42913: "Alsephina",
164
+ 43109: "Ashlesha",
165
+ 43587: "Copernicus",
166
+ 43674: "Stribor",
167
+ 44066: "Acubens",
168
+ 44127: "Talitha",
169
+ 44471: "Alkaphrah",
170
+ 44816: "Suhail",
171
+ 44946: "Nahn",
172
+ 45238: "Miaplacidus",
173
+ 45556: "Aspidiske",
174
+ 45941: "Markeb",
175
+ 46390: "Alphard",
176
+ 46471: "Intercrus",
177
+ 46750: "Alterf",
178
+ 47087: "Illyrian",
179
+ 47202: "Kalausi",
180
+ 47431: "Ukdah",
181
+ 47508: "Subra",
182
+ 48235: "Natasha",
183
+ 48356: "Zhang",
184
+ 48455: "Rasalas",
185
+ 48615: "Felis",
186
+ 48711: "Bibhā",
187
+ 49637: "Yunü (Yunu)",
188
+ 49669: "Regulus",
189
+ 50335: "Adhafera",
190
+ 50372: "Tania Borealis",
191
+ 50583: "Algieba",
192
+ 50801: "Tania Australis",
193
+ 51624: "Shaomin",
194
+ 52521: "Macondo",
195
+ 53229: "Praecipua",
196
+ 53721: "Chalawan",
197
+ 53740: "Alkes",
198
+ 53910: "Merak",
50
199
  54061: "Dubhe",
51
- 8102: "Durre Menthor",
52
- 25428: "Elnath",
53
- 107315: "Enif",
54
- 87833: "Etamin",
55
- 113368: "Fomalhaut",
56
- 93308: "Tseen She",
200
+ 54158: "Dingolay",
201
+ 54872: "Zosma",
202
+ 54879: "Chertan",
203
+ 55174: "Hunahpú",
204
+ 55203: "Alula Australis",
205
+ 55219: "Alula Borealis",
206
+ 55664: "Shama",
207
+ 56211: "Giausar",
208
+ 56508: "Formosa",
209
+ 56572: "Sagarmatha",
210
+ 57291: "Uklun",
211
+ 57370: "Flegetonte",
212
+ 57399: "Taiyangshou",
213
+ 57632: "Denebola",
214
+ 57757: "Zavijava",
215
+ 57820: "Aniara",
216
+ 58001: "Phecda",
217
+ 58952: "Tonatiuh",
218
+ 59199: "Alchiba",
219
+ 59747: "Imai",
220
+ 59774: "Megrez",
221
+ 59803: "Gienah",
222
+ 60129: "Zaniah",
223
+ 60260: "Ginan",
224
+ 60644: "Tupã",
225
+ 60718: "Acrux",
226
+ 60965: "Algorab",
57
227
  61084: "Gacrux",
58
- 102488: "Gienah",
59
- 86228: "Sargas",
60
- 112122: "Gruid",
61
- 9884: "Hamal",
62
- 107259: "Herschel's Garnet Star",
228
+ 61177: "Funi",
229
+ 61317: "Chara",
230
+ 61359: "Kraz",
231
+ 61394: "Phyllon Kissinou",
232
+ 61941: "Porrima",
233
+ 62223: "La Superba",
234
+ 62423: "Tianyi",
235
+ 62434: "Mimosa",
236
+ 62956: "Alioth",
237
+ 63076: "Taiyi",
238
+ 63090: "Minelauva",
239
+ 63125: "Cor Caroli",
240
+ 63608: "Vindemiatrix",
241
+ 64241: "Diadem",
242
+ 65378: "Mizar",
243
+ 65474: "Spica",
244
+ 65477: "Alcor",
245
+ 66047: "Dofida",
246
+ 66192: "Liesma",
247
+ 66249: "Heze",
248
+ 67301: "Alkaid",
249
+ 67927: "Muphrid",
250
+ 68002: "Leepwal",
251
+ 68702: "Hadar",
252
+ 68756: "Thuban",
253
+ 68933: "Menkent",
254
+ 69427: "Kang",
255
+ 69673: "Arcturus",
256
+ 69701: "Syrma",
257
+ 69732: "Xuange",
258
+ 69974: "Khambalia",
259
+ 70755: "Elgafar",
260
+ 70890: "Proxima Centauri",
261
+ 71075: "Seginus",
262
+ 71681: "Toliman",
263
+ 71683: "Rigil Kentaurus",
264
+ 71860: "Uridim",
63
265
  72105: "Izar",
64
- 90185: "Kaus Australis",
266
+ 72339: "Mönch",
267
+ 72487: "Merga",
65
268
  72607: "Kochab",
66
- 42913: "Koo She",
67
- 113963: "Marchab",
68
- 71352: "Marfikent",
69
- 45941: "Markab",
70
- 59774: "Megrez",
71
- 71860: "Men",
72
- 28360: "Menkalinan",
73
- 68933: "Menkent",
74
- 53910: "Merak",
75
- 45238: "Miaplacidus",
76
- 25930: "Mintaka",
77
- 10826: "Mira",
78
- 5447: "Mirach",
79
- 30324: "Murzim",
80
- 65378: "Mizar",
81
- 61932: "Muhlifein",
82
- 39429: "Naos",
83
- 92855: "Nunki",
84
- 100751: "Peacock",
85
- 58001: "Phecda",
86
- 11767: "Polaris",
87
- 37826: "Pollux",
88
- 37279: "Procyon",
89
- 86032: "Rasalhague",
90
- 39953: "Regor",
91
- 49669: "Regulus",
92
- 24436: "Rigel",
93
- 71683: "Toliman",
269
+ 72622: "Zubenelgenubi",
270
+ 72845: "Arcalís",
271
+ 73136: "Baekdu",
272
+ 73555: "Nekkar",
273
+ 73714: "Brachium",
274
+ 74785: "Zubeneschamali",
275
+ 74961: "Nikawiy",
276
+ 75097: "Pherkad",
277
+ 75411: "Alkalurops",
278
+ 75458: "Edasich",
279
+ 75695: "Nusakan",
280
+ 76267: "Alphecca",
281
+ 76333: "Zubenelhakrabi",
282
+ 76351: "Karaka",
283
+ 77070: "Unukalhai",
284
+ 77450: "Gudja",
285
+ 78104: "Iklil",
286
+ 78265: "Fang",
287
+ 78401: "Dschubba",
288
+ 78820: "Acrab",
289
+ 79043: "Marsic",
290
+ 79219: "Kamuy",
291
+ 79374: "Jabbah",
292
+ 79431: "Sharjah",
293
+ 79593: "Yed Prior",
294
+ 79882: "Yed Posterior",
295
+ 80112: "Alniyat",
296
+ 80331: "Athebyne",
297
+ 80463: "Cujam",
298
+ 80687: "Timir",
299
+ 80763: "Antares",
300
+ 80816: "Kornephoros",
301
+ 80838: "Ogma",
302
+ 80883: "Marfik",
303
+ 81022: "Rosaliadecastro",
304
+ 81266: "Paikauhale",
305
+ 82273: "Atria",
306
+ 82396: "Larawag",
307
+ 82514: "Xamidimura",
308
+ 82545: "Pipirima",
309
+ 82651: "Mahsati",
310
+ 83547: "Rapeto",
311
+ 83608: "Alrakis",
312
+ 83895: "Aldhibah",
94
313
  84012: "Sabik",
95
- 16537: "Sadira",
96
- 100453: "Sadr",
97
- 27366: "Saiph",
98
- 113881: "Scheat",
99
- 3179: "Schedar",
314
+ 84345: "Rasalgethi",
315
+ 84379: "Sarin",
316
+ 84405: "Guniibuu",
317
+ 84787: "Inquill",
318
+ 85670: "Rastaban",
319
+ 85693: "Maasym",
320
+ 85696: "Lesath",
321
+ 85822: "Yildun",
100
322
  85927: "Shaula",
101
- 32349: "Sirius",
102
- 104382: "South Star",
103
- 65474: "Spica",
104
- 44816: "Suhail",
105
- 68756: "Thuban",
106
- 4427: "Tsih",
323
+ 86032: "Rasalhague",
324
+ 86228: "Sargas",
325
+ 86614: "Dziban",
326
+ 86742: "Cebalrai",
327
+ 86782: "Alruba",
328
+ 86796: "Cervantes",
329
+ 87108: "Bake-eo (or Bake Eo)",
330
+ 87261: "Fuyue",
331
+ 87585: "Grumium",
332
+ 87833: "Eltanin",
333
+ 87937: "Barnard's Star",
334
+ 88414: "Pincoya",
335
+ 88635: "Alnasl",
336
+ 89341: "Polis",
337
+ 89931: "Kaus Media",
338
+ 90004: "Alasia",
339
+ 90185: "Kaus Australis",
340
+ 90344: "Fafnir",
341
+ 90496: "Kaus Borealis",
107
342
  91262: "Vega",
108
- 82396: "Wei",
109
- 34444: "Wezen",
343
+ 91852: "Xihe",
344
+ 92420: "Sheliak",
345
+ 92761: "Ainalrami",
346
+ 92855: "Nunki",
347
+ 92895: "Kaveh",
348
+ 92946: "Alya",
349
+ 93194: "Sulafat",
350
+ 93506: "Ascella",
351
+ 93747: "Okab",
352
+ 94114: "Meridiana",
353
+ 94141: "Albaldah",
354
+ 94376: "Altais",
355
+ 94481: "Aladfar",
356
+ 94645: "Gumala",
357
+ 95124: "Belel",
358
+ 95241: "Arkab Prior",
359
+ 95262: "Sika",
360
+ 95294: "Arkab Posterior",
361
+ 95347: "Rukbat",
362
+ 95947: "Albireo",
363
+ 96078: "Uruk",
364
+ 96100: "Alsafi",
365
+ 96757: "Sham",
366
+ 97165: "Fawaris",
367
+ 97278: "Tarazed",
368
+ 97649: "Altair",
369
+ 97938: "Libertas",
370
+ 98036: "Alshain",
371
+ 98066: "Terebellum",
372
+ 98823: "Tianfu",
373
+ 99473: "Antinous",
374
+ 99711: "Phoenicia",
375
+ 99894: "Chechia",
376
+ 100064: "Algedi",
377
+ 100310: "Alshat",
378
+ 100345: "Dabih",
379
+ 100453: "Sadr",
380
+ 100751: "Peacock",
381
+ 101421: "Aldulfin",
382
+ 101769: "Rotanev",
383
+ 101958: "Sualocin",
384
+ 102098: "Deneb",
385
+ 102488: "Aljanah",
386
+ 102618: "Albali",
387
+ 103527: "Musica",
388
+ 104382: "Polaris Australis",
389
+ 104987: "Kitalpha",
390
+ 105199: "Alderamin",
391
+ 106032: "Alfirk",
392
+ 106278: "Sadalsuud",
393
+ 106786: "Bunda",
394
+ 106824: "Sāmaya",
395
+ 106985: "Nashira",
396
+ 107136: "Azelfafage",
397
+ 107251: "Bosona",
398
+ 107259: "Garnet Star",
399
+ 107315: "Enif",
400
+ 107556: "Deneb Algedi",
401
+ 108085: "Aldhanab",
402
+ 108375: "Itonda",
403
+ 108917: "Kurhah",
404
+ 109074: "Sadalmelik",
405
+ 109268: "Alnair",
406
+ 109427: "Biham",
407
+ 110003: "Ancha",
408
+ 110130: "Lang-Exster",
409
+ 110395: "Sadachbia",
410
+ 110813: "Lionrock",
411
+ 111169: "Stellio",
412
+ 111710: "Situla",
413
+ 112029: "Homam",
414
+ 112122: "Tiaki",
415
+ 112158: "Matar",
416
+ 112748: "Sadalbari",
417
+ 113136: "Skat",
418
+ 113288: "Tengshe",
419
+ 113357: "Helvetios",
420
+ 113368: "Fomalhaut",
421
+ 113881: "Scheat",
422
+ 113889: "Fumalsamakah",
423
+ 113963: "Markab",
424
+ 114322: "Ebla",
425
+ 115250: "Salm",
426
+ 115623: "Alkarab",
427
+ 116076: "Veritate",
428
+ 116084: "Poerava",
429
+ 116727: "Errai",
430
+ 118319: "Axólotl",
110
431
  }
111
432
  """Star names by their HIP id. You can override these values when calling `stars()`"""
112
433
 
starplot/geometry.py ADDED
@@ -0,0 +1,82 @@
1
+ import random
2
+ import math
3
+
4
+ from shapely.geometry import Point, Polygon
5
+
6
+
7
+ def unwrap_polygon(polygon: Polygon) -> Polygon:
8
+ points = list(zip(*polygon.exterior.coords.xy))
9
+ new_points = []
10
+ prev = None
11
+
12
+ for x, y in points:
13
+ if prev is not None and prev > 20 and x < 12:
14
+ x += 24
15
+ elif prev is not None and prev < 12 and x > 20:
16
+ x -= 24
17
+ new_points.append((x, y))
18
+ prev = x
19
+
20
+ return Polygon(new_points)
21
+
22
+
23
+ def random_point_in_polygon(
24
+ polygon: Polygon, max_iterations: int = 100, seed: int = None
25
+ ) -> Point:
26
+ """Returns a random point inside a shapely polygon"""
27
+ if seed:
28
+ random.seed(seed)
29
+
30
+ ctr = 0
31
+ x0, y0, x1, y1 = polygon.bounds
32
+
33
+ while ctr < max_iterations:
34
+ x = random.uniform(x0, x1)
35
+ y = random.uniform(y0, y1)
36
+ point = Point(x, y)
37
+ if polygon.contains(point):
38
+ return point
39
+
40
+ return None
41
+
42
+
43
+ def random_point_in_polygon_at_distance(
44
+ polygon: Polygon,
45
+ origin_point: Point,
46
+ distance: int,
47
+ max_iterations: int = 100,
48
+ seed: int = None,
49
+ ) -> Point:
50
+ """Returns a random point inside a polygon, at a specified distance from the origin point"""
51
+ if seed:
52
+ random.seed(seed)
53
+
54
+ ctr = 0
55
+ while ctr < max_iterations:
56
+ ctr += 1
57
+ angle = random.uniform(0, 2 * math.pi)
58
+ x = origin_point.x + distance * math.cos(angle)
59
+ y = origin_point.y + distance * math.sin(angle)
60
+ point = Point(x, y)
61
+
62
+ if polygon.contains(point):
63
+ return point
64
+
65
+ return None
66
+
67
+
68
+ def wrapped_polygon_adjustment(polygon: Polygon) -> int:
69
+ if "MultiPolygon" == str(polygon.geom_type):
70
+ return 0
71
+
72
+ points = list(zip(*polygon.exterior.coords.xy))
73
+ prev = None
74
+
75
+ for ra, _ in points:
76
+ if prev is not None and prev > 20 and ra < 12:
77
+ return 24
78
+ elif prev is not None and prev < 12 and ra > 20:
79
+ return -24
80
+ prev = ra
81
+
82
+ return 0