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
|
{
"metadata": {
"name": "S3-C4"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": "Principles of Field Astronomy"
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.1,Page 81"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ntheta=25+14.0/60;\nR=6370.0;\n\n#calculation\nAB=cos(theta*pi/180)*(16+10.0/60)\ndis=2*pi*R*AB/360.0;\n\n#result\nprint \"distance of AB in m \",round(dis,3)",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "distance of AB in m 1625.863\n"
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.2,Page 81"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nLongA=52+24.0/60;\nLongB=55+30.0/60;\nlatA=18+10.0/60;\nlatB=15.0;\nR=6370.0;#radius of earth\n\n#calculation\nP=LongB-LongA;\nPA=90-latA;\nPB=90-latB;\nAB=acos(cos(PB*pi/180)*cos(PA*pi/180)+sin(PB*pi/180)*sin(PA*pi/180)*cos(P*pi/180));\ndis=AB*R;\n#solving for A\na = np.array([[0.5,0.5], [0.5,-0.5]])\nb = np.array([atan(cos((PB/2-PA/2)*pi/180)/tan(P*pi/180)/cos((PB/2+PA/2)*pi/180))*180/pi,atan(sin((PB/2-PA/2)*pi/180)/tan(P*pi/180)/sin((PB/2+PA/2)*pi/180))*180/pi])\nx = np.linalg.solve(a, b)\nA=x[0];\nA=deg_to_dms(A);\n\n#result\nprint \"distance of AB in km \",round(dis,2)\nprint \"direction of B to A in deg min sec\",A",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "distance of AB in km 482.72\ndirection of B to A in deg min sec [117, 8, 30.72]\n"
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.3,Page 83"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nb=40.0;\np=6.0;\n\n#calculation\na=pi/2-asin(cos(b*pi/180)*cos(p*pi/180));\nBC=a*180/pi-b;\nBC=BC*1.853*60;\nB=asin(sin(b*pi/180)/sin(a))\nB=deg_to_dms(B*180/pi);\n\n#result\nprint \"distance BC in km\",round(BC,2)\nprint \"angle of B deg min sec\",B",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "distance BC in km 41.43\nangle of B deg min sec [82, 53, 56.83]\n"
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.4,Page 105"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ncoal=90.0-28.0-24.0/60;#coaltitude\ncola=90.0-48.0-30.0/60;#colatitude\n\n\n#calculation\ndelta=pi/2-acos((cos(coal*pi/180)*cos(cola*pi/180)+sin(coal*pi/180)*sin(cola*pi/180)*cos(50*pi/180)));\nH=acos(cos(coal*pi/180)/(sin(cola*pi/180)*cos(delta))-tan(delta)/tan(cola*pi/180));\nH=deg_to_dms(H*180/pi); \ndelta=deg_to_dms(delta*180/pi); \n\n#result\nprint \"H in deg min sec\",H\nprint \"declination in deg mi sec\",delta",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "H in deg min sec [99, 7, 55.94]\ndelta in deg mi sec [46, 57, 38.26]\n"
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.5,Page 107"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ndelta=22+45.0/60;\ntheta=55.0;\nH=45+15.0/60;\n\n#calculation\nalpha=asin((cos(H*pi/180)+tan(theta*pi/180)*tan(delta*pi/180))*cos(theta*pi/180)*cos(delta*pi/180));\nalpha=alpha*180/pi;\nA=acos(sin(delta*pi/180)/(cos(theta*pi/180)*cos(alpha*pi/180))-tan(alpha*pi/180)*tan(theta*pi/180));\nA=deg_to_dms(360-A*180/pi);\n\n#result\nprint \"azimuth in deg mi sec\",A",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "azimuth in deg mi sec [244, 40, 8.11]\n"
}
],
"prompt_number": 17
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.6,Page 109"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ncoal=42.0;\ncode=100+40.0/60;#co-declination\n\n#calculation\nalpha=pi/2-acos((cos(coal*pi/180)*cos(code*pi/180)+sin(coal*pi/180)*sin(code*pi/180)*cos(35*pi/180)));\nA=acos((cos(code*pi/180)-cos(coal*pi/180)*cos(pi/2-alpha))/(sin(coal*pi/180)*sin(pi/2-alpha)));\nA=deg_to_dms(A*180/pi);\nalpha=deg_to_dms(alpha*180/pi);\n\n#result\nprint \"azimuth in deg min sec\",A\nprint \"alpha in deg min sec\",alpha",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "azimuth in deg mi sec [142, 1, 26.46]\nalpha in deg min sec [23, 38, 48.21]\n"
}
],
"prompt_number": 33
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.7,Page 113"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ntheta=33+42.0/60+34.0/3600;\ndelta=81+55.0/60+14.0/3600;\n\n#calculation\nH1=acos(tan(theta*pi/180)/tan(delta*pi/180));\nH1=deg_to_dms(360-H1*180/pi);\nalpha=asin(sin(theta*pi/180)/sin(delta*pi/180));\nalpha=deg_to_dms(alpha*180/pi);\nA=asin(cos(delta*pi/180)/cos(theta*pi/180));\nA=deg_to_dms(A*180/pi);\n\n\n#result\nprint \"azimuth in deg min sec\",A\nprint \"alpha in deg min sec\",alpha\nprint \"hour angle in deg min sec\",H1",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "azimuth in deg min sec [9, 43, 37.11]\nalpha in deg min sec [34, 5, 36.7]\nhour angle in deg min sec [275, 26, 3.85]\n"
}
],
"prompt_number": 41
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.8,Page 114"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha=0.0;\ntheta=25+45.0/60;\n\n#calculation\ndelta=asin(sin(alpha)/sin(theta*pi/180));\n\n#result\nprint \"declination in degrees\",delta",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "declination in degrees 0.0\n"
}
],
"prompt_number": 42
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.9,Page 116"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ncola=90.0-49.0;#colatitude\ncode=90.0+19.0;#codeclination\n\n#calculation\nA1=acos((cos(code*pi/180)-cos(cola*pi/180)*cos(pi/2))/sin(cola*pi/180)/sin(pi/2));\nA1=deg_to_dms(360-A1*180/pi);\nH=acos((0-cos(cola*pi/180)*cos(code*pi/180))/sin(cola*pi/180)*sin(code*pi/180));\nH=deg_to_dms(H*180/pi)\n\n#result\nprint \"azimuth in deg min sec\",A1\nprint \"hour angle in deg min sec\",H",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "azimuth in deg min sec [240, 14, 52.45]\nhour angle in deg min sec [69, 15, 38.0]\n"
}
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.10,Page 120"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n#part1\ndelta=38+15.0/60;\ntheta=25+10.0/60;\n\n#calculation\nz=delta-theta;\nalpha=90-z;\nz=deg_to_dms(z);\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"zenith distance in deg min sec\",z\nprint \"altitude in deg min sec\",alpha\n\n#part2\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ndelta=22+40.0/60;\ntheta=25+10.0/60;\n\n#calculation\nz=-delta+theta;\nalpha=90-z;\nz=deg_to_dms(z);\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"zenith distance in deg min sec\",z\nprint \"altitude in deg min sec\",alpha\n\n#part3\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md+1)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ndelta=70+20.0/60;\ntheta=25+10.0/60;\n\n#calculation\nz=delta-theta;\nz=deg_to_dms(z);\n\n\n#result\nprint \"zenith distance in deg min sec\",z\n\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "zenith distance in deg min sec [13, 4, 60.0]\naltitude in deg min sec [76, 55, 0.0]\nzenith distance in deg min sec [2, 30, 0.0]\naltitude in deg min sec [87, 30, 0.0]\nzenith distance in deg min sec [45, 10, -0.0]\n"
}
],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.11,Page 122"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ntheta=42+50.0/60;\ndelta=83+40.0/60;\n\n#calculation\nz=180-delta-theta;\nalpha=90-z;\nz=deg_to_dms(z);\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"zenith distance in deg min sec\",z\nprint \"altitude in deg min sec\",alpha",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "zenith distance in deg min sec [53, 29, 60.0]\naltitude in deg min sec [36, 30, 0.0]\n"
}
],
"prompt_number": 21
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.12,Page 133"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\ndol=110-82-30.0/60; #differnce in longitude\nST=18+35.0/60+10.0/3600;#standard time\n\n#calculation\nLMT=ST+dol/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT\n\n#part2\ndol=82+30.0/60+30; #differnce in longitude\nST=18+35.0/60+10.0/3600;#standard time\n\n#calculation\nLMT=ST-dol/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT\n\n#part1\ndol=82+30.0/60-30; #differnce in longitude\nST=18+35.0/60+10.0/3600;#standard time\n\n#calculation\nLMT=ST-dol/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec [20, 25, 10.0]\nLMT in hr min sec [11, 5, 10.0]\nLMT in hr min sec [15, 5, 10.0]\n"
}
],
"prompt_number": 66
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.13,Page 134"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nLMT=8+30.0/60+15.0/3600;\nLong=45+30.0/60;\n\n#calculation\nGMT=LMT+Long/15.0;\nGMT=deg_to_dms(GMT)\n\n#result\nprint \"GMT in hr min sec (AM)\",GMT\n\n\n#part2\nLMT=6+40.0/60+10.0/3600;\nLong=55+30.0/60;\n\n#calculation\nGMT=LMT-Long/15.0;\nGMT=deg_to_dms(GMT)\n\n#result\nprint \"GMT in hr min sec (PM)\",GMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "GMT in hr min sec (AM) [11, 32, 15.0]\nGMT in hr min sec (PM) [2, 58, 10.0]\n"
}
],
"prompt_number": 71
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.14,Page 134"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nGMT=20+30.0/60+15.0/3600;\nLong=82+30.0/60;\n\n#calculation\nLMT=GMT+Long/15.0-24;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec (next day)\",LMT\n\n#part1\nGMT=20+30.0/60+15.0/3600;\nLong=120.0;\n\n#calculation\nLMT=GMT-Long/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec (same day)\",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec (next day) [2, 0, 15.0]\nLMT in hr min sec (same day) [12, 30, 15.0]\n"
}
],
"prompt_number": 74
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.15,Page 135"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nRA=6+15.0/60+20.0/3600;\nHA=8+10.0/60+30.0/3600;\n\n#calculation\nLST=RA+HA;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST\n\n#part2\nRA=8+40.0/60+15.0/3600;\nHA=3+50.0/60+20.0/3600;\n\n#calculation\nLST=RA-HA;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LST in hr min sec [14, 25, 50.0]\nLST in hr min sec [4, 49, 55.0]\n"
}
],
"prompt_number": 76
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.16,Page 135"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nLHA=6+30.0/60+10.0/3600;\n\n#calculation\nLAT=LHA+12;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT;\n\n#part2\nLHA=18+40.0/60+20.0/3600;\n\n#calculation\nLAT=LHA+12-24;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT;",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LAT in hr min sec [18, 30, 10.0]\nLAT in hr min sec [6, 40, 20.0]\n"
}
],
"prompt_number": 78
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.17,Page 136"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=60.0;\nLHA=5+30.0/60+20.0/3600;\n\n#calculation\nGMT=LHA+12-Long/15.0;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hr min sec\",GMT\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "GMT in hr min sec [13, 30, 20.0]\n"
}
],
"prompt_number": 79
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.18,Page 138"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#parta\nGMT=0;\nET=10.0/60+1.8/3600;\n\n#calculaion\nGAT=GMT+ET;\nGAT=deg_to_dms(GAT);\n\n#result\nprint \"GAT in hr min sec\",GAT\n\n#partb\nGMT=0;\nET=-13.0/60-28.5/3600;\n\n#calculaion\nGAT=GMT+ET+24;\nGAT=deg_to_dms(GAT);\n\n#result\nprint \"GAT in hr min sec\",GAT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "GAT in hr min sec [0, 10, 1.8]\nGAT in hr min sec [23, 46, 31.5]\n"
}
],
"prompt_number": 81
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.19,Page 138"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nET1=-3.0/60-51.4/3600; #ET at april 2\nET2=-3.0/60-33.5/3600; #ET at april 3\n\n#calculation\ndET=(ET2-ET1)*18.0/24; #change in ET\nET=ET1+dET;\nET=deg_to_dms(ET);\n\n#result\nprint \"ET (-ve) in hr min s\",ET",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "ET in hr min s [0, 3, 37.97]\n"
}
],
"prompt_number": 83
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.20,Page 138"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLAT=15+12.0/60+40.0/3600;\nLong=20+3.0/60;\nGMN=5.0/60+10.65/3600;\n\n#calculation\nGAT=LAT+Long/15.0;\ne1=(GAT-12)*0.22/3600+GMN;\nLAT=GAT+e1-Long/15.0;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LAT in hr min sec [15, 17, 51.65]\n"
}
],
"prompt_number": 84
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.21,Page 139"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=56+35.0/60;\nLMT=7+15.0/60+25.0/3600;\nGMN=3.0/60+54.0/3600;\n\n#calculation\nGMT=LMT-Long/15.0;\ne1=GMN+(12-GMN)*0.25/3600;\nLAT=GMT+Long/15.0+e1;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LAT in hr min sec [7, 19, 21.98]\n"
}
],
"prompt_number": 86
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.22,Page 142"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nST=7+15.0/60+30.0/3600;\n\n#calculation\ntr=9.8296/3600*ST;\nST=ST-tr;\nST=deg_to_dms(ST);\n\n#result\nprint \"solar mean time in hr min sec\",ST",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "solar mean time in hr min sec [7, 14, 18.65]\n"
}
],
"prompt_number": 87
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.23,Page 142"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nST=7+45.0/60+50.0/3600;\n\n#calculation\ntr=9.8565/3600*ST;\nST=ST+tr;\nST=deg_to_dms(ST);\n\n#result\nprint \"solar mean time in hr min sec\",ST",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "solar mean time in hr min sec [7, 47, 6.52]\n"
}
],
"prompt_number": 90
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.24,Page 143"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=140+35.0/60+20.0/3600;\nGST=13+15.0/60+30.0/3600;\n\n#calculation\nLST=GST+9.8565/3600*Long/15.0;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in deg min sec\",LST\n\n#part2\nLong=160+45.0/60+30.0/3600;\nGST=13+15.0/60+30.0/3600;\n\n#calculation\nLST=GST-9.8565/3600*Long/15.0;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in deg min sec\",LST",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LST in deg min sec [13, 17, 2.38]\nLST in deg min sec [13, 13, 44.37]\n"
}
],
"prompt_number": 93
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.25,Page 145"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;\nGST=15+55.0/60+13.0/3600;\nLMT=11.0;\n\n#calculation\nLST=GST+Long/15.0*9.8565/3600+LMT+9.8565/3600*LMT;\nLST=LST-24;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of next day in deg min sec\",LST",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LST of next day in deg min sec [2, 57, 50.7]\n"
}
],
"prompt_number": 95
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.26,Page 145"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;\nGST=5+25.0/60+15.0/3600;\nLMT=5.0+40.0/60;\n\n#calculation\nLST=GST-Long/15.0*9.8565/3600+LMT+9.8565/3600*(LMT);\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of next day in deg min sec\",LST",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LST of next day in deg min sec [11, 5, 21.57]\n"
}
],
"prompt_number": 96
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.27,Page 146"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;\nGST=11+45.0/60+10.0/3600;\nLST=26+35.0/60+42.0/3600;\n\n#calculation\nLMM=GST+Long/15*9.8565/3600;\nLMT=LST-LMM-(LST-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT-12)\n\n#result\nprint \"LMT in hr min sec (PM)\",LMT \n\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec (PM) [2, 47, 16.96]\n"
}
],
"prompt_number": 97
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.28,Page 147"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=90.0;\nGST=9+15.0/60+14.0/3600;\nLST=31+35.0/60+12.0/3600;\n\n#calculation\nLMM=GST-Long/15*9.8565/3600;\nLMT=LST-LMM-(LST-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT-12)\n\n#result\nprint \"LMT in hr min sec (PM)\",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec (PM) [10, 17, 17.46]\n"
}
],
"prompt_number": 100
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.29,Page 149"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=150.0;\nGST=12+25.0/60+15.0/3600;\nLST=30+15.0/60+10.0/3600;\nLMN=18+15.0/60+10.0/3600;\n\n#calculation\nLMM=GST+Long/15*9.8565/3600;\nLMT=LMN-LMM-(LMN-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hr min sec (PM)\",LMT\n\n#part2\nLMM=GST+Long/15*9.8565/3600;\nLMT=LST-LMM-(LST-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT-12)\n\n#result\nprint \"LMT in hr min sec (AM)\",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec (PM) [5, 47, 19.38]\nLMT in hr min sec (AM) [5, 45, 21.42]\n"
}
],
"prompt_number": 102
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.30,Page 150 "
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ntheta=35+15.0/60+20.0/3600;\ndelta=88+15.0/60+45.0/3600;\nRA=1+45.0/60+15.0/3600;\n\n#calculation\nH=acos(tan(theta*pi/180)/tan(delta*pi/180));\nH=H*180/pi/15;\nLST=RA+H;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LST in hr min sec [7, 40, 20.12]\n"
}
],
"prompt_number": 103
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.31,Page 151"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nRA=22+25.0/60+10.0/3600;\nST=14+45.0/60;#sidereal time\nLong=90.0;\nGMT=27+15.0/60;\nLMN=15+21.0/60+15.0/3600;\n\n#calculation\nMT=12+24-GMT+Long/15;#mean time interval\nacc=9.8565/3600*MT;\nHA=LMN-acc-MT;\nLST=HA+24-RA;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LST in hr min sec [2, 8, 39.62]\n"
}
],
"prompt_number": 105
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.32,Page 152"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=60;\nGMT=11+15.0/60+20.0/3600;\n\n#calculation\nLMT=GMT-Long/15*9.8296/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec \",LMT\n\n#part2\nLong=45;\nGMT=11+15.0/60+20.0/3600;\n\n#calculation\nLMT=GMT+Long/15*9.8296/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec \",LMT\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec [11, 14, 40.68]\nLMT in hr min sec [11, 15, 49.49]\n"
}
],
"prompt_number": 107
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": "Example 4.33,Page 153"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75;\nGMT=6+18.0/60+20.0/3600;\nLST=10+25.0/60+15.0/3600;\n\n#calculation\nLMT=GMT+Long/15*9.8296/3600;\nLST=LST-9.8296/3600*LST;\nLMT=LMT+LST;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec \",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec [16, 42, 41.72]\n"
}
],
"prompt_number": 111
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.34,Page 154"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nGST=7+35.0/60+40.0/3600;\n\n#calculation\nGMT=24-GST-(24-GST)*9.8296/3600;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hr min sec\",GMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "GMT in hr min sec [16, 21, 38.74]\n"
}
],
"prompt_number": 112
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": "Example 4.34,Page 154"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=120.0;\nGMT=12+3.0/60+24.6/3600;\n\n#calculation\nLMT=GMT-17.8/24*Long/15.0/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of LAN in hr min sec\",LMT\n\n#part2\nLong=45;\nGMT=12+3.0/60+24.6/3600;\n\n#calculation\nLMT=GMT+17.8/24*Long/15.0/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of LAN in hr min sec\",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT of LAN in hr min sec [12, 3, 18.67]\nLMT of LAN in hr min sec [12, 3, 26.83]\n"
}
],
"prompt_number": 114
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.35,Page 156"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#one of the 2 solution\nf0=5+1.9/60;\nn=0.25;\ndel0=0;\ndel1=-0.1;\nd2=23.0;#del1/2\n\n#calculation\nfn=f0+n*d2/60+n*(n-1)/2*(del1+del0)/60;\nfn=deg_to_dms(fn)\n\n#result\nprint \"sun declination in deg min sec\",fn",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "sun declination in deg min sec [5, 7, 39.56]\n"
}
],
"prompt_number": 117
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.36,Page 157"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nalt=23+40.0/60;\nazi=145.0;\nlat=50.0;\n\n#calculation\ndelta=pi/2-acos(cos(pi/2-lat*pi/180)*cos(pi/2-alt*pi/180)+sin(pi/2-lat*pi/180)*sin(pi/2-alt*pi/180)*cos(azi*pi/180));\nH=acos((cos(pi/2-alt*pi/180)-cos(pi/2-lat*pi/180)*cos(pi/2-delta))/sin(pi/2-lat*pi/180)*sin(pi/2-delta))\nH=deg_to_dms(360-H*180/pi);\ndelta=deg_to_dms(delta*180/pi);\n\n#result\nprint \"there is a calculation mistake in calculating H in the book\"\nprint \"declination in deg min sec\",delta\nprint \"hour angle in deg min sec\",H",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "declination in deg min sec [-10, 3, 51.85]\nhour angle in deg min sec [325, 4, 44.11]\n"
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.37,Page 158"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nalt=25+30.0/60;\nazi=45.0;\nlat=42.0;\n\n#calculation\ndelta=pi/2-acos(cos(pi/2-lat*pi/180)*cos(pi/2-alt*pi/180)+sin(pi/2-lat*pi/180)*sin(pi/2-alt*pi/180)*cos(azi*pi/180));\nH=acos((cos(pi/2-alt*pi/180)-cos(pi/2-lat*pi/180)*cos(pi/2-delta))/sin(pi/2-lat*pi/180)*sin(pi/2-delta))\nH=deg_to_dms(H*180/pi);\ndelta=deg_to_dms(delta*180/pi);\n\n#result\nprint \"declination in deg min sec\",delta\nprint \"hour angle in deg min sec\",H",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "declination in deg min sec [49, 40, 22.06]\nhour angle in deg min sec [93, 58, 30.79]\n"
}
],
"prompt_number": 122
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.38,Page 158"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding hour angle,azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ndelta=21.0*pi/180+25.0/60*pi/180;\nlat=25+40.0/60;\n\n#calculation\nH=acos((0-cos(pi/2-lat*pi/180)*cos(pi/2-delta))/sin(pi/2-lat*pi/180)*sin(pi/2-delta));\nA=acos(cos(pi/2-delta)/sin(pi/2-lat*pi/180));\nH=deg_to_dms(360-H*180/pi);\nA=deg_to_dms(A*180/pi);\n\n#result\nprint \"hour angle in deg min sec\",H\nprint \"azimuth in deg min sec\",A",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "hour angle in deg min sec [260, 35, 53.78]\nazimuth in deg min sec [66, 6, 4.59]\n"
}
],
"prompt_number": 130
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.39,Page 161"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding latitude\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#calculation\nA=np.array([[1,1],[1,-1]]);\nb=np.array([[90],[0]]);\nx=np.linalg.solve(A,b);\n\n#result\nprint \"latitude in degrees\",x[0]",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "latitude in degrees [ 45.]"
},
{
"output_type": "stream",
"stream": "stdout",
"text": "\n"
}
],
"prompt_number": 131
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.40,Page 161"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding altitude\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ntheta=53+20.0/60;\ndelta=53+20.0/60;\n\n#calculation\nalpha=theta+delta-90;\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"altitude in deg min sec\",alpha",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "altitude in deg min sec [16, 40, 0.0]\n"
}
],
"prompt_number": 132
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.41,Page 162"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding GAT\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nGMT=18+30.0/60;\nET=1.0/60+25.4/3600-0.67*6.5/3600;\n\n#calculation\nGAT=GMT+ET;\nGAT=deg_to_dms(GAT)\n\n#result\nprint \"GAT in hr min sec\",GAT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "GAT in hr min sec [18, 31, 21.05]\n"
}
],
"prompt_number": 133
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.42,Page 163"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding LMT\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=30.0;\nGAT=13+15.0/60+10.0/3600;\nET=6.0/60+15.35/3600+0.3/3600*1.25278;\n\n#calculation\nLMT=GAT+ET-Long/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LMT in hr min sec [11, 21, 25.73]\n"
}
],
"prompt_number": 134
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.43,Page 163"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding LHA\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=45.0;\nE=11+55.0/60+5.0/3600-1.5/6*17.0/3/3600;\n\n#calculation\nGMT=14+40.0/60+Long/15.0;\nGHA=GMT+E;\nLHA=GHA-24-Long/15;\nLHA=deg_to_dms(LHA);\n\n#result\nprint \"LHA of the sun in hr min sec\",LHA\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "LHA of the sun in hr min sec [2, 35, 3.58]\n"
}
],
"prompt_number": 135
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": "Example 4.44,Page 164"
},
{
"cell_type": "code",
"collapsed": false,
"input": "#finding GMT\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nE=11+55.0/60+24.0/3600+0.5/3600*(2+40.0/60+21.2/3600);\nGHA=8+35.0/60+45.2/3600;\n\n#calculation\nGMT=GHA+24-E;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hr min sec\",GMT",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "GMT in hr min sec [20, 40, 19.86]\n"
}
],
"prompt_number": 136
}
],
"metadata": {}
}
]
}
|