starplot 0.16.4__py2.py3-none-any.whl → 0.17.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.
Files changed (37) hide show
  1. starplot/__init__.py +28 -2
  2. starplot/base.py +36 -56
  3. starplot/config.py +16 -0
  4. starplot/data/constellations.py +5 -676
  5. starplot/data/dsos.py +7 -23
  6. starplot/data/library/bigsky.0.4.0.stars.mag11.parquet +0 -0
  7. starplot/data/library/sky.db +0 -0
  8. starplot/data/stars.py +12 -2
  9. starplot/data/translations.py +161 -0
  10. starplot/geometry.py +7 -6
  11. starplot/horizon.py +9 -8
  12. starplot/map.py +1 -1
  13. starplot/models/__init__.py +19 -7
  14. starplot/models/base.py +1 -1
  15. starplot/models/comet.py +332 -0
  16. starplot/models/constellation.py +10 -0
  17. starplot/models/dso.py +24 -0
  18. starplot/{optics.py → models/optics.py} +4 -4
  19. starplot/models/satellite.py +158 -0
  20. starplot/models/star.py +10 -0
  21. starplot/optic.py +10 -9
  22. starplot/plotters/__init__.py +1 -0
  23. starplot/plotters/arrow.py +162 -0
  24. starplot/plotters/constellations.py +15 -51
  25. starplot/plotters/dsos.py +8 -14
  26. starplot/plotters/experimental.py +559 -6
  27. starplot/plotters/legend.py +5 -0
  28. starplot/plotters/stars.py +7 -16
  29. starplot/styles/base.py +20 -1
  30. starplot/styles/extensions.py +10 -1
  31. starplot/zenith.py +4 -1
  32. {starplot-0.16.4.dist-info → starplot-0.17.0.dist-info}/METADATA +19 -15
  33. {starplot-0.16.4.dist-info → starplot-0.17.0.dist-info}/RECORD +37 -33
  34. /starplot/{observer.py → models/observer.py} +0 -0
  35. {starplot-0.16.4.dist-info → starplot-0.17.0.dist-info}/WHEEL +0 -0
  36. {starplot-0.16.4.dist-info → starplot-0.17.0.dist-info}/entry_points.txt +0 -0
  37. {starplot-0.16.4.dist-info → starplot-0.17.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,676 +2,13 @@ from functools import cache
2
2
 
3
3
  from ibis import _, row_number
4
4
 
5
+ from starplot.config import settings
5
6
  from starplot.data import db
6
-
7
-
8
- """
9
- Dictionary of properties for each constellation
10
-
11
- Keys: Constellation's 3-letter IAU abbreviation
12
- Value: Tuple of full name (with newlines), right ascension (RA), and declination (DEC)
13
-
14
- The RA/DEC for each constellation is the initial position of the label (to avoid overlapping),
15
- but this position could change after adjusting all labels together before the final plot is saved.
16
- """
17
- properties = {
18
- "And": ("Andromeda", 0.93, 43.57),
19
- "Ant": ("Antlia", 10.57, -35.71),
20
- "Aps": ("Apus", 15.95, -78.42),
21
- "Aql": ("Aquila", 19.25, -0.5),
22
- "Aqr": ("Aquarius", 22.52, -8.17),
23
- "Ara": ("Ara", 17.34, -55.03),
24
- "Ari": ("Aries", 2.68, 22.56),
25
- "Aur": ("Auriga", 5.43, 41.15),
26
- "Boo": ("Bootes", 14.52, 35.68),
27
- "CMa": ("Canis Major", 6.95, -23.18),
28
- "CMi": ("Canis\nMinor", 7.86, 6.83),
29
- "CVn": ("Canes\nVenatici", 12.73, 36.42),
30
- "Cae": ("Caelum", 4.82, -38.16),
31
- "Cam": ("Camelopardalis", 5.13, 66.24),
32
- "Cap": ("Capricornus", 21.1, -19.05),
33
- "Car": ("Carina", 9.7, -61.11),
34
- "Cas": ("Cassiopeia", 0.37, 60.52),
35
- "Cen": ("Centaurus", 13.82, -45.72),
36
- "Cep": ("Cepheus", 21.92, 65.42),
37
- "Cet": ("Cetus", 2.01, -3.02),
38
- "Cha": ("Chamaeleon", 10.79, -78.72),
39
- "Cir": ("Circinus", 15.0, -61.89),
40
- "Cnc": ("Cancer", 8.68, 18.57),
41
- "Col": ("Columba", 5.92, -39.28),
42
- "Com": ("Coma\nBerenices", 13.08, 22.7),
43
- "CrA": ("Corona\nAustralis", 19.14, -38.7),
44
- "CrB": ("Corona\nBorealis", 16.35, 27.64),
45
- "Crt": ("Crater", 11.86, -14.29),
46
- "Cru": ("Crux", 12.62, -61.39),
47
- "Crv": ("Corvus", 12.38, -20.02),
48
- "Cyg": ("Cygnus", 20.52, 32.64),
49
- "Del": ("Delphinus", 20.67, 14.6),
50
- "Dor": ("Dorado", 5.19, -59.22),
51
- "Dra": ("Draco", 16.35, 63.07),
52
- "Equ": ("Equuleus", 21.25, 7.63),
53
- "Eri": ("Eridanus", 3.62, -24.61),
54
- "For": ("Fornax", 3.01, -30.7),
55
- "Gem": ("Gemini", 7.07, 23.87),
56
- "Gru": ("Grus", 22.36, -44.26),
57
- "Her": ("Hercules", 16.88, 34.86),
58
- "Hor": ("Horologium", 3.06, -51.99),
59
- "Hya": ("Hydra", 10.23, -9.93),
60
- "Hyi": ("Hydrus", 2.14, -70.43),
61
- "Ind": ("Indus", 21.11, -53.22),
62
- "LMi": ("Leo Minor", 10.3, 35.27),
63
- "Lac": ("Lacerta", 22.21, 41.4),
64
- "Leo": ("Leo", 10.93, 18.13),
65
- "Lep": ("Lepus", 5.61, -17.76),
66
- "Lib": ("Libra", 15.34, -18.19),
67
- "Lup": ("Lupus", 15.62, -43.57),
68
- "Lyn": ("Lynx", 7.12, 53.08),
69
- "Lyr": ("Lyra", 18.82, 30.63),
70
- "Men": ("Mensa", 6.17, -74.75),
71
- "Mic": ("Microscopium", 20.83, -33.78),
72
- "Mon": ("Monoceros", 6.81, 0.93),
73
- "Mus": ("Musca", 12.5, -69.27),
74
- "Nor": ("Norma", 16.24, -48.03),
75
- "Oct": ("Octans", 19.64, -80.81),
76
- "Oph": ("Ophiuchus", 17.42, -1.48),
77
- "Ori": ("Orion", 5.45, 7.13),
78
- "Pav": ("Pavo", 19.29, -65.19),
79
- "Peg": ("Pegasus", 22.93, 16.95),
80
- "Per": ("Perseus", 3.53, 45.68),
81
- "Phe": ("Phoenix", 0.87, -47.82),
82
- "Pic": ("Pictor", 6.32, -59.05),
83
- "PsA": ("Piscis Austrinus", 22.46, -31.42),
84
- "Psc": ("Pisces", 1.28, 12.56),
85
- "Pup": ("Puppis", 7.68, -32.69),
86
- "Pyx": ("Pyxis", 8.48, -36.17),
87
- "Ret": ("Reticulum", 4.06, -62.0),
88
- "Scl": ("Sculptor", 0.33, -32.01),
89
- "Sco": ("Scorpius", 16.9, -33.55),
90
- "Sct": ("Scutum", 18.54, -12.35),
91
- "Ser1": ("Serpens\nCaput", 16.45, 3.59),
92
- "Ser2": ("Serpens\nCauda", 18.2, -7.29),
93
- "Sex": ("Sextans", 10.55, -4.24),
94
- "Sge": ("Sagitta", 19.74, 14.92),
95
- "Sgr": ("Sagittarius", 18.81, -26.05),
96
- "Tau": ("Taurus", 4.31, 15.24),
97
- "Tel": ("Telescopium", 18.32, -45.96),
98
- "TrA": ("Triangulum Australe", 15.91, -66.86),
99
- "Tri": ("Triangulum", 2.11, 32.8),
100
- "Tuc": ("Tucana", 23.84, -64.81),
101
- "UMa": ("Ursa Major", 10.87, 51.95),
102
- "UMi": ("Ursa Minor", 16.25, 83.28),
103
- "Vel": ("Vela", 9.49, -48.38),
104
- "Vir": ("Virgo", 13.67, 1.02),
105
- "Vol": ("Volans", 8.01, -67.92),
106
- "Vul": ("Vulpecula", 20.13, 22.21),
107
- }
108
- CONSTELLATIONS = {k.lower(): v for k, v in properties.items()}
109
-
110
- CONSTELLATIONS_FULL_NAMES = {k.lower(): v[0].upper() for k, v in properties.items()}
111
- """Constellation full names"""
112
-
113
- CONSTELLATIONS_ABBREVIATIONS = {k.lower(): k.upper() for k in properties.keys()}
114
- """Constellation 3-letter abbreviations"""
115
-
116
- CONSTELLATION_HIP_IDS = {
117
- "and": {
118
- 2912,
119
- 1473,
120
- 7607,
121
- 677,
122
- 116805,
123
- 5447,
124
- 9640,
125
- 3881,
126
- 116584,
127
- 3693,
128
- 4463,
129
- 3031,
130
- 3092,
131
- 4436,
132
- 116631,
133
- 5434,
134
- 113726,
135
- },
136
- "ant": {46515, 51172, 53502},
137
- "aps": {81065, 72370, 81852, 80047},
138
- "aql": {
139
- 97804,
140
- 95501,
141
- 93805,
142
- 97649,
143
- 99473,
144
- 93747,
145
- 98036,
146
- 96468,
147
- 93429,
148
- 93244,
149
- 97278,
150
- },
151
- "aqr": {
152
- 112961,
153
- 114724,
154
- 114341,
155
- 106278,
156
- 111497,
157
- 112716,
158
- 115438,
159
- 110960,
160
- 110672,
161
- 109074,
162
- 109139,
163
- 110003,
164
- 113136,
165
- 115033,
166
- 102618,
167
- 110395,
168
- },
169
- "ara": {85792, 83081, 88714, 85258, 83153, 85267, 82363, 85727},
170
- "ari": {8832, 13209, 9884, 8903},
171
- "aur": {24608, 28358, 23015, 28360, 25428, 23767, 23416, 28380, 23453},
172
- "boo": {
173
- 70497,
174
- 71075,
175
- 69732,
176
- 69673,
177
- 74666,
178
- 72105,
179
- 69483,
180
- 71053,
181
- 67275,
182
- 73555,
183
- 71795,
184
- 67927,
185
- },
186
- "cae": {21770, 23595, 21060, 21861},
187
- "cam": {23040, 23522, 16228, 17959, 29997, 17884, 33694, 22783},
188
- "cap": {100064, 102978, 106723, 107556, 106985, 105881, 104139, 102485, 100345},
189
- "car": {
190
- 54463,
191
- 42913,
192
- 52419,
193
- 50371,
194
- 53253,
195
- 30438,
196
- 38827,
197
- 41037,
198
- 39953,
199
- 50099,
200
- 45556,
201
- 45238,
202
- 51576,
203
- 54301,
204
- 54751,
205
- },
206
- "cas": {746, 3179, 4427, 8886, 6686},
207
- "cen": {
208
- 55425,
209
- 71683,
210
- 67464,
211
- 65936,
212
- 68245,
213
- 60823,
214
- 68002,
215
- 56243,
216
- 71352,
217
- 59449,
218
- 68282,
219
- 59196,
220
- 68933,
221
- 70090,
222
- 65109,
223
- 61789,
224
- 68702,
225
- 66657,
226
- 61932,
227
- 73334,
228
- 68862,
229
- },
230
- "cep": {
231
- 109857,
232
- 101093,
233
- 105199,
234
- 106032,
235
- 110991,
236
- 112724,
237
- 109492,
238
- 102422,
239
- 116727,
240
- 107259,
241
- },
242
- "cet": {
243
- 13954,
244
- 12706,
245
- 12387,
246
- 8645,
247
- 8102,
248
- 6537,
249
- 10826,
250
- 5364,
251
- 14135,
252
- 1562,
253
- 3419,
254
- 11484,
255
- 12828,
256
- },
257
- "cha": {60000, 58484, 52633, 40702, 51839},
258
- "cir": {74824, 75323, 71908},
259
- "cma": {33152, 35904, 33347, 31592, 33160, 33579, 34444, 30324, 34045, 32349},
260
- "cmi": {36188, 37279},
261
- "cnc": {44066, 40526, 42806, 42911, 43103},
262
- "col": {25859, 30277, 28199, 28328, 26634, 27628},
263
- "com": {64241, 64394, 60742},
264
- "cra": {93825, 94114, 90982, 94160, 94005},
265
- "crb": {77512, 76267, 75695, 78159, 76952, 78493, 76127},
266
- "crt": {57283, 55687, 56633, 53740, 58188, 55282, 55705, 54682},
267
- "cru": {62434, 59747, 61084, 60718},
268
- "crv": {60965, 61359, 59316, 59803, 59199},
269
- "cvn": {63125, 61317},
270
- "cyg": {100453, 99848, 95947, 97165, 95853, 102098, 103413, 102488, 94779, 104732},
271
- "del": {102532, 101958, 101769, 102281, 101421},
272
- "dor": {21281, 23693, 27890, 26069, 19893, 27100},
273
- "dra": {
274
- 61281,
275
- 75458,
276
- 87585,
277
- 97433,
278
- 85829,
279
- 85670,
280
- 94376,
281
- 80331,
282
- 89937,
283
- 56211,
284
- 68756,
285
- 89908,
286
- 83895,
287
- 87833,
288
- 78527,
289
- },
290
- "equ": {104521, 104858, 104987},
291
- "eri": {
292
- 21248,
293
- 19587,
294
- 13701,
295
- 11407,
296
- 21393,
297
- 15510,
298
- 13847,
299
- 16537,
300
- 7588,
301
- 18216,
302
- 12843,
303
- 9007,
304
- 20535,
305
- 17593,
306
- 14146,
307
- 23875,
308
- 21444,
309
- 12486,
310
- 20042,
311
- 17874,
312
- 22109,
313
- 17378,
314
- 12770,
315
- 16611,
316
- 16870,
317
- 18543,
318
- 18673,
319
- 15474,
320
- 17651,
321
- 12413,
322
- },
323
- "for": {13147, 9677, 14879},
324
- "gem": {
325
- 31681,
326
- 36962,
327
- 37826,
328
- 30883,
329
- 34693,
330
- 30343,
331
- 34088,
332
- 32362,
333
- 37740,
334
- 36046,
335
- 29655,
336
- 36850,
337
- 35350,
338
- 32246,
339
- 28734,
340
- 33018,
341
- 35550,
342
- },
343
- "gru": {113638, 112623, 109268, 108085, 110997, 109111, 112122},
344
- "her": {
345
- 87808,
346
- 83207,
347
- 86414,
348
- 84379,
349
- 84380,
350
- 81693,
351
- 81833,
352
- 80170,
353
- 87933,
354
- 80816,
355
- 85112,
356
- 85693,
357
- 86974,
358
- 77760,
359
- 80463,
360
- 88794,
361
- 81126,
362
- 81008,
363
- 79992,
364
- 84345,
365
- 79101,
366
- },
367
- "hor": {14240, 12225, 19747, 12484, 12653, 13884},
368
- "hya": {
369
- 56343,
370
- 45336,
371
- 54682,
372
- 68895,
373
- 42402,
374
- 43813,
375
- 42799,
376
- 49841,
377
- 46390,
378
- 64962,
379
- 47431,
380
- 42313,
381
- 52943,
382
- 57936,
383
- 43234,
384
- 48356,
385
- 43109,
386
- 53740,
387
- 49402,
388
- 72571,
389
- 51069,
390
- },
391
- "hyi": {11001, 9236, 2021, 17678},
392
- "ind": {105319, 101772, 108431, 103227, 102333},
393
- "lac": {111104, 111169, 111944, 110538, 111022, 110351, 110609, 109937, 109754},
394
- "leo": {
395
- 57632,
396
- 46146,
397
- 47908,
398
- 49669,
399
- 48455,
400
- 55434,
401
- 54879,
402
- 49583,
403
- 50583,
404
- 54872,
405
- 55642,
406
- 46750,
407
- 50335,
408
- },
409
- "lep": {
410
- 27072,
411
- 25985,
412
- 23685,
413
- 25606,
414
- 27654,
415
- 28103,
416
- 24327,
417
- 24845,
418
- 28910,
419
- 24305,
420
- 27288,
421
- },
422
- "lib": {74785, 76333, 72622, 73714, 76470, 76600},
423
- "lmi": {51233, 46952, 53229, 51056, 49593},
424
- "lup": {75264, 77634, 75141, 76297, 75177, 78384, 71860, 73273, 74395},
425
- "lyn": {45860, 33449, 30060, 36145, 41075, 45688, 44700, 44248},
426
- "lyr": {91971, 92420, 93194, 91919, 92791, 91262},
427
- "men": {23467, 29271},
428
- "mic": {103738, 105140, 105382, 102831},
429
- "mon": {32578, 37447, 31978, 31216, 34769, 30419, 30867, 29651, 39863},
430
- "mus": {61199, 61585, 62322, 57363, 59929, 63613},
431
- "nor": {80000, 78914, 80582, 78639},
432
- "oct": {107089, 112405, 70638},
433
- "oph": {
434
- 81377,
435
- 87108,
436
- 79593,
437
- 79882,
438
- 84970,
439
- 84012,
440
- 85423,
441
- 86032,
442
- 88048,
443
- 80473,
444
- 80883,
445
- 80628,
446
- 86742,
447
- 80343,
448
- 83000,
449
- 80569,
450
- 80894,
451
- },
452
- "ori": {
453
- 27913,
454
- 22797,
455
- 22549,
456
- 28716,
457
- 22957,
458
- 22449,
459
- 23607,
460
- 22845,
461
- 25281,
462
- 28614,
463
- 26311,
464
- 25930,
465
- 23123,
466
- 27989,
467
- 26207,
468
- 27366,
469
- 26727,
470
- 22509,
471
- 29038,
472
- 29426,
473
- 24436,
474
- 25336,
475
- },
476
- "pav": {
477
- 92609,
478
- 105858,
479
- 88866,
480
- 99240,
481
- 100751,
482
- 91792,
483
- 86929,
484
- 90098,
485
- 93015,
486
- 102395,
487
- 98495,
488
- },
489
- "peg": {
490
- 109410,
491
- 677,
492
- 113963,
493
- 112748,
494
- 109176,
495
- 1067,
496
- 107315,
497
- 109427,
498
- 112440,
499
- 113881,
500
- 107354,
501
- 112029,
502
- 112158,
503
- },
504
- "per": {
505
- 8068,
506
- 19343,
507
- 14354,
508
- 17448,
509
- 14632,
510
- 18614,
511
- 18246,
512
- 14668,
513
- 17358,
514
- 13268,
515
- 13531,
516
- 19167,
517
- 18532,
518
- 19812,
519
- 20070,
520
- 12777,
521
- 14576,
522
- 15863,
523
- 14328,
524
- },
525
- "phe": {2081, 5348, 7083, 5165, 6867, 765},
526
- "pic": {27321, 27530, 32607},
527
- "psa": {109285, 111954, 112948, 111188, 107380, 113368, 107608, 113246},
528
- "psc": {
529
- 116928,
530
- 116771,
531
- 8198,
532
- 4906,
533
- 3786,
534
- 7884,
535
- 5742,
536
- 9487,
537
- 6193,
538
- 5586,
539
- 115830,
540
- 7097,
541
- 115738,
542
- 114971,
543
- 118268,
544
- },
545
- "pup": {
546
- 35264,
547
- 39429,
548
- 31685,
549
- 30438,
550
- 39757,
551
- 37229,
552
- 37677,
553
- 39953,
554
- 36917,
555
- 38070,
556
- 38170,
557
- },
558
- "pyx": {43409, 42515, 42828, 39429},
559
- "ret": {17440, 19921, 19780, 18597},
560
- "scl": {4577, 117452, 115102, 116231},
561
- "sco": {
562
- 85696,
563
- 78401,
564
- 87073,
565
- 78820,
566
- 85927,
567
- 82729,
568
- 86670,
569
- 84143,
570
- 80112,
571
- 79374,
572
- 81266,
573
- 82514,
574
- 86228,
575
- 78104,
576
- 78265,
577
- 80763,
578
- 82396,
579
- 87261,
580
- },
581
- "sct": {90595, 91117, 91726, 92175},
582
- "ser1": {
583
- 77450,
584
- 77516,
585
- 77070,
586
- 77233,
587
- 76852,
588
- 76276,
589
- 77622,
590
- 78072,
591
- },
592
- "ser2": {86263, 89962, 88048, 92946},
593
- "sex": {51437, 49641, 51362, 48437},
594
- "sge": {98337, 96837, 96757, 97365},
595
- "sgr": {
596
- 90496,
597
- 95168,
598
- 93506,
599
- 93864,
600
- 90185,
601
- 92041,
602
- 89931,
603
- 89642,
604
- 93085,
605
- 93683,
606
- 92855,
607
- 89341,
608
- 88635,
609
- 94141,
610
- },
611
- "tau": {
612
- 18724,
613
- 20455,
614
- 20205,
615
- 21421,
616
- 26451,
617
- 16083,
618
- 25428,
619
- 16852,
620
- 20889,
621
- 18907,
622
- 15900,
623
- 20894,
624
- },
625
- "tel": {89112, 90422, 90568},
626
- "tra": {77952, 82273, 74946, 76440},
627
- "tri": {10064, 8796, 10670},
628
- "tuc": {110130, 118322, 2484, 114996, 110838, 1599},
629
- "uma": {
630
- 46853,
631
- 54539,
632
- 46733,
633
- 58001,
634
- 53910,
635
- 55203,
636
- 54061,
637
- 55219,
638
- 44471,
639
- 57399,
640
- 48319,
641
- 50372,
642
- 44127,
643
- 65378,
644
- 67301,
645
- 41704,
646
- 62956,
647
- 50801,
648
- 59774,
649
- },
650
- "umi": {82080, 79822, 11767, 72607, 75097, 85822, 77055},
651
- "vel": {42913, 48774, 50191, 44816, 39953, 45941, 52727, 46651},
652
- "vir": {
653
- 60129,
654
- 65474,
655
- 58948,
656
- 57380,
657
- 69701,
658
- 68520,
659
- 66249,
660
- 64238,
661
- 63090,
662
- 61941,
663
- 71957,
664
- 63608,
665
- 72220,
666
- 57757,
667
- },
668
- "vol": {41312, 34481, 39794, 35228, 44382},
669
- "vul": {95771, 97886},
670
- }
7
+ from starplot.data.translations import language_name_column
671
8
 
672
9
 
673
10
  @cache
674
- def table():
11
+ def table(language):
675
12
  con = db.connect()
676
13
  c = con.table("constellations")
677
14
 
@@ -680,6 +17,7 @@ def table():
680
17
  dec=_.center_dec,
681
18
  constellation_id=_.iau_id,
682
19
  boundary=_.geometry,
20
+ name=getattr(c, language_name_column(language)),
683
21
  rowid=row_number(),
684
22
  sk=row_number(),
685
23
  )
@@ -687,7 +25,7 @@ def table():
687
25
 
688
26
  def load(extent=None, filters=None, sql=None):
689
27
  filters = filters or []
690
- c = table()
28
+ c = table(language=settings.language)
691
29
 
692
30
  if extent:
693
31
  filters.append(_.geometry.intersects(extent))
@@ -722,12 +60,3 @@ def load_borders(extent=None, filters=None):
722
60
  return c.filter(*filters)
723
61
 
724
62
  return c
725
-
726
-
727
- def get(constellation_id: str):
728
- return CONSTELLATIONS.get(constellation_id)
729
-
730
-
731
- def iterator():
732
- for c in CONSTELLATIONS.keys():
733
- yield c