summaryrefslogtreecommitdiff
path: root/Surveying_Volume_3/Chapter5.ipynb
blob: 4d4ee9e62174bac31735c1ed393887b6bb1cab0c (plain)
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
{
 "metadata": {
  "name": "S3-C5"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Uses Of Field Astronomy in surveying"
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.1,Page 174"
    },
    {
     "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#printing result in degree minute and seconds respectively\nl1=11.5;\nl2=13.5;\nr1=8.5;\nr2=6.5;\nalpha=3+15.0/60+28.0/3600;\nOB=121+45.0/60+18.0/3600;\nOA=43+25.0/60+20.51/3600;\n\n#calculation\ngamma=(l1+l2)/4-(r1+r2)/4;\ne=gamma*tan(alpha*pi/180)/3600; #correction\nCH=OB-OA-e;\nCH=deg_to_dms(CH);\n\n#result\nprint \"corrected horizontal angle in deg,min,sec respectively\",CH",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "corrected horizontal angle in deg,min,sec respectively [78, 19, 57.35]\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.2,Page 184"
    },
    {
     "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=30+32.0/60+18.0/3600;#latitude\nd=16.0/60+2.85/3600; #diameter of sun\n\n#calculation\nC1=-58.0/3600/tan(alpha*pi/180); \nC2=8.8/3600*cos(alpha*pi/180);   \nC3=d;      \nCL=alpha+C1+C2+C3;\nCL=deg_to_dms(CL);\n\n#result\nprint \"corrected latutude in deg,min,sec respectively\",CL",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "corrected latutude in deg,min,sec respectively [30, 46, 50.12]\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.3,Page 184"
    },
    {
     "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=40+52.0/60+10.0/3600;#latitude\n\n#calculation\nC1=-58.0/3600/tan(alpha*pi/180);\nCL=alpha+C1;\nCL=deg_to_dms(CL);\n\n#result\nprint \"corrected latutude in deg,min,sec respectively\",CL",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "corrected latutude in deg,min,sec respectively [40, 51, 2.97]\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.4,Page 197"
    },
    {
     "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]\nLMT=21+23.0/60+05.0/3600; #local chronometer time\nLong=65.0+19.0/60; #longitude\nGST=13+15.0/60+20.0/3600;\nRA=9+32.0/60+15.0/3600;\nLong2=82.0+30.0/60; #longitude of India\n\n#calculation\ne1=Long/15*9.8565/3600;  #error\nSIT=RA+24-GST+e1; #sidereal time interval after LMM\ne2=SIT*9.8296/3600; #error\nMI=SIT-e2; #mean interval after LMM\nLMT=LMT-(Long2-Long)/15.0;\nCE=MI-LMT;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in hours,min,sec respectively\",CE",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "chronometer error in hours,min,sec respectively [0, 0, 2.56]\n"
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.5,Page 198"
    },
    {
     "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]\nMST=12+32.0/60+15.0/3600; #mean sidereal time\nRA=15+45.0/60+10.0/3600;\ntheta=55+14.0/60+20.0/3600;#latitude\ndelta=15+24.0/60+30.0/3600;#declination\nalpha=35+44.0/60+10.0/3600;#zenith deistance\n\n#calculation\nc=90-theta;\np=90-delta;\nz=90-alpha;\nH=acos(cos(z*pi/180)/sin(c*pi/180)/sin(p*pi/180)-1/(tan(p*pi/180)*tan(c*pi/180)))\nH=H/15*180/pi;\nLST=RA-H;\nCE=MST-LST;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in hours,min,sec respectively\",CE",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "chronometer error in hours,min,sec respectively [0, 0, 12.94]\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.6,Page 199"
    },
    {
     "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]\nLMTe=6+34.0/60+18.0/3600;#  LMT east\nLMTw=8+58.0/60+2.0/3600; # LMT west\nRA=16+11.0/60+25.0/3600;\nLong=125+33.0/60;\nGST=8+25.0/60+14.0/3600;\n\n#calculation\ne1=Long/15*9.8565/3600; #error\nSIT=RA-GST+e1; #sidereal time interval after LMM\ne2=SIT*9.8296/3600;\nMI=SIT-e2; #mean time interval after LMM\nLMTav=(LMTe+LMTw)/2; #mean LMT\nCE=LMTav-MI;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in slower side in hours,min,sec respectively\",CE",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "chronometer error in slower side in hours,min,sec respectively [0, 0, 6.9]\n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.7,Page 204"
    },
    {
     "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]\nLMM=15+9.0/60+5.21/3600;# mean LMT\nGMT=10+9.0/60+3.76/3600;\nLong=75.0;#longitude\nalpha=42+30.0/60+42.0/3600;\ntheta=34+48.0/60+12.0/3600;\ndelta=15+36.0/60+48.0/3600;\n\n#calculation\nH=acos(sin(alpha*pi/180)/cos(theta*pi/180)/cos(delta*pi/180)-(tan(delta*pi/180)*tan(theta*pi/180)))\nH=H/15*180/pi;\nGAT=12+H-Long/15;\nLMT=GAT+Long/15-5.0/60-40.0/3600;\nCE=LMM-LMT;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in slower side in hours,min,sec respectively\",CE",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "[0, 0, 1.45] chronometer error in slower side in hours,min,sec respectively\n"
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.8,Page 219"
    },
    {
     "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]\nd=5+1.0/60+50.0/3600;\ndel1=75+14.0/60+20.0/3600;\ndel2=70+12.0/60+30.0/3600;\n\n#calculation\nk=cos(del1*pi/180)/cos(del2*pi/180);\nA2=pi/2-atan((cos(d*pi/180)-k)/sin(d*pi/180));\nA2=A2*180/pi;\nA2=120+15.0/60+10.0/3600-A2;\nCR=360-A2;\nA2=deg_to_dms(A2);\nCR=deg_to_dms(CR);\n\n#result\nprint \"azimuth of angle R in degree,minites,seconds respectively\",A2\nprint \"true bearing of CR in degree,minites,seconds respectively\",CR",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "azimuth of angle R in degree,minites,seconds respectively [100, 27, 40.0]\ntrue bearing of CR in degree,minites,seconds respectively [259, 32, 20.0]\n"
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.9,Page 223"
    },
    {
     "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]\na=26.0/60+51.0/3600;\np=56.0/60+5.1/3600;#polar distance\n\n#calculation\nH=acos(a/p);\nA=p*sin(H)/cos(30.75694*pi/180);\nCR=25+35.0/60+40.0/3600-A;\nCR=deg_to_dms(CR);\n\n#result\nprint \"azimuth of angle CR in degree,minites,seconds respectively\",CR",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "azimuth of angle CR in degree,minites,seconds respectively [24, 38, 22.01]\n"
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.10,Page 227 "
    },
    {
     "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]\nLong=75.0;#longitude\nGST=11+40.0/60+32.4/3600;\nRA=12+25.0/60+18.35/3600;\nGMT=15+45.0/60+25.3/3600;\ndelta=22+6.0/60+32.5/3600;\n\n#calculation\ne1=Long/15*9.8565/3600;\nLSTofLMM=GST-e1;\nLMT=GMT+Long/15;\nSIT=LMT+LMT*9.8565/3600;#sidereal time interval\nLHA=SIT+LSTofLMM;\nH=RA+24-LHA;\nH=H*15;\nB=atan(tan(delta*pi/180)*tan(H*pi/180));\nB=B*180/pi;\nA=atan(tan(H*pi/180)*cos(B*pi/180)/sin((B-32-15.0/60)*pi/180))\nA=A*180/pi;\nTB=360+A-135-15.0/60-20.0/3600;\nTB=deg_to_dms(TB);\n\n#result\nprint \"true bearing TB in degree,minites,seconds respectively\",TB\nprint \"there is slight difference in the answers due to rounding off error in the book\"",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "true bearing TB in degree,minites,seconds respectively [313, 17, 36.07]\nthere is slight difference in the answers due to rounding off error in the book\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.11,Page 237"
    },
    {
     "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]\nz=51+47.0/60+18.0/3600;#zenith distance\np=88+57.0/60+57.0/3600;#polar distance\nc=61+27.0/60+55.0/3600;#co-latitude\n\n#calculation\ns=(z+p+c)/2;\nA=2*atan(sqrt(sin((s-z)*pi/180)/sin(s*pi/180)*sin((s-c)*pi/180)/sin((s-p)*pi/180)));\nA=A*180/pi;\nTB=360-A-165-18.0/60-20.0/3600;\nTB=deg_to_dms(TB);\n\n#result\nprint \"true bearing TB in degree,minites,seconds respectively\",TB",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "true bearing TB in degree,minites,seconds respectively [80, 59, 47.52]\n"
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.12,Page 241"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#finding latitude\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    sd=round(sd,2)\n    return [d, m, sd]\nz2=90-40-13.0/60-15.0/3600;\ndel2=12+15.0/60+30.0/3600;#declination of star\n\n#calculation\ntheta=z2+del2;\ntheta=deg_to_dms(theta);\n\n#result\nprint \"altitude in degree,minites,seconds respectively\",theta",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "altitude in degree,minites,seconds respectively [62, 2, 15.0]\n"
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.13,Page 244"
    },
    {
     "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]\nalpha1=30+45.0/60+25.0/3600;\nalpha2=40+48.0/60+30.0/3600;\n\n#calculation\ne1=-58/3600/tan(alpha1*pi/180); #error 1\ne2=-58/3600/tan(alpha2*pi/180); #error 2\ntheta=(alpha1+alpha2+e1+e2)/2;\ntheta=deg_to_dms(theta)\n\n#result\nprint \"latitude in degree,minites,seconds respectively\",theta",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "latitude in degree,minites,seconds respectively [34, 21, 48.1]\n"
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.14,Page 258"
    },
    {
     "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]\nZP=37+29.0/60+40.0/3600;#colatitde\nZM=56+24.0/60+50.0/3600;#coaltitude\nPM=67+54.0/60+24.0/3600;#codeclination\n\n#calculation\nA1=acos((cos(PM*pi/180)-cos(ZP*pi/180)*cos(ZM*pi/180))/(sin(ZP*pi/180)*sin(ZM*pi/180)));\nA1=A1*180/pi;\nA=360-A1;\nA=deg_to_dms(A);\n\n#result\nprint \"azimuth of sun in degree,minites,seconds respectively\",A",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "azimuth of sun in degree,minites,seconds respectively [262, 53, 12.16]\n"
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.15,Page 259"
    },
    {
     "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=54+30.0/60;#latitude\ndelta=62+12.0/60+21.0/3600;#declination\n\n#calculation\nalpha=asin(sin(theta*pi/180)/sin(delta*pi/180));\nA1=acos(tan(theta*pi/180)/tan(alpha));\nA1=A1*180/pi;\nTB=360-A1-65-18.0/60-42.0/3600;\nTB=deg_to_dms(TB);\nalpha=deg_to_dms(alpha*180/pi);\nH=atan(tan(theta*pi/180)/tan(delta*pi/180));\nH=deg_to_dms(H*180/pi);\n\n#result\nprint \"true bearing in degree,minites,seconds respectively\",TB\nprint \"altitude in degree,minites,seconds respectively\",alpha\nprint \"hour angle in degree,minites,seconds respectively\",H",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "true bearing in degree,minites,seconds respectively [241, 16, 19.55]\naltitude in degree,minites,seconds respectively [66, 58, 7.13]\nhour angle in degree,minites,seconds respectively [36, 27, 49.32]\n"
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.16,Page 261"
    },
    {
     "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=44+12.0/60+30.0/3600;\nd=15.0/60+45.86/3600;#diameter correction\nLong=7+20.0/60+15.0/3600;#longitude\n\n#calculation\nalpha=alpha+d-58/3600/tan(alpha)+8.8/3600*cos(alpha);\nGAT=Long/15;\ne2=6.82/3600*GAT;\ndelta=22+18.0/60+12.8/3600+e2;\ntheta=delta+90-alpha;\ntheta=deg_to_dms(theta);\n\n#result\nprint \"altitude in degree,minites,seconds respectively\",theta",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "[67, 49, 51.7] altitude in degree,minites,seconds respectively\n"
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.17,Page 262"
    },
    {
     "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]\nGMT=16+22.0/60+55.0/3600;\nET=3.0/60+43.0/3600;\nc=90-42-20.0/60;\np=90-18-45.0/60-50.0/60;\nz=90-43-38.0/60;\n\n#calculation\nH=acos(cos(z*pi/180)/sin(c*pi/180)/sin(p*pi/180)-1/tan(c*pi/180)*1/tan(p*pi/180));\nH=H*180/pi;\nLAT=12-H/15;\nLMT=LAT-ET;\nLong=GMT-LMT;\nLong=Long*15;\nLong=deg_to_dms(Long);\n\n#result\nprint \"Longitude in degree,minites,seconds respectively\",Long",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Longitude in degree,minites,seconds respectively [114, 50, 53.21]\n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5.18,Page 263"
    },
    {
     "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=21+35.0/60+30.0/3600;#mean observed altitude\nC=(4.5+5.5-3.5-2.5)/4*15.0/3600;\nc=44+30.0/60;#colatitude\nz=68+26.0/60+34.0/3600;#coaltitude\np=94+4.0/60+15.0/3600;#codeclination\ns=(c+p+z)/2;\n\n#calculation\ncr=-58/3600/tan(alpha);#correction refraction\ncp=8.8/3600*cos(alpha);#correction parallax\nalpha=alpha+C+cr+cp;  #corrected altitude\nA=2*atan(sqrt(sin((s-z)*pi/180)/sin(s*pi/180)*sin((s-c)*pi/180)/sin((s-p)*pi/180)));\nA=A*180/pi;\nMh=(121+45.0/60+20.0/3600+122+47.0/60)/2;#mean horizontal angle\nAZ=360-Mh-A;\nAZ=deg_to_dms(AZ);\n\n#result\nprint \"Azimuth from north(clockwise) in degree,minites,seconds respectively\",AZ",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "[117, 0, 19.45] Azimuth from north(clockwise) in degree,minites,seconds respectively\n"
      }
     ],
     "prompt_number": 55
    }
   ],
   "metadata": {}
  }
 ]
}