-
Notifications
You must be signed in to change notification settings - Fork 11
/
graphchart2.py
executable file
·1716 lines (1406 loc) · 62.5 KB
/
graphchart2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import wx
import Image, ImageDraw, ImageFont
import math
import astrology
import chart, houses, planets, fortune
import fixstars
import options
import common
import util
import mtexts
class GraphChart2:
DEG1 = math.pi/180
DEG5 = math.pi/36
DEG10 = math.pi/18
DEG30 = math.pi/6
SMALL_SIZE = 400
MEDIUM_SIZE = 600
def __init__(self, chrt, size, opts, bw, planetaryday=True, chrt2 = None):
self.chart = chrt
self.chart2 = chrt2
self.w, self.h = size
self.options = opts
self.bw = bw
self.planetaryday = planetaryday
self.buffer = wx.EmptyBitmap(self.w, self.h)
self.bdc = wx.BufferedDC(None, self.buffer)
self.chartsize = min(self.w, self.h)
self.maxradius = self.chartsize/2
self.center = wx.Point(self.w/2, self.h/2)
baseoffset = 0.0
val = 0
if self.options.showdecans:
val += 1
if self.options.showterms:
val += 1
if (self.planetaryday and self.options.showfixstars != options.Options.NONE) or self.chart2 != None:
val += 1
if self.options.positions:
if val == 1:
baseoffset = self.maxradius*0.02
elif val == 2:
baseoffset = self.maxradius*0.08
elif val == 3:
baseoffset = self.maxradius*0.12
elif val == 3:
baseoffset = self.maxradius*0.05
self.arrowlen = 0.04
self.deg01510len = 0.01
self.retrdiff = 0.01
if self.chart2 == None:
if self.planetaryday and self.options.showfixstars != options.Options.NONE: #If planetaryday is True => radix chart
self.symbolSize = self.maxradius/16
self.signSize = self.maxradius/20
self.planetsectorlen = 0.15
self.signsectorlen = self.planetsectorlen
self.signoffs = (self.signsectorlen/2.0)*self.maxradius
self.planetoffs = (self.planetsectorlen/2.0)*self.maxradius
self.planetlinelen = 0.03
self.rHousesectorlen = 0.06
self.rAntis = self.maxradius*0.90
self.rAntisLines = self.maxradius*0.86
self.rFixstars = self.maxradius*0.88#84
self.r30 = self.maxradius*0.83
self.rOuterLine = self.maxradius*0.86
self.rOuter0 = self.r30
self.rOuter1 = self.rOuter0-self.deg01510len*self.maxradius
self.rOuter5 = self.rOuter1-self.deg01510len*self.maxradius
self.rOuter10 = self.rOuter5-self.deg01510len*self.maxradius
self.rOuterMin = self.maxradius*0.82
self.rSign = self.r30-self.signoffs
self.r0 = self.r30-self.signsectorlen*self.maxradius
self.r1 = self.r0+self.deg01510len*self.maxradius
self.r5 = self.r1+self.deg01510len*self.maxradius
self.r10 = self.r5+self.deg01510len*self.maxradius
self.rASCMC = self.rSign
self.rArrow = self.rASCMC+self.arrowlen*self.maxradius
self.rTerms = self.r0
self.termssectorlen = 0.0
if self.options.showterms:
self.termssectorlen = 0.08
self.termsoffs = (self.termssectorlen/2.0)*self.maxradius
self.rTermsPlanet = self.r0-self.termsoffs#
self.rDecans = self.rTerms-self.termssectorlen*self.maxradius
self.decanssectorlen = 0.0
if self.options.showdecans:
self.decanssectorlen = 0.08
self.decansoffs = (self.decanssectorlen/2.0)*self.maxradius
self.rInner = self.rDecans-self.decanssectorlen*self.maxradius
self.rDecansPlanet = self.rInner+self.decansoffs#
self.rLLine = self.rInner-self.planetlinelen*self.maxradius #line between zodiacpos & planet
self.rPlanet = self.rInner-self.planetoffs
self.rPosDeg = self.rInner-self.planetsectorlen*self.maxradius
self.rPosMin = self.rPosDeg-0.04*self.maxradius
self.rRetr = self.rPosMin-0.05*self.maxradius
posascmc = 0.36
poshouses = 0.36
if self.options.showdecans and self.options.showterms:
posascmc = 0.24
poshouses = 0.24
elif self.options.showdecans or self.options.showterms:
posascmc = 0.30
poshouses = 0.30
self.rPosAscMC = self.maxradius*posascmc
self.rPosAscMCMin = self.rPosAscMC-self.maxradius*0.05
self.rPosHouses = self.maxradius*poshouses
self.rPosHousesMin = self.rPosHouses-self.maxradius*0.05
self.rBase = self.maxradius*0.24-baseoffset
self.rHouse = self.rBase+self.rHousesectorlen*self.maxradius
self.rHouseName = self.maxradius*0.27-baseoffset
else:
self.symbolSize = self.maxradius/12
self.signSize = self.maxradius/12
self.signsectorlen = 0.16
self.planetsectorlen = 0.18
self.planetoffs = (self.planetsectorlen/2.0)*self.maxradius
self.planetlinelen = 0.03
self.rHousesectorlen = 0.08
self.r30 = self.maxradius*0.96
self.signoffs = (self.signsectorlen/2.0-0.01)*self.maxradius
self.rSign = self.r30-self.signoffs
self.rASCMC = self.maxradius*0.88
self.rArrow = self.rASCMC+self.arrowlen*self.maxradius
self.r0 = self.r30-self.signsectorlen*self.maxradius
self.r1 = self.r0+self.deg01510len*self.maxradius
self.r5 = self.r1+self.deg01510len*self.maxradius
self.r10 = self.r5+self.deg01510len*self.maxradius
self.rTerms = self.r0
self.termssectorlen = 0.0
if self.options.showterms:
self.termssectorlen = 0.08
self.termsoffs = (self.termssectorlen/2.0)*self.maxradius
self.rTermsPlanet = self.r0-self.termsoffs#
self.rDecans = self.rTerms-self.termssectorlen*self.maxradius
self.decanssectorlen = 0.0
if self.options.showdecans:
self.decanssectorlen = 0.08
self.decansoffs = (self.decanssectorlen/2.0)*self.maxradius
self.rInner = self.rDecans-self.decanssectorlen*self.maxradius
self.rDecansPlanet = self.rInner+self.decansoffs#
self.rLLine = self.rInner-self.planetlinelen*self.maxradius #line between zodiacpos & planet
self.rPlanet = self.rInner-self.planetoffs
self.rPosDeg = self.rInner-self.planetsectorlen*self.maxradius
self.rPosMin = self.rPosDeg-0.05*self.maxradius
self.rRetr = self.rPosMin-0.05*self.maxradius
posascmc = 0.42
poshouses = 0.42
if self.options.showdecans and self.options.showterms:
posascmc = 0.30
poshouses = 0.30
elif self.options.showdecans or self.options.showterms:
posascmc = 0.38
poshouses = 0.38
self.rPosAscMC = self.maxradius*posascmc
self.rPosAscMCMin = self.rPosAscMC-self.maxradius*0.05
self.rPosHouses = self.maxradius*poshouses
self.rPosHousesMin = self.rPosHouses-self.maxradius*0.05
self.rBase = self.maxradius*0.24-baseoffset
self.rHouse = self.rBase+self.rHousesectorlen*self.maxradius
self.rHouseName = self.rBase+(self.rHousesectorlen*self.maxradius)/2.0
else:
self.symbolSize = self.maxradius/16
self.signSize = self.maxradius/20
self.outerplanetsectorlen = 0.12
self.planetsectorlen = 0.15
self.signsectorlen = self.planetsectorlen
self.signoffs = (self.signsectorlen/2.0)*self.maxradius
self.planetoffs = (self.planetsectorlen/2.0)*self.maxradius
self.planetlinelen = 0.03
self.rHousesectorlen = 0.06
self.rOuterMax = self.maxradius*0.97
if self.options.houses:
self.rOuterHouseName = self.rOuterMax-(self.rHousesectorlen*self.maxradius)/2.0
self.rOuterHouse = self.rOuterMax-self.rHousesectorlen*self.maxradius
self.r30 = self.rOuterHouse-self.outerplanetsectorlen*self.maxradius
else:
self.r30 = self.rOuterMax-self.outerplanetsectorlen*self.maxradius
self.rOuterASCMC = self.maxradius*0.92
self.rOuterPlanet = self.r30+self.planetoffs
self.rOuterASCMC = self.maxradius*0.92
self.rOuterArrow = self.rOuterASCMC+self.arrowlen*self.maxradius
self.rOuterLine = self.r30+self.planetlinelen*self.maxradius
self.rOuterRetr = self.rOuterLine+self.maxradius*self.retrdiff
self.rOuter0 = self.r30
self.rOuter1 = self.rOuter0-self.deg01510len*self.maxradius
self.rOuter5 = self.rOuter1-self.deg01510len*self.maxradius
self.rOuter10 = self.rOuter5-self.deg01510len*self.maxradius
self.rOuterMin = self.maxradius*0.78
self.rSign = self.r30-self.signoffs
self.r0 = self.r30-self.signsectorlen*self.maxradius
self.r1 = self.r0+self.deg01510len*self.maxradius
self.r5 = self.r1+self.deg01510len*self.maxradius
self.r10 = self.r5+self.deg01510len*self.maxradius
self.rASCMC = self.rSign
self.rArrow = self.rASCMC+self.arrowlen*self.maxradius
self.rTerms = self.r0
self.termssectorlen = 0.0
if self.options.showterms:
self.termssectorlen = 0.08
self.termsoffs = (self.termssectorlen/2.0)*self.maxradius
self.rTermsPlanet = self.r0-self.termsoffs#
self.rDecans = self.rTerms-self.termssectorlen*self.maxradius
self.decanssectorlen = 0.0
if self.options.showdecans:
self.decanssectorlen = 0.08
self.decansoffs = (self.decanssectorlen/2.0)*self.maxradius
self.rInner = self.rDecans-self.decanssectorlen*self.maxradius
self.rDecansPlanet = self.rInner+self.decansoffs#
self.rLLine = self.rInner-self.planetlinelen*self.maxradius #line between zodiacpos & planet
self.rPlanet = self.rInner-self.planetoffs
self.rPosDeg = self.rInner-self.planetsectorlen*self.maxradius
self.rPosMin = self.rPosDeg-0.05*self.maxradius
self.rRetr = self.rPosMin-0.05*self.maxradius
posascmc = 0.34
poshouses = 0.34
if self.options.showdecans and self.options.showterms:
posascmc = 0.20
poshouses = 0.20
elif self.options.showdecans or self.options.showterms:
posascmc = 0.26
poshouses = 0.26
self.rPosAscMC = self.maxradius*posascmc
self.rPosAscMCMin = self.rPosAscMC-self.maxradius*0.05
self.rPosHouses = self.maxradius*poshouses
self.rPosHousesMin = self.rPosHouses-self.maxradius*0.05
self.rBase = self.maxradius*0.24-baseoffset
self.rHouse = self.rBase+self.rHousesectorlen*self.maxradius
self.rHouseName = self.maxradius*0.27-baseoffset
self.smallsymbolSize = 2*self.symbolSize/3
self.fntMorinus = ImageFont.truetype(common.common.symbols, self.symbolSize)
self.fntSmallMorinus = ImageFont.truetype(common.common.symbols, self.smallsymbolSize)
self.fntMorinusSigns = ImageFont.truetype(common.common.symbols, self.signSize)
self.fntText = ImageFont.truetype(common.common.abc, self.symbolSize/2)
self.fntAntisText = ImageFont.truetype(common.common.abc, self.symbolSize)
self.fntSmallText = ImageFont.truetype(common.common.abc, self.symbolSize/2)
self.fntRetr = ImageFont.truetype(common.common.symbols, self.symbolSize/2)
self.fntSmallText2 = ImageFont.truetype(common.common.abc, self.symbolSize/3)
self.fntSmallTextOuter = ImageFont.truetype(common.common.abc, self.symbolSize/4)
self.fntBigText = ImageFont.truetype(common.common.abc, self.symbolSize/4*3)
self.fntMorinus2 = ImageFont.truetype(common.common.symbols, self.symbolSize/4*3)
self.deg_symbol = u'\u00b0'
self.arsigndiff = (0, -1, -1, 2, -1, 3, 4, -1, -1, -1, 6)
self.hsystem = {'P':mtexts.txts['HSPlacidus'], 'K':mtexts.txts['HSKoch'], 'R':mtexts.txts['HSRegiomontanus'], 'C':mtexts.txts['HSCampanus'], 'E':mtexts.txts['HSEqual'], 'W':mtexts.txts['HSWholeSign'], 'X':mtexts.txts['HSAxial'], 'M':mtexts.txts['HSMorinus'], 'H':mtexts.txts['HSHorizontal'], 'T':mtexts.txts['HSPagePolich'], 'B':mtexts.txts['HSAlcabitus'], 'O':mtexts.txts['HSPorphyrius']}
self.ayans = {0:mtexts.txts['None'], 1:mtexts.txts['FaganBradley'], 2:mtexts.txts['Lahiri'], 3:mtexts.txts['Deluce'], 4:mtexts.txts['Raman'], 5:mtexts.txts['Ushashashi'], 6:mtexts.txts['Krishnamurti'], 7:mtexts.txts['DjwhalKhul'], 8:mtexts.txts['Yukteshwar'], 9:mtexts.txts['JNBhasin'], 10:mtexts.txts['BabylonianKuglerI2'], 11:mtexts.txts['BabylonianKuglerII2'], 12:mtexts.txts['BabylonianKuglerIII2'], 13:mtexts.txts['BabylonianHuber2'], 14:mtexts.txts['BabylonianMercier2'], 15:mtexts.txts['Aldebaran15Tau2'], 16:mtexts.txts['Hipparchos'], 17:mtexts.txts['Sassanian'], 18:mtexts.txts['GalacticCenter0Sag2'], 19:mtexts.txts['J2000'], 20:mtexts.txts['J1900'], 21:mtexts.txts['B1950']}
def drawChart(self):
# PIL can draw only 1-width ellipse (or is there a width=...?)
self.drawCircles()
if self.options.showterms:
self.drawTermsLines()
if self.options.showdecans:
self.drawDecansLines()
if self.options.houses:
self.drawHouses(self.chart.houses, self.rBase, self.rInner)
if self.chart2 != None:
self.drawHouses(self.chart2.houses, self.r30, self.rOuterMax)
#Convert to PIL (truetype-font is not supported in wxPython)
wxImag = self.buffer.ConvertToImage()
self.img = Image.new('RGB', (wxImag.GetWidth(), wxImag.GetHeight()))
self.img.fromstring(wxImag.GetData())
self.draw = ImageDraw.Draw(self.img)
if self.options.houses:
self.drawHouseNames(self.chart, self.rHouseName)
if self.chart2 != None:
self.drawHouseNames(self.chart2, self.rOuterHouseName)
self.drawSigns()
#Convert back from PIL
wxImg = wx.EmptyImage(self.img.size[0], self.img.size[1])
wxImg.SetData(self.img.tostring())
self.buffer = wx.BitmapFromImage(wxImg)
self.bdc = wx.BufferedDC(None, self.buffer)
self.drawAscMC(self.chart.houses.ascmc, self.rBase, self.rASCMC, self.rArrow)
if self.chart2 != None:
self.drawAscMC(self.chart2.houses.ascmc, self.rOuterMin, self.rOuterASCMC, self.rOuterArrow)
#calc shift of planets (in order to avoid overlapping)
self.pshift = self.arrange(self.chart.planets.planets, self.chart.fortune.fortune, self.rPlanet)
#PIL doesn't want to show short lines
self.drawPlanetLines(self.pshift, self.chart.planets.planets, self.chart.fortune.fortune, self.rInner, self.rLLine)
if self.chart2 != None:
self.pshift2 = self.arrange(self.chart2.planets.planets, self.chart2.fortune.fortune, self.rOuterPlanet)
self.drawPlanetLines(self.pshift2, self.chart2.planets.planets, self.chart2.fortune.fortune, self.r30, self.rOuterLine)
if self.chart2 == None and self.planetaryday and self.options.showfixstars != options.Options.NONE: #If planetaryday is True => radix chart
if self.options.showfixstars == options.Options.FIXSTARS:
self.showfss = self.mergefsaspmatrices()
self.fsshift = self.arrangefs(self.chart.fixstars.data, self.showfss, self.rFixstars)
self.fsyoffs = self.arrangeyfs(self.chart.fixstars.data, self.fsshift, self.showfss, self.rFixstars)
#PIL doesn't want to show short lines
self.drawFixstarsLines(self.showfss)
elif self.options.showfixstars == options.Options.ANTIS:
self.pshiftantis = self.arrangeAntis(self.chart.antiscia.plantiscia, self.chart.antiscia.lofant, self.chart.antiscia.ascmcant, self.rAntis)
self.drawAntisLines(self.chart.antiscia.plantiscia, self.chart.antiscia.lofant, self.chart.antiscia.ascmcant, self.pshiftantis, self.r30, self.rAntisLines)
elif self.options.showfixstars == options.Options.CANTIS:
self.pshiftantis = self.arrangeAntis(self.chart.antiscia.plcontraant, self.chart.antiscia.lofcontraant, self.chart.antiscia.ascmccontraant, self.rAntis)
self.drawAntisLines(self.chart.antiscia.plcontraant, self.chart.antiscia.lofcontraant, self.chart.antiscia.ascmccontraant, self.pshiftantis, self.r30, self.rAntisLines)
#Convert to PIL (truetype-font is not supported in wxPython)
wxImag = self.buffer.ConvertToImage()
self.img = Image.new('RGB', (wxImag.GetWidth(), wxImag.GetHeight()))
self.img.fromstring(wxImag.GetData())
self.draw = ImageDraw.Draw(self.img)
self.drawPlanets(self.chart, self.pshift, self.rPlanet, self.rRetr)
if self.chart2 != None:
self.drawPlanets(self.chart2, self.pshift2, self.rOuterPlanet, self.rOuterRetr, True)
if self.options.showterms:
self.drawTerms()
if self.options.showdecans:
self.drawDecans()
if self.options.positions:
self.drawAscMCPos()
if self.options.houses:
self.drawHousePos()
if self.options.planetarydayhour and self.planetaryday:
self.drawPlanetaryDayAndHour()
if self.options.housesystem and self.planetaryday:
self.drawHousesystemName()
if self.chart2 == None and self.planetaryday and self.options.showfixstars != options.Options.NONE: #If planetaryday is True => radix chart
if self.options.showfixstars == options.Options.FIXSTARS:
self.drawFixstars(self.showfss)
elif self.options.showfixstars == options.Options.ANTIS:
self.drawAntis(self.chart, self.chart.antiscia.plantiscia, self.chart.antiscia.lofant, self.chart.antiscia.ascmcant, self.pshiftantis, self.rAntis)
elif self.options.showfixstars == options.Options.CANTIS:
self.drawAntis(self.chart, self.chart.antiscia.plcontraant, self.chart.antiscia.lofcontraant, self.chart.antiscia.ascmccontraant, self.pshiftantis, self.rAntis)
wxImg = wx.EmptyImage(self.img.size[0], self.img.size[1])
wxImg.SetData(self.img.tostring())
self.buffer = wx.BitmapFromImage(wxImg)
return self.buffer
def drawCircles(self):
bkgclr = self.options.clrbackground
if self.bw:
bkgclr = (255,255,255)
self.bdc.SetBackground(wx.Brush(bkgclr))
self.bdc.Clear()
self.bdc.BeginDrawing()
self.bdc.SetBrush(wx.Brush(bkgclr))
(cx, cy) = self.center.Get()
#rOuterMax and rOuterHouse (for outer housenames)
if self.chart2 != None and self.options.houses:
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.rOuterMax)
self.bdc.DrawCircle(cx, cy, self.rOuterHouse)
if self.chart2 == None:
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.r30)
#r30 circle
if self.chart2 != None or (self.planetaryday and self.options.showfixstars != options.Options.NONE): #If planetaryday is True => radix chart
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
w = 3
if self.chartsize <= GraphChart2.SMALL_SIZE:
w = 1
elif self.chartsize <= GraphChart2.MEDIUM_SIZE:
w = 2
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.r30)
#Outer 10, 5, 1-circle
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.rOuter10)
#r10 Circle
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.r10)
#r0 Circle
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
if self.options.showterms or self.options.showdecans:
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.r0)
#Decans Circle
if self.options.showterms:
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.rDecans)
w = 3
if self.chartsize <= GraphChart2.SMALL_SIZE:
w = 1
elif self.chartsize <= GraphChart2.MEDIUM_SIZE:
w = 2
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.rInner)
#rHouse Circle
if self.options.houses:
clr = self.options.clrhouses
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.rHouse)
#Base Circle
clr = self.options.clrAscMC
if self.bw:
clr = (0,0,0)
w = self.options.ascmcsize
if self.chartsize <= GraphChart2.SMALL_SIZE and (w == 5 or w == 4 or w == 3):
w = 2
elif self.chartsize <= GraphChart2.MEDIUM_SIZE and (w == 5 or w == 4):
w = 3
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
self.bdc.DrawCircle(cx, cy, self.rBase)
asclon = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0:
asclon -= self.chart.ayanamsha
asclon = util.normalize(asclon)
#30-degs
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
w = 3
if self.chartsize <= GraphChart2.SMALL_SIZE:
w = 1
elif self.chartsize <= GraphChart2.MEDIUM_SIZE:
w = 2
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
self.drawLines(GraphChart2.DEG30, asclon, self.rInner, self.r30)
#10-degs
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
w = 2
if self.chartsize <= GraphChart2.MEDIUM_SIZE:
w = 1
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
self.drawLines(GraphChart2.DEG10, asclon, self.r0, self.r10)
#5-degs
self.drawLines(GraphChart2.DEG5, asclon, self.r0, self.r5)
#1-degs
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.drawLines(GraphChart2.DEG1, asclon, self.r0, self.r1)
#Outer 10, 5, 1 -degs
if self.chart2 != None or (self.planetaryday and self.options.showfixstars != options.Options.NONE): #If planetaryday is True => radix chart
#10-degs
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
w = 2
if self.chartsize <= GraphChart2.MEDIUM_SIZE:
w = 1
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
self.drawLines(GraphChart2.DEG10, asclon, self.rOuter0, self.rOuter10)
#5-degs
self.drawLines(GraphChart2.DEG5, asclon, self.rOuter0, self.rOuter5)
#1-degs
clr = self.options.clrframe
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
self.drawLines(GraphChart2.DEG1, asclon, self.rOuter0, self.rOuter1)
self.bdc.EndDrawing()
def drawSigns(self):
(cx, cy) = self.center.Get()
clr = self.options.clrsigns
if self.bw:
clr = (0,0,0)
j = 0
asclon = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0:
asclon -= self.chart.ayanamsha
asclon = util.normalize(asclon)
i = math.pi+math.radians(asclon)-GraphChart2.DEG30/2
signs = common.common.Signs1
if not self.options.signs:
signs = common.common.Signs2
while j < chart.Chart.SIGN_NUM:
x = cx+math.cos(i)*self.rSign
y = cy+math.sin(i)*self.rSign
self.draw.text((x-self.signSize/2, y-self.signSize/2), signs[j], font=self.fntMorinusSigns, fill=clr)
i -= GraphChart2.DEG30
j += 1
def drawHouses(self, chouses, r1, r2):
(cx, cy) = self.center.Get()
clr = self.options.clrhouses
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
asc = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0 and self.options.hsys == 'W':
asc = util.normalize(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.ayanamsha)
for i in range (1, houses.Houses.HOUSE_NUM+1):
dif = math.radians(util.normalize(asc-chouses.cusps[i]))
x1 = cx+math.cos(math.pi+dif)*r1
y1 = cy+math.sin(math.pi+dif)*r1
x2 = cx+math.cos(math.pi+dif)*r2
y2 = cy+math.sin(math.pi+dif)*r2
self.bdc.DrawLine(x1, y1, x2, y2)
def drawAscMC(self, ascmc, r1, r2, rArrow):
(cx, cy) = self.center.Get()
#AscMC
clr = self.options.clrAscMC
if self.bw:
clr = (0,0,0)
w = self.options.ascmcsize
if self.chartsize <= GraphChart2.SMALL_SIZE and (w == 5 or w == 4 or w == 3):
w = 2
elif self.chartsize <= GraphChart2.MEDIUM_SIZE and (w == 5 or w == 4):
w = 3
pen = wx.Pen(clr, w)
self.bdc.SetPen(pen)
for i in range(4):
ang = math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC])
if i == 0:
ang -= math.radians(ascmc[houses.Houses.ASC])
if i == 1:
ang -= math.radians(ascmc[houses.Houses.ASC])+math.pi
if i == 2:
ang -= math.radians(ascmc[houses.Houses.MC])
if i == 3:
ang -= math.radians(ascmc[houses.Houses.MC])+math.pi
r2comma = r2
if self.chart2 != None and rArrow == self.rOuterArrow and i != 0 and i != 2:
r2comma = rArrow
x1 = cx+math.cos(ang)*r1
y1 = cy+math.sin(ang)*r1
x2 = cx+math.cos(ang)*r2comma
y2 = cy+math.sin(ang)*r2comma
self.bdc.DrawLine(x1, y1, x2, y2)
if i == 0 or i == 2:
self.drawArrow(ang, r2, clr, rArrow)
def drawArrow(self, ang, r2, clr, rArrow):
(cx, cy) = self.center.Get()
offs = math.pi/360.0
xl = cx+math.cos(ang+offs)*r2
yl = cy+math.sin(ang+offs)*r2
xr = cx+math.cos(ang-offs)*r2
yr = cy+math.sin(ang-offs)*r2
xm = cx+math.cos(ang)*rArrow
ym = cy+math.sin(ang)*rArrow
li = ((xl, yl, xr, yr), (xr, yr, xm, ym), (xm, ym, xl, yl))
self.bdc.DrawLineList(li)
# self.bdc.SetBrush(wx.Brush(clr))
# x = (xl+xr)/2
# x = (x+xm)/2
# y = (yl+yr)/2
# y = (y+ym)/2
# self.bdc.FloodFill(x, y, clr, wx.FLOOD_BORDER)
def drawAscMCPos(self):
(cx, cy) = self.center.Get()
clrpos = self.options.clrpositions
if self.bw:
clrpos = (0,0,0)
for i in range(2):
lon = self.chart.houses.ascmc[i]
if self.options.ayanamsha != 0:
lon -= self.chart.ayanamsha
lon = util.normalize(lon)
(d, m, s) = util.decToDeg(lon)
d, m = util.roundDeg(d%chart.Chart.SIGN_DEG, m, s)
degtxt = str(d)+self.deg_symbol
wdeg, hdeg = self.draw.textsize(degtxt, self.fntText)
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.houses.ascmc[i]))*self.rPosHouses
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.houses.ascmc[i]))*self.rPosHouses
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), degtxt, fill=clrpos, font=self.fntText)
mintxt = str(m)+"'"
wdeg, hdeg = self.draw.textsize(mintxt, self.fntSmallText2)
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.houses.ascmc[i]))*self.rPosHousesMin
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.houses.ascmc[i]))*self.rPosHousesMin
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), mintxt, fill=clrpos, font=self.fntSmallText2)
def drawHousePos(self):
(cx, cy) = self.center.Get()
clrpos = self.options.clrpositions
if self.bw:
clrpos = (0,0,0)
skipasc = False
skipmc = False
if self.chart.houses.cusps[1] == self.chart.houses.ascmc[houses.Houses.ASC]:
skipasc = True
if self.chart.houses.cusps[10] == self.chart.houses.ascmc[houses.Houses.MC]:
skipmc = True
asc = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0 and self.options.hsys == 'W':
asc = util.normalize(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.ayanamsha)
for i in range (1, houses.Houses.HOUSE_NUM+1):
if i >= 4 and i < 10:
continue
if (skipasc and i == 1) or (skipmc and i == 10):
continue
lon = self.chart.houses.cusps[i]
if self.options.ayanamsha != 0 and self.options.hsys != 'W':
lon -= self.chart.ayanamsha
lon = util.normalize(lon)
(d, m, s) = util.decToDeg(lon)
d, m = util.roundDeg(d%chart.Chart.SIGN_DEG, m, s)
degtxt = str(d)+self.deg_symbol
wdeg, hdeg = self.draw.textsize(degtxt, self.fntText)
x = cx+math.cos(math.pi+math.radians(asc-self.chart.houses.cusps[i]))*self.rPosHouses
y = cy+math.sin(math.pi+math.radians(asc-self.chart.houses.cusps[i]))*self.rPosHouses
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), degtxt, fill=clrpos, font=self.fntText)
mintxt = str(m)+"'"
wdeg, hdeg = self.draw.textsize(mintxt, self.fntSmallText2)
x = cx+math.cos(math.pi+math.radians(asc-self.chart.houses.cusps[i]))*self.rPosHousesMin
y = cy+math.sin(math.pi+math.radians(asc-self.chart.houses.cusps[i]))*self.rPosHousesMin
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), mintxt, fill=clrpos, font=self.fntSmallText2)
def drawHouseNames(self, chrt, rHouseNames):
(cx, cy) = self.center.Get()
clr = self.options.clrhousenumbers
if self.bw:
clr = (0,0,0)
pen = wx.Pen(clr, 1)
self.bdc.SetPen(pen)
asc = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0 and self.options.hsys == 'W':
asc = util.normalize(self.chart.houses.ascmc[houses.Houses.ASC]-self.chart.ayanamsha)
for i in range (1, houses.Houses.HOUSE_NUM+1):
width = 0.0
if i != houses.Houses.HOUSE_NUM:
width = chrt.houses.cusps[i+1]-chrt.houses.cusps[i]
else:
width = chrt.houses.cusps[1]-chrt.houses.cusps[houses.Houses.HOUSE_NUM]
width = util.normalize(width)
halfwidth = math.radians(width/2.0)
dif = math.radians(util.normalize(asc-chrt.houses.cusps[i]))
x = cx+math.cos(math.pi+dif-halfwidth)*rHouseNames
y = cy+math.sin(math.pi+dif-halfwidth)*rHouseNames
if i == 1 or i == 2:
xoffs = 0
yoffs = self.symbolSize/4
if i == 2:
xoffs = self.symbolSize/8
else:
xoffs = self.symbolSize/4
yoffs = self.symbolSize/4
self.draw.text((x-xoffs,y-yoffs), common.common.Housenames[i-1], fill=clr, font=self.fntText)
def drawPlanets(self, chrt, pshift, rPlanet, rRetr, outer=False):
(cx, cy) = self.center.Get()
clrs = (self.options.clrdomicil, self.options.clrexal, self.options.clrperegrin, self.options.clrcasus, self.options.clrexil)
clrpos = self.options.clrpositions
if self.bw:
clrpos = (0,0,0)
for i in range (planets.Planets.PLANETS_NUM+1):
if (i == astrology.SE_URANUS and not self.options.transcendental[chart.Chart.TRANSURANUS]) or (i == astrology.SE_NEPTUNE and not self.options.transcendental[chart.Chart.TRANSNEPTUNE]) or (i == astrology.SE_PLUTO and not self.options.transcendental[chart.Chart.TRANSPLUTO]) or ((i == astrology.SE_MEAN_NODE or i == astrology.SE_TRUE_NODE) and not self.options.shownodes) or (i == planets.Planets.PLANETS_NUM and not self.options.showlof):
continue
lon = 0.0
if i < planets.Planets.PLANETS_NUM:
lon = chrt.planets.planets[i].data[planets.Planet.LONG]
else:
lon = chrt.fortune.fortune[fortune.Fortune.LON]
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-lon-pshift[i]))*rPlanet
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-lon-pshift[i]))*rPlanet
clr = (0,0,0)
if not self.bw:
if self.options.useplanetcolors:
objidx = i
if i >= planets.Planets.PLANETS_NUM-1:
objidx -= 1
clr = self.options.clrindividual[objidx]
else:
if i < planets.Planets.PLANETS_NUM:
dign = chrt.dignity(i)
clr = clrs[dign]
else:
clr = self.options.clrperegrin
txtpl = ''
if i < planets.Planets.PLANETS_NUM:
txtpl = common.common.Planets[i]
else:
txtpl = common.common.fortune
self.draw.text((x-self.symbolSize/2, y-self.symbolSize/2), txtpl, fill=clr, font=self.fntMorinus)
if not outer:
#Position
lon2 = lon
if self.options.ayanamsha != 0:
lon2 -= self.chart.ayanamsha
lon2 = util.normalize(lon2)
(d, m, s) = util.decToDeg(lon2)
d, m = util.roundDeg(d%chart.Chart.SIGN_DEG, m, s)
degtxt = str(d)+self.deg_symbol
wdeg, hdeg = self.draw.textsize(degtxt, self.fntText)
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-lon-pshift[i]))*self.rPosDeg
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-lon-pshift[i]))*self.rPosDeg
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), degtxt, fill=clrpos, font=self.fntText)
mintxt = str(m)+"'"
wdeg, hdeg = self.draw.textsize(mintxt, self.fntSmallText2)
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-lon-pshift[i]))*self.rPosMin
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-lon-pshift[i]))*self.rPosMin
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), (mintxt).zfill(2), fill=clrpos, font=self.fntSmallText2)
#Retrograde
if i < planets.Planets.PLANETS_NUM:
rfnt = self.fntSmallText
if chrt.planets.planets[i].data[planets.Planet.SPLON] <= 0.0:
t = 'S'
if chrt.planets.planets[i].data[planets.Planet.SPLON] < 0.0:
t = common.common.retr
rfnt = self.fntRetr
# t = 'R'
wdeg, hdeg = self.draw.textsize(t, rfnt)
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-chrt.planets.planets[i].data[planets.Planet.LONG]-pshift[i]))*rRetr
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-chrt.planets.planets[i].data[planets.Planet.LONG]-pshift[i]))*rRetr
xdeg = x-wdeg/2
ydeg = y-hdeg/2
self.draw.text((xdeg, ydeg), t, fill=clr, font=rfnt)
else:
#Retrograde
if i < planets.Planets.PLANETS_NUM:
if chrt.planets.planets[i].data[planets.Planet.SPLON] <= 0.0:
t = 'S'
if chrt.planets.planets[i].data[planets.Planet.SPLON] < 0.0:
t = 'R'
x = cx+math.cos(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-chrt.planets.planets[i].data[planets.Planet.LONG]-pshift[i]))*rRetr
y = cy+math.sin(math.pi+math.radians(self.chart.houses.ascmc[houses.Houses.ASC]-chrt.planets.planets[i].data[planets.Planet.LONG]-pshift[i]))*rRetr
self.draw.text((x-self.symbolSize/8, y-self.symbolSize/8), t, fill=clr, font=self.fntSmallTextOuter)
def drawPlanetaryDayAndHour(self):
clr = self.options.clrtexts
if self.bw:
clr = (0,0,0)
ar = (1, 4, 2, 5, 3, 6, 0)
x = self.w-self.w/8
y = self.h/25
size = self.symbolSize/4*3
self.draw.text((x,y), common.common.Planets[ar[self.chart.time.ph.weekday]], fill=clr, font=self.fntMorinus2)
self.draw.text((x+size+size/2,y), mtexts.txts['Day'], fill=clr, font=self.fntBigText)
self.draw.text((x,y+size+size/2), common.common.Planets[self.chart.time.ph.planetaryhour], fill=clr, font=self.fntMorinus2)
self.draw.text((x+size+size/2,y+size+size/2), mtexts.txts['Hour'], fill=clr, font=self.fntBigText)
def drawHousesystemName(self):
clr = self.options.clrtexts
if self.bw:
clr = (0,0,0)
x = self.w-self.w/6
y = self.h-self.h/20
#ayanamsha
if self.options.ayanamsha != 0:
w, h = self.fntBigText.getsize(self.hsystem[self.options.hsys])
y2 = y-h*1.2
self.draw.text((x,y2), self.ayans[self.options.ayanamsha], fill=clr, font=self.fntBigText)
self.draw.text((x,y), self.hsystem[self.options.hsys], fill=clr, font=self.fntBigText)
def drawLines(self, deg, shift, r1, r2):
(cx, cy) = self.center.Get()
i = math.pi+math.radians(shift)
while i>-math.pi+math.radians(shift):
x1 = cx+math.cos(i)*r1
y1 = cy+math.sin(i)*r1
x2 = cx+math.cos(i)*r2
y2 = cy+math.sin(i)*r2
self.bdc.DrawLine(x1, y1, x2, y2)
i -= deg
def drawTermsLines(self):
(cx, cy) = self.center.Get()
asclon = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0:
asclon -= self.chart.ayanamsha
asclon = util.normalize(asclon)
shift = math.radians(asclon)
signdeg = float(chart.Chart.SIGN_DEG)
num = len(self.options.terms[self.options.selterm])
subnum = len(self.options.terms[self.options.selterm][0])
sign = 0.0
for i in range(num):
deg = sign
for j in range(subnum):
deg += float(self.options.terms[self.options.selterm][i][j][1])
x1 = cx+math.cos(math.pi+shift-math.radians(deg))*self.rTerms
y1 = cy+math.sin(math.pi+shift-math.radians(deg))*self.rTerms
x2 = cx+math.cos(math.pi+shift-math.radians(deg))*self.rDecans
y2 = cy+math.sin(math.pi+shift-math.radians(deg))*self.rDecans
self.bdc.DrawLine(x1, y1, x2, y2)
sign += signdeg
def drawTerms(self):
(cx, cy) = self.center.Get()
clr = (0,0,0)
if not self.bw:
clr = self.options.clrsigns
asclon = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0:
asclon -= self.chart.ayanamsha
asclon = util.normalize(asclon)
shift = math.radians(asclon)
signdeg = float(chart.Chart.SIGN_DEG)
num = len(self.options.terms[self.options.selterm])
subnum = len(self.options.terms[self.options.selterm][0])
sign = 0.0
for i in range(num):
deg = sign
for j in range(subnum):
pldeg = deg+float(self.options.terms[self.options.selterm][i][j][1])/2.0
deg += float(self.options.terms[self.options.selterm][i][j][1])
x = cx+math.cos(math.pi+shift-math.radians(pldeg))*self.rTermsPlanet
y = cy+math.sin(math.pi+shift-math.radians(pldeg))*self.rTermsPlanet
self.draw.text((x-self.smallsymbolSize/2, y-self.smallsymbolSize/2), common.common.Planets[self.options.terms[self.options.selterm][i][j][0]], fill=clr, font=self.fntSmallMorinus)
sign += signdeg
def drawDecansLines(self):
(cx, cy) = self.center.Get()
asclon = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0:
asclon -= self.chart.ayanamsha
asclon = util.normalize(asclon)
shift = asclon
deg = GraphChart2.DEG10
i = math.pi+math.radians(shift)
while i>-math.pi+math.radians(shift):
x1 = cx+math.cos(i)*self.rInner
y1 = cy+math.sin(i)*self.rInner
x2 = cx+math.cos(i)*self.rDecans
y2 = cy+math.sin(i)*self.rDecans
self.bdc.DrawLine(x1, y1, x2, y2)
i -= deg
def drawDecans(self):
(cx, cy) = self.center.Get()
clr = (0,0,0)
if not self.bw:
clr = self.options.clrsigns
asclon = self.chart.houses.ascmc[houses.Houses.ASC]
if self.options.ayanamsha != 0:
asclon -= self.chart.ayanamsha
asclon = util.normalize(asclon)