{ "metadata": { "name": "Chapter 1" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 2, "metadata": {}, "source": "FIELD ASTRONOMY" }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.1, Page 30" }, { "cell_type": "code", "collapsed": false, "input": "#finding difference of longitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin\n#part1\na =40; # longitude of A\nb =73; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);\n\n#part2\na =20; # longitude of A\nb =150; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees \",round(dol);\n\n#part3\na =-20; # longitude of A\nb =50; # longitude of B\n\n#calculation\ndol =b-a; # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);\n\n#part4\na =-40; # longitude of A\nb =150; # longitude of B\n\n#calculation\ndol =360-(b-a); # difference of longitude\n\n#result\nprint \" difference of longitude is in degrees\",round(dol);", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " difference of longitude is 33.0\n difference of longitude is 130.0\n difference of longitude is 70.0\n difference of longitude is 170.0\n" } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.2.1,Page 31" }, { "cell_type": "code", "collapsed": false, "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos\nlatA =28.0+42.0/60.0; # latitude of A\nlonA =31.0*60.0+12.0; # longitude of A\nlatB =28.0+42.0/60.0; # latitude of B\nlonB =47.0*60.0+24.0; # longitude of B\n\n#calculation\nd=( lonB - lonA )*cos( latA /180* pi);\n\n#result\nprint \" distance between A & B in (km) \",round(d *1.852,3)", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " distance between A & B in (km) 1578.989\n" } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.2.2,Page 31" }, { "cell_type": "code", "collapsed": false, "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos\nlatA =12.0+36.0/60.0; # latitude of A\nlonA =115.0*60.0+6.0; # longitude of A\nlatB =12.0+36.0/60.0; # latitude of B\nlonB =-150.0*60.0-24.0; # longitude of B\n\n#calculation\nd=( 360*60+lonB - lonA )*cos( latA /180* pi);\n\n#result\nprint \" distance between A & B in (km) \",round(d *1.852,3) ", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " distance between A & B in (km) 10247.946\n" } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.3,Page 31" }, { "cell_type": "code", "collapsed": false, "input": "#finding distance between two points\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nlatA =15;\nlatB =12.0+6.0/60.0;\nlonA =50.0+12.0/60.0;\nlonB =54.0;\nRe =6370.0; # radius of earth\n\n#calculation\nb=(90 - latA )*pi /180;\na=(90 - latB )*pi /180;\nP=( lonB - lonA )*pi /180;\np= acos ( cos (P)*sin(a)* sin (b)+ cos (a)*cos(b)); #spherical triangle law\nx= atan ( cos (a/2-b/2)/ cos (a/2+b /2) * tan (pi /2-P /2) );#spherical triangle law \ny= atan ( sin (a/2-b/2)/ sin (a/2+b /2) * tan (pi /2-P /2) ); #spherical triangle law\ndol =pi -x-y;\ndol=dol*180/pi;\na= dol *3600 %60;\nb= ((dol *3600 -a)%3600) /60;\nc=( dol *3600 - b*60 -a) /3600;\n\n#result\nprint \" distance from A to B in (km) \",round(p*Re,3);\nprint \" direction of B from A towards east of south \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " distance from A to B in (km) 522.104\n direction of B from A towards east of south 35.16 seconds 19.0 minutes 52.0 degrees\n" } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.4,Page 33" }, { "cell_type": "code", "collapsed": false, "input": "#finding distance between two points\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]\nlatA =45.0;\na1=45.0+13.108/60;\np =(300.0/60.0) *pi /180; # side AB\nb=(90 - latA )*pi /180; # side PA\n\n# calculation\na= acos ( cos (p)*cos(b)); # side BP\nBC=a *180/ pi - latA ;\nd=BC *1.852*60;\nB=asin(sin(latA*pi/180)/sin(a1*pi/180));\nB=deg_to_dms(B*180/pi);\n\n\n#result\nprint \" distance of BC in (km)\",round(d,3)\nprint \"the angle in deg,min,sec is\",B", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " distance of BC in (km) 24.181\nthe angle in deg,min,sce is [85, 0, 33.27]\n" } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.6.1,Page 37" }, { "cell_type": "code", "collapsed": false, "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =42+15.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta -90+ delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\n#a= zend *3600 %60;\nb= ((zend *3600 )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " zenith distance 0.0 seconds 35.0 minutes 15.0 degrees\n altitude of star 0.0 seconds 25.0 minutes 74.0 degrees\n" } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.6.2,Page 36" }, { "cell_type": "code", "collapsed": false, "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =23+20.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 + theta -90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600 -a)%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\n\nb= ((alt *3600 )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " zenith distance 0.0 seconds 20.0 minutes 3.0 degrees\n altitude of star 0.0 seconds 40.0 minutes 86.0 degrees\n" } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.6.3,Page 37" }, { "cell_type": "code", "collapsed": false, "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =65+40.0/60; # declination of star\ntheta =26+40.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta -90+ delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600 -a)%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " zenith distance 0.0 seconds 0.0 minutes 39.0 degrees\n altitude of star 0.0 seconds 0.0 minutes 51.0 degrees\n" } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.7,Page 37" }, { "cell_type": "code", "collapsed": false, "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =85+20.0/60; # declination of star\ntheta =46+50.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta +90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\n\nb= ((zend *3600 )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\na= alt *3600 %60;\nb= ((alt *3600 -a)%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " zenith distance 0.0 seconds 50.0 minutes 47.0 degrees\n altitude of star 0.0 seconds 10.0 minutes 42.0 degrees\n" } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.8,Page 38" }, { "cell_type": "code", "collapsed": false, "input": "#finding altitude and zenith distance of star\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =56+10.0/60; # declination of star\ntheta =56+10.0/60; # lattude of star\n\n#caculation\nzend =90.0 - theta +90- delta ;\nalt =90.0 - zend ;\n\n#for zenith distance\na= zend *3600 %60;\nb= ((zend *3600-a )%3600) /60;\nc=( zend *3600 - b*60 -a) /3600;\nprint \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for altitude\n#a= alt *3600 %60;\nb= ((alt *3600 )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " zenith distance 0.0 seconds 40.0 minutes 67.0 degrees\n altitude of star 0.0 seconds 20.0 minutes 22.0 degrees\n" } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.9,Page 38" }, { "cell_type": "code", "collapsed": false, "input": "#finding latitude and declination \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nimport numpy as np\na=np.array([[1.0,-1.0],[1.0,1.0]])\nb=np.array([59.0/3,332.0/3])\n\n#calculation\nx=np.linalg.solve(a,b);\n\n#result\nprint\"declination of star in (degrees)\",round(x[0],3);\nprint\"latitude of the place of observation (degrees)\",x[1];", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "declination of star in (degrees) 65.167\nlatitude of the place of observation (degrees) 45.5\n" } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.10,Page 39" }, { "cell_type": "code", "collapsed": false, "input": "#finding azimuth and altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntheta =20+30.0/60;\nH =42+6.0/60; # hour angle\ndelta =50.0;\n\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nH=H*pi /180;\nPM =(90 - theta )*pi /180;\nZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\nalpha =pi /2- ZM;\nalpha = alpha *180/ pi;\nA =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n\nif A <0:\n A=-A;\n A=acos(A)\n A=180-A*180/pi;\n \n\n#for altitude\nalt=alpha;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n\n#for azimuth \na= A *3600 %60;\nb= ((A *3600-a )%3600) /60;\nc=( A *3600 - b*60 -a) /3600;\nprint\" azimuth of star in (degrees ) westwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " altitude of star 36.75 seconds 38.0 minutes 45.0 degrees\n azimuth of star in (degrees ) westwards 25.551 seconds 4.0 minutes 116.0 degrees\n" } ], "prompt_number": 32 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.11,Page 40" }, { "cell_type": "code", "collapsed": false, "input": "#finding azimuth and altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntheta = -8 -30.0/60;\nH =322.0; # hour angle\ndelta =50;\n\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nH =2* pi -H*pi /180;\nPM =(90 - theta )*pi /180;\nZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\nalpha =pi /2- ZM;\nalpha=alpha*180/pi;\nA =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n\nif A <0:\n A=-A;\n A=acos(A)\n A=180-A*180/pi;\n \n#result\n#for altitude\nalt=alpha;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n\n#for azimuth \na= A *3600 %60;\nb= ((A *3600-a )%3600) /60;\nc=( A *3600 - b*60 -a) /3600;\nprint\" azimuth of star in (degrees ) eastwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " altitude of star 48.256 seconds 48.0 minutes 22.0 degrees\n azimuth of star in (degrees ) eastwards 22.798 seconds 39.0 minutes 138.0 degrees\n" } ], "prompt_number": 31 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.12,Page 42" }, { "cell_type": "code", "collapsed": false, "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nalpha =22+36.0/60; # altitude of star\nA =42.0 # azimuth angle\ndelta =40.0; # latitude of observer\n\n# in triangle ZPM\n\n#calculation\nPZ =(90 - delta )*pi /180;\nA=A*pi /180;\nZM =(90 - alpha )*pi /180;\nPM= acos (( cos (PZ)* cos (ZM)+sin(ZM)*sin(PZ)* cos (A)));\ntheta =pi /2- PM\ntheta=theta*180/pi;\nH =(( cos(ZM)-cos (PZ)* cos (PM))/ sin (PZ)/sin(PM));\nif H <0:\n H=-H;\n H=acos(H)\n H=180-H*180/pi;\n \n\n#result\n#for declination \nalt=theta;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" declination of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for hour angle\na= H *3600 %60;\nb= ((H *3600-a )%3600) /60;\nc=( H *3600 - b*60 -a) /3600;\nprint\" hour angle of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " declination of star 12.44 seconds 35.0 minutes 50.0 degrees\n hour angle of star 5.342 seconds 21.0 minutes 103.0 degrees\n" } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.13,Page 42" }, { "cell_type": "code", "collapsed": false, "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\nalpha =21+30.0/60; # a l t i t u d e o f s t a r\nA =140.0 # azimuth a n g l e\ndelta =48.0; # l a t i t u d e o f o b s e r v e r\n\n#calculation\nPZ =(90 - delta )*pi /180;\nA=A*pi /180;\nZM =(90 - alpha )*pi /180;\nPM =( cos(PZ)*cos(ZM)+ sin (ZM)* sin (PZ)* cos (A));\n\nif PM <0:\n PM=-PM\n PM=acos(PM)\n PM=180-PM*180/pi;\n\nH= acos (( cos (ZM)-cos(PZ)*cos(PM*pi /180) )/ sin (PZ)/sin (PM*pi /180) );\nH =2* pi -H;\nH=H*180/pi;\n\n#result\n#for declination \nalt=PM-90;\na= alt *3600 %60;\nb=((alt *3600-a )%3600) /60;\nc=( alt *3600 - b*60 -a) /3600;\nprint \" declination of star southwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n\n#for hour angle\na= H *3600 %60;\nb= ((H *3600-a )%3600) /60;\nc=( H *3600 - b*60 -a) /3600;\nprint\" hour angle of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " declination of star southwards 12.098 seconds 48.0 minutes 11.0 degrees\n hour angle of star 22.619 seconds 20.0 minutes 322.0 degrees\n" } ], "prompt_number": 44 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.14,Page 43" }, { "cell_type": "code", "collapsed": false, "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\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# part 1\ndelta =22+12.0/60;\ntheta =42+30.0/60;\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H\n\n#part 2\ndelta = -22 -12/60;\ntheta =42+30.0/60;\n\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " azimuth of setting sun in ( degrees,min,second) [59, 10, 14.72]\n suns hour angle in ( hr,min,second ) : [7, 27, 50.23]\n azimuth of setting sun in ( degrees,min,second) [120, 32, 13.17]\n suns hour angle in ( hr,min,second ) : [4, 33, 4.97]\n" } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.15,Page 44" }, { "cell_type": "code", "collapsed": false, "input": "#finding hour angle\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndelta =22+12.0/60;\ntheta =42+30.0/60;\nef 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\n#calculation\nZP =(90 - theta )*pi /180;\nPM =(90 - delta )*pi /180;\nA= acos ( cos (PM)/sin(ZP));\nH=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\nA=deg_to_dms(180-A*180/ pi);\nH=deg_to_dms(H/15);\n\n#result\nprint \" azimuth of setting sun in ( degrees,min,second) \",A\nprint \" suns hour angle in ( hr,min,second ) : \",H\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " azimuth of setting sun in ( degrees,min,second) [120, 49, 45.28]\n suns hour angle in ( hr,min,second ) : [7, 27, 50.23]\n" } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.16,Page 61" }, { "cell_type": "code", "collapsed": false, "input": "#finding error in time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ntime = -3 -28.41/60; # greenwich time at july 1 1951\nchange = -11.82/60;\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\n#calculation\nc12 = change/24*12 # change of time in 12 hours\ntch =time +c12;\ntch=deg_to_dms(tch/60);\n\n#result\nprint \" greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) \",tch\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) [0, 3, 34.32]\n" } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.17,Page 61" }, { "cell_type": "code", "collapsed": false, "input": "#finding GAT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\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 return [d, m, sd]\n#printing result in degree minute and seconds respectively \nGMN = -14*60 -10;\nchangeET =1*1.5;\n\n#calculation\nneterr =GMN+ changeET ;\nGAT = time + neterr ;\nGAT=GAT+10*3600+30*60;\nhr= round ( GAT /3600) ;\nb=GAT -hr *3600;\nmi= round (b /60 -1);\nc=GAT -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of GAT\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "10.0 hour 15.0 minutes 48.0265 seconds of GAT\n" } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.18,Page 62" }, { "cell_type": "code", "collapsed": false, "input": "#finding time\n\n#part1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\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 return [d, m, sd]\nA =50+12.0/60+48.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600) ;\nb=time -hr *3600;\nmi= round (b /60 -1);\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n\n#part 2\n#initialisation of variable\nA =8+18.0/60+6.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600-1) ;\nb=time -hr *3600;\nmi= round (b /60 );\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n\n#part 3\n#initialisation of variable\nA =258+36.0/60+30.0/3600;\ntime =A /15*3600\n\n#calculation\nhr= round ( time /3600) ;\nb=time -hr *3600;\nmi= round (b /60 );\nc=time -hr *3600 - mi *60;\n\n#result\nprint hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "3.0 hour 20.0 minutes 51.2 seconds of angles\n-0.0 hour 33.0 minutes 12.4 seconds of angles\n17.0 hour 14.0 minutes 26.0 seconds of angles\n" } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.19,Page 62" }, { "cell_type": "code", "collapsed": false, "input": "#finding angle\n\n#part1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nA =4+34.0/60+13.0/3600;\n\n#calculation\nangle =A *15;\nangle=deg_to_dms(angle);\n\n#result\nprint \"angle in degree,minute,second respectively\",angle\n\n#part 2\n#initialisation of variable\nA =18+11.0/60+38.0/3600;\n\n#calculation\nangle =A *15;\nangle=deg_to_dms(angle);\n\n#result\nprint \"angle in degree,minute,second respectively\",angle\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "angle in degree,minute,second respectively [68, 33, 15.0]\nangle in degree,minute,second respectively [272, 54, 30.0]\n" } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.20.a,Page 64" }, { "cell_type": "code", "collapsed": false, "input": "#finding local mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =20 # longitude of the place\nlongSM =82+30.0/60; # longitude of standard meridion\n\n#calculation\ndolong =longSM - longP ; # difference in longitude\ndot = dolong /15.0; # difference in time\nLMT =20+24.0/60+6.0/3600 - dot ;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[16, 14, 6.0] Local mean time in hours,minute,second respectively\n" } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.20.b,Page 64" }, { "cell_type": "code", "collapsed": false, "input": "#finding local mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =-20 # longitude of the place\nlongSM =82+30.0/60; # longitude of standard meridion\n\n#calculation\ndolong =longSM - longP ; # difference in longitude\ndot = dolong /15.0; # difference in time\nLMT =20+24.0/60+6.0/3600 - dot ;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[13, 34, 6.0] Local mean time in hours,minute,second respectively\n" } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.21.a,Page 64" }, { "cell_type": "code", "collapsed": false, "input": "#finding GMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =9+40.0/60+12.0/3600;\nlongP = -42 -36.0/60;\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[12, 30, 36.0] GMT in hours,minute,second respectively\n" } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.21.b,Page 64" }, { "cell_type": "code", "collapsed": false, "input": "#finding GMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =4+32.0/60+10.0/3600;\nlongP = -56 -32.0/60;\n\n#calculation\ndot = longP /15;\nGMT =LMT +dot;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[0, 46, 2.0] GMT in hours,minute,second respectively\n" } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.22,Page 65" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\n#part1\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =72+30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n\n#part 2\n#initiallisation of variable\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =-72-30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n\n#part 3\n#initialisation of variable\ndef deg_to_dms(deg):\n d = int(deg);\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d-24, m, sd]\nGCT =18+40.0/60+12.0/3600; # greenwich civil time\nlongP =110+32.0/60; # longitude of the place\n\n#calculation\ndot = longP /15.0;\nLMT = GCT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of next day in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "LMT in hours,minute,second respectively [23, 30, 12.0]\nLMT in hours,minute,second respectively [13, 50, 12.0]\nLMT of next day in hours,minute,second respectively [2, 2, 20.0]\n" } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.23,Page 66" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =10+20.0/60+30.0/3600; # local mean time\nlongP =102+30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nmGMN =12 - GMT ; #mean time interval\ni= mGMN *0.32/3600; # increase in mGMN\nETGMN =5.0/60+4.35/3600;\nch=i+ ETGMN ; # change in GMT\nGMT =ch+GMT;\nLMT = GMT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[10, 25, 37.07] LMT in hours,minute,second respectively\n" } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.24,Page 67" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLMT =15+12.0/60+40.0/3600; # local mean time\nlongP = -20 -30.0/60; # longitude of the place\n\n#calculation\ndot = longP /15;\nGMT =LMT -dot;\nmGMN =12 - GMT ; #mean time interval\ni= mGMN *0.32/3600; # increase in mGMN\nETGMN =5.0/60+4.35/3600;\nch=i+ ETGMN ; # change in GMT\nGMT =ch+GMT;\nLMT = GMT +dot;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[15, 17, 42.89] LMT in hours,minute,second respectively\n" } ], "prompt_number": 29 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.25,Page 70" }, { "cell_type": "code", "collapsed": false, "input": "#finding sidereal time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\ntime =4+20.0/60+30.0/3600;\n\n#calculation\naccn = time *9.8565/3600; # acceleration\nstime = time + accn ; # sidereal time\nstime=deg_to_dms(stime);\n\n#result\nprint \"sidereal time in hours,minute,second respectively\",stime", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[4, 21, 12.79] sidereal time in hours,minute,second respectively\n" } ], "prompt_number": 30 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.26,Page 71" }, { "cell_type": "code", "collapsed": false, "input": "#finding mean time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nstime =8+40.0/60+50.0/3600;\n\n#calcculation\naccn =-time *9.8565/3600; # acceleration\nmtime = stime + accn ; # mean time\nmtime=deg_to_dms(mtime);\n\n#result\nprint \"mean time in hours,minute,second respectively\",mtime", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[8, 40, 7.21] mean time in hours,minute,second respectively\n" } ], "prompt_number": 32 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": "Example 1.27,Page 72" }, { "cell_type": "code", "collapsed": false, "input": "#finding LST on LMM\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP = -160 -30.0/60 -30.0/3600; # longitude of the place\nGST =16+30.0/60+12.0/3600; # standard time\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GST -i;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of LMM in hours,minute,second respectively\",LST\n\n#part 2\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP = 160 +30.0/60 +30.0/3600; # longitude of the place\nGST =16+30.0/60+12.0/3600; # standard time\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GST -i;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of LMM in hours,minute,second respectively\",LST\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[16, 31, 57.47] LST of LMM in hours,minute,second respectively\n[16, 28, 26.53] LST of LMM in hours,minute,second respectively\n" } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.28,Page 73" }, { "cell_type": "code", "collapsed": false, "input": "#finding LST \n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =85+20.0/60; # longitude of the place\nGST =6+30.0/60; # standard time\nGMN =6+32.0/60+12.0/3600;\n\n#calculation\ndot = longP /15; # difference in time\ni= dot *9.8565/3600; # error\nLST =GMN -i; #LST at L .M.N\ni2=GST *9.8565/3600; # error in GST\nLST2 =GST+i2;\nLST = LST + LST2 # lst at L .M.N\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hours,minute,second respectively\",LST", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[13, 2, 19.99] LST in hours,minute,second respectively\n" } ], "prompt_number": 38 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.29,Page 75" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =112+20.0/60+15.0/3600; # longitude of the place\nGST =8+10.0/60+28.0/3600; #GST at GMM\nlst =18+28.0/60+12.0/3600; \n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # error\nLST = GST +i; #LST at L .M.N\nLMM =lst -LST;\ni2=LMM *9.8565/3600; # error in LMM\nLMT =LMM -i2; # local mean time\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[10, 14, 48.91] LMT in hours,minute,second respectively\n" } ], "prompt_number": 40 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.30,Page 76" }, { "cell_type": "code", "collapsed": false, "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =85+20.0/60; # longitude of the place\nGST =18+30.0/60; # standard time\ngst =6+32.0/60+12.0/3600; #GST at GMN\n\n#calculation\ndot = longP /15; \nGMT =GST -dot -12;\ni= GMT *9.8565/3600; # error\nGMT = GMT +i; # SI time\nLST = GMT +dot+ gst ; #LST at LMT\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hours,minute,second respectively\",LST", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[13, 2, 19.99] LST in hours,minute,second respectively\n" } ], "prompt_number": 42 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.31,Page 78" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =112+20.0/60+15.0/3600; # longitude of the place\nGST =8+10.0/60+28.0/3600; #GST at GMM\nlst =18+28.0/60+12.0/3600; # local sidereal time\n\n#clculation\ndot = longP /15; \ngmm = lst +dot - GST ; # SI at GMM\ni= gmm *9.8565/3600; # error\ngmm =gmm -i; #LST at L .M.N\nLMT =gmm -dot; # local mean time\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[10, 14, 48.7] LMT in hours,minute,second respectively\n" } ], "prompt_number": 44 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.32,Page 79" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#part 1\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =162+30.0/60+15.0/3600; # longitude of the place\nGST =10+30.0/60+15.0/3600; #GST at GMM\nRA =22+11.0/60+30.0/3600; # local sidereal time\n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # e r r o r\ngmm = GST +i; #LST at L .M.N\nlmn =RA -gmm; # SI o f LMN\ni2=lmn *9.8565/3600; # error 2\nLMT =lmn -i2;\nLMT1=deg_to_dms(LMT);\n\n#result\nprint \"LMT observed at upper transit in hours,minute,second respectively\",LMT1\n\n#part 2\n#initialisation of variable\ni3 =12*9.8565/3600; # retardation\n\n#calculation\nLMT = LMT +12 - i3;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT observed at lower transit in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "LMT observed at upper transit in hours,minute,second respectively [11, 37, 33.31]\nLMT observed at lower transit in hours,minute,second respectively [23, 35, 35.04]\n" } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.33,Page 80" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =60+30.0/60; # longitude of the place\nGST =7+30.0/60+48.6/3600; #GST at GMM\nRA =17+28.0/60 +40.0/1600;\n\n#calculation\ndot = longP /15; \ni= dot *9.8565/3600; # error\ngmm =GST -i; #LST at L .M.N\nLMT =RA -gmm; # local mean time\ni2=LMT*9.8296/3600;\nGMT=LMT-i2-longP/15;\nLMT=deg_to_dms(LMT);\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT\nprint \"GMT in hours,minute,second respectively\",GMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "LMT in hours,minute,second respectively [9, 59, 21.15]\nGMT in hours,minute,second respectively [5, 55, 42.96]\n" } ], "prompt_number": 42 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.34,Page 82" }, { "cell_type": "code", "collapsed": false, "input": "#finding correct time\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=13+21.0/60+54.0/3600; #GMT of the place\nLongA=40+30.0/60; #longitude of A\nLongB=-40-30.0/60; #longitude of B\n\n#calculation\ndelA=LongA/15.0*9.8296/3600;#error\ndelB=LongB/15.0*9.8296/3600;#error\nGA=GMT+delA;\nGA=deg_to_dms(GA);\nGB=GMT+delB;\nGB=deg_to_dms(GB);\n\n#result\nprint \"corected time of A in hours,minute,second respectively\",GA\nprint \"corected time of B in hours,minute,second respectively\",GB", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "corected time of A in hours,minute,second respectively [13, 22, 20.54]\ncorected time of B in hours,minute,second respectively [13, 21, 27.46]\n" } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.35,Page 83" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=7+12.0/60+28.0/3600; #GMT of the place\nLong=50+30.0/60; #longitude \nLMT=11+30.0/60+12.0/3600; \n\n#calculation\ndelA=LongA/15.0*9.8296/3600;#error\ndelB=LMT*9.8296/3600;#error\nLA=GMT+delA; #LMT at transit\nLMT=LMT-delB;\nLMT=LMT+LA;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hours,minute,second respectively\",LMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "LMT in hours,minute,second respectively [18, 41, 13.47]\n" } ], "prompt_number": 41 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.36,Page 84" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGST=8+25.0/60+25.0/3600;\n\n#calculation\nGMT=24-GST;\ni=GMT*9.8296/3600;\nGMT=GMT-i;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hours,minute,second respectively\",GMT", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "GMT in hours,minute,second respectively [15, 32, 1.89]\n" } ], "prompt_number": 43 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.37,Page 85" }, { "cell_type": "code", "collapsed": false, "input": "#finding LMT on July 2\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nGMT=12+03.0/60+46.09/3600; #GMT of the place\nLongA=-130.0; #longitude of A\nLongB=49.0; #longitude of B\n\n#calculation\ndelA=LongA/15.0*11.71/24/3600;\ndelB=LongB/15.0*11.71/24/3600;\nLMTA=GMT+delA;\nLMTA=deg_to_dms(LMTA);\nLMTB=GMT+delB;\nLMTB=deg_to_dms(LMTB);\n\n#result\nprint \"LMT at A on July 2 in hours,minute,second respectively\",LMTA\nprint \"LMT at B on July 2 in hours,minute,second respectively\",LMTB", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[12, 3, 41.86] LMT at A in hours,minute,second respectively\n[12, 3, 47.68] LMT at B in hours,minute,second respectively\n" } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.38,Page 86" }, { "cell_type": "code", "collapsed": false, "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLat=50+30.0/60; # latitude of place\nDec=74+22/60; #declination of place\nRA=14+50.0/60+52.0/3600;\n\n#calculation\nH=acos(tan(Lat*pi/180)/tan(Dec*pi/180));\nH=H*180/pi;\nH=H/15.0;\nLST=H+RA;\nLST=deg_to_dms(LST);\n\n#result \nprint \"LST in hours,minute,second respectively\",LST", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[19, 29, 26.59] LST in hours,minute,second respectively\n" } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.39,Page 87" }, { "cell_type": "code", "collapsed": false, "input": "#finding HA\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=120+30.0/60; #langitude\nGST=14+30.0/60+28.25/3600;\nGMT=2+5.0/60;\nLMN=12.0;\nLST=14+31.0/60+47.43/3600;\nRA=23+20.0/60+20.0/3600;\n\n#calculation\ne1=Long*15.0*9.8565/3600;\nGST=GST+e1;\nLMT=GMT+24-8-2.0/60;\nLMM=LMN+24-LMT; #mean LMN\ne2=LMM*9.8565/3600;\nLMM=LMM+e2;\nLST=LST+24-LMM;\nHA=LST-RA+24;\nHA=deg_to_dms(HA);\n\n#result\nprint \"HA in hours,minutes,seconds respectively\",HA", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[21, 11, 30.51] HA in hours,minutes,seconds respectively\n" } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.40,Page 86" }, { "cell_type": "code", "collapsed": false, "input": "#finding HA\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=75+28.0/60; #langitude\nLMT=5+30.0/60;\nGST=20+15.0/60+32.58/3600;\n\n#calculation\ne1=Long/15.0*9.8565/3600;\nGST=GST+e1;\ne2=LMT*9.8565/3600;\nLMT=LMT+e2;\nHA=GST+LMT;\nHAMS=HA-LMT-12+e2;\nHA=deg_to_dms(HA);\nHAMS=deg_to_dms(HAMS);\n\n#result\nprint \"HA in hours,minutes,seconds respectively\",HA\nprint \"HAMS in hours,minutes,seconds respectively\",HAMS\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "HA in hours,minutes,seconds respectively [25, 47, 16.38]\nHAMS in hours,minutes,seconds respectively [8, 17, 16.38]\n" } ], "prompt_number": 40 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.41,Page 90" }, { "cell_type": "code", "collapsed": false, "input": "#finding sun's declination\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nLong=45.0; #langitude\ndel1=1067.2/3600;\ndel2=1083.9/3600;\ndel3=1100.3/3600;\nf0=-16-14.0/60-24.0/3600;\n\n#calculation\nn=(10-Long/15)/24.0;\nDel0=del2-del1;\nDel1=del3-del2;\nfn=-f0+n*del2+n*(n-1)/4*(Del0+Del1)\nfn=deg_to_dms(fn);\n\n#result\nprint \"sun's declination in hours,minutes,seconds respectively\",fn", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "sun's declination in hours,minutes,seconds respectively [16, 19, 38.43]\n" } ], "prompt_number": 39 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.42,Page 101" }, { "cell_type": "code", "collapsed": false, "input": "#finding azimuth of A & B and vertical difference\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\naziA =32+41.0/60+30.0/3600; # azimuth o f A\naziB =110+28.0/60+42.0/3600; # azimuth o f B\nvaA =10+21.0/60+12.0/3600; # vertical angle of A\nvaB = -2 -18.0/60 -30.0/3600; # vertical angle o f B\nlA1 =11;\nlB1 =11.5;\nrA1 =7.5;\nrB1 =7;\nlB2 =10;\nlA2 =10.5;\nrB2 =7.5;\nrA2 =8;\nd =20;\n# partA\n#calculation\nsigl =lA1+ lA2 ;\nsigr =rA1+ rA2 ;\nb= sigl /4*d- sigr /4*d;\ni= tan( vaA );\ncaziA = aziA +i *29.95/3600;\ncaziA1=deg_to_dms(caziA);\n\n#result\nprint \"corrected azimuth of A in (degrees,minutes,seconds)\",caziA1\n\n#part2 \n#calculation\ni= tan( vaB );\ncaziB = aziB +i*b /3600;\nha=caziB - caziA;\ncaziB=deg_to_dms(caziB);\nha=deg_to_dms(ha);\n\n#result\nprint \"corrected azimuth of B in (degrees,minutes,seconds)\",caziB\nprint \"horizontal difference of angle between A & B in (degrees,minutes,seconds)\",ha\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "corrected azimuth of A in (degrees,minutes,seconds) [32, 42, 10.04]\ncorrected azimuth of B in (degrees,minutes,seconds) [110, 29, 15.02]\nhorizontal difference of angle between A & B in (degrees,minutes,seconds) [77, 47, 4.98]\n" } ], "prompt_number": 38 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.43,Page 102" }, { "cell_type": "code", "collapsed": false, "input": "#finding altitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nv1 =18+36.0/60+48.0/3600; # vertical angle 1\nv2 =18+35.0/60+56.0/3600; # vertical angle 2\nslm =28+36.0/60+20.0/3600; # altitude of sun measured\nds =15.0/60+59.35/3600; # dia of sun\n\n#calculation\nmv =( v1+v2) /2; #mean vertical angle\ni=v1 -v2; # error\nsl=slm+i; #new altitude of sun\nsl=sl+ds;\nir = -57.0/3600/( tan( slm *pi /180+26* pi /180/3600) );#error due to refraction\nsl=sl+ir;\nip =8.8/3600* cos( slm *pi /180+26* pi /180/3600);# error due to parallex\nsl=sl+ip;\nsl=deg_to_dms(sl);\n\n#result\nprint \"corrected altitude in (deg,min,sec) respectively\",sl", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[28, 51, 34.59] corrected altitude in (deg,min,sec) respectively\n" } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.44,Page 115" }, { "cell_type": "code", "collapsed": false, "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nlong =4+30.0/60;\ni= long *9.8565/3600; # longitude\ngst =14+38.0/60+12.0/3600; #GST on GMM\nlst =gst -i; #LST on LMM\nRA =7+36.0/60+21.24/3600;\n\n#calculation\nLST =RA;\nSI=LST - lst +24;\nLCT =17+56.0/60+8.86/3600 -1; # local chronometer time\ni2=SI *9.8296/3600;\nLMM =SI -i2;\nce=LCT - LMM ;\n\n#result\nprint \" chronometer error in (s)\",round(ce *3600,2)", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "2.19 chronometer error in (s)\n" } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Exampe 1.45,Page 116" }, { "cell_type": "code", "collapsed": false, "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc =90 -36 -30.0/60 -30.0/3600; # co latitude\np =90 -16 -12.0/60 -18.4/3600; # co declination\nz =90 -30 -12.0/60 -30.0/3600; # co altitude\ns=(p+z+c) /2;\n\n#calculation\ns1=s-c;\ns2=s-p;\ns3=s-z;\nH =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin (s*pi/180) / sin (s3*pi /180) ));\nH=H *180/ pi;\nH=24 -H /15;\nLST =H +5+18.0/60+12.45/3600 -24;\nce =1+2.0/60+5.25/3600 - LST ;\n\n#result\nprint \" chronometer error in (s)\",round (ce *3600+2,2)", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "19.34 chronometer error in (s)\n" } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": "Example 1.46,Page 118" }, { "cell_type": "code", "collapsed": false, "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nc =90 -36 -40.0/60 -30.0/3600; # co latitude\np =90 -17 -26.0/60 -42.1/3600; # co declination\nz =90 -36 -14.0/60 -16.8/3600; # co altitude\n\n#calculation\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nH =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin(s*pi/180) / sin (s3*pi /180) ));\nH=H *180/ pi;\nH=H /15;\ni =12 -11 -56.0/60 -22.8/3600; # error in time\nLAT =15+49.0/60+40.6/3600; # local actual time\nGAT =LAT -H;\nGMT =GAT -i;\nLMT = GMT +H;\nce =15+49.0/60+12.6/3600 - LMT;\nce=deg_to_dms(ce)\n\n#result\nprint \" chronometer error in (s)\",ce", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " chronometer error in (s) [0, 3, 9.2]\n" } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.47,Page 119" }, { "cell_type": "code", "collapsed": false, "input": "#finding chronometer error\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = round((md - m) * 60,2)\n return [d, m, sd]\nRA =17+12.0/60+48.0/3600;\ngst =9+26.0/60+12.0/3600; #GST on GMN\nlong =138.0/15+45.0/15/60; # l o n g i t u d e\nlst =- long *9.85645/3600+9+26.0/60+12.0/3600; #LST on LMN\nLST =17+12.0/60+48.0/3600; # local sidereal time\n\n#calculation\nSI=LST - lst ;\nMI=-SI *9.8296/3600+ SI;\nLCT =7+47.0/60+2.0/3600; # local chronometer time\nce=LCT -MI;\n\n#result\nprint \" chronometer error in (s)\",round(ce *3600,2) ", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " chronometer error in (s) 11.52\n" } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.48,Page 145" }, { "cell_type": "code", "collapsed": false, "input": "#finding azimuth,latitude,LMT\n\n#part 1\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 = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =54+30.0/60; # l o g i t u d e\ndelta =62+12.0/60+21.0/3600; # d e c l i n a t i o n\n\n#calculation\nlat = asin (sin( theta *pi /180) /sin( delta *pi /180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\n\n#part 2\n#initialisation of variable\nA =53+25.0/60; # azimuth of star\nh =65+18.0/60+42.0/3600; # horizontal angle\n\n#calculation\nA=A+h;\nA=360-A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\n\n#part 3 \n#initialisation of variable\nlst =4+39.0/60+6.5/3600; #LST o f LMN\nLST =10+58.0/60+38.0/3600+2+49.0/60+25.3/3600; #LST of observation\n\n#calculation\nLMN =LST -lst;\ni= LMN *9.8565/3600; # e r r o r\nLMT =LMN -i;\nLMT=deg_to_dms(LMT)\n\n#results\nprint \"LMT in (hr,min,sec)\",LMT;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[66, 58, 7.13] Latitude in (deg,min,sec)\n[241, 16, 18.0] Azimuth in (deg,min,sec)\n[9, 7, 26.62] LMT in (hr,min,sec)\n" } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.49,Page 148" }, { "cell_type": "code", "collapsed": false, "input": "#finding azimuth,latitude,LMT\n\n#part 1\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 = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =53+32.0/60; # logitude\ndelta =56+42.0/60+53.2/3600; # declination\nlat = asin (sin ( theta *pi /180) /sin( delta *pi /180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\n\n#part 2\n#initialisation of variable\nAs= asin ( cos ( delta *pi /180) /cos ( theta *pi /180) ); #azimuth of star\nh =75+18.0/60+20.0/3600; # angle between line and star\n\n#calculation\nA=h-As *180/ pi;\nA=360 -A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\n\n#part 3\n#initialisation of variable\nLST =10+58.0/60+3.9/3600+22+10.0/60+38.5/3600 -24; #LST of observation\nlong =5+40.0/60+18.0/3600; # longitude\n\n#calculation\ni= long *9.8565/3600; # error\nlst =4+58.0/60+23.84/3600+ i; #LST on LMN\nLMM =LST -lst;\ni2=LMM *9.8565/3600; # error in LMM\nLMT =LMM -i2;\nLMT=deg_to_dms(LMT)\n\n#results\nprint \"LMT in (hr,min,sec)\",LMT;\n", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Latitude in (deg,min,sec) [74, 9, 33.08]\nAzimuth in (deg,min,sec) [352, 7, 3.66]\nLMT in (hr,min,sec) [4, 8, 41.69]\n" } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.50,Page 151" }, { "cell_type": "code", "collapsed": false, "input": "#finding 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 = round((md - m) * 60,2)\n return [d, m, sd]\nLong =(15.0+30.0/60); \nGMT =19+12.0/60+28.6/3600;\nGST=10+12.0/60+36.2/3600;\nRA=10 +12.0/60 +6.3/3600;\ntheta=35.0;\ndelta=20+6.0/60+48.4/3600;\n\n#calculation\ni= Long/15.0 *9.8656/3600; \nLSTofLMM=GST-i;\nLMT = GMT + Long/15.0 ;\ni2=LMT *9.8656/3600; # error in LMT\nSI = LMT +i2;\nLST =LSTofLMM+ SI ;\nH=LST-RA ; # hour angle\nH=H *15;\nH=360 -H;\nB=atan(tan(delta*pi/180)/cos(H*pi/180));\nB=B*180/pi;\nx=B-theta; #defined as 'B-theta'\nAs= atan ( tan ((H) *pi /180) * cos((B) *pi /180) / sin ((x)*pi /180) );#calculating azimuth \nh =36+28.0/60+18.0/3600; # angle between line and star\nA =180+ As *180/ pi -h; #azimuth\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\nprint \"there is a miscalculation in the step of calculating As thus resulted in change in answer\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Azimuth in (deg,min,sec) [55, 16, 8.27]\nthere is a miscalculation in the step of calculating As thus resulted in change in answer\n" } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.51,Page 153 " }, { "cell_type": "code", "collapsed": false, "input": "#finding 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 = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =33+35.0/60+10.0/3600; # altitude\nZM =90 - alpha ;\ndelta =22+5.0/60+35.0/3600; # declination\nPM =90 - delta ;\ntheta =52+30.0/60+20.0/3600; # latitude\nZP =90 - theta ;\n\n#calculation\nAs= acos (( cos (PM*pi /180) -cos(ZP*pi /180) * cos (ZM*pi/180) )/( sin (ZP*pi /180) *sin(ZM*pi /180) ));\nh =18+20.0/60+30.0/3600; # angle between line and star\nA=As *180/ pi+h;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Azimuth in (deg,min,sec) [115, 27, 19.68]\n" } ], "prompt_number": 35 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.52,Page 154" }, { "cell_type": "code", "collapsed": false, "input": "#finding declination,altitude\n\n#part 1\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 = round((md - m) * 60,2)\n return [d, m, sd]\nGAT =5+17.0/60+6.0/60; #GAT \ndelta =17+46.0/60+52.0/3600; # declination\n\n#calculation\ni =37.0/3600* GAT ;\ndelta =delta -i;\ndelta1=deg_to_dms(delta);\n\n#result\nprint \"Declination in (deg,min,sec)\",delta1;\n\n#part 2\n#initialisation of variable\np=90 - delta ; # co declination\naltitude =23+15.0/60+20.0/3600; # altitude of sun\ni2 =2.0/60+12.0/3600; # error due to refraction\ni3 =8.0/3600; # error due to parallax\n\n#calculation\naltitude = altitude -i2+i3;\nc =90 -55 -46.0/60 -12.0/3600; # colatitude\nz=90 - altitude ; # co altitude\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nA =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));\nA=A *180/ pi;\nA=deg_to_dms(A);\n\n#result\nprint \"Altitude in (deg,min,sec)\",A;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Declination in (deg,min,sec) [17, 43, 32.82]\nAltitude in (deg,min,sec) [92, 23, 10.67]\n" } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.53,Page 156" }, { "cell_type": "code", "collapsed": false, "input": "#finding 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 = round((md - m) * 60,2)\n return [d, m, sd]\nGMT =17+5.0/60+2.0/3600; \ni =9.8565/3600* GMT;\nGST =3+12.0/60+12.0/3600;\nwl =1+18.0/60; # west longitude\nRA =16+23.0/60+30.0/3600;\n\n#calculation\nH= GMT +i+ GST +wl -RA; # hour angle\nH=H *15;\np =90 -29 -52.0/60;\nc =90 -52 -8.0/60;\nz= acos ( cos (H*pi /180) * sin (p*pi /180) *sin(c*pi /180) + cos(p*pi /180) * cos (c*pi /180) );\nA= asin ( sin (p*pi /180) * sin (H*pi /180) /sin(z));\nA=A *180/ pi\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Azimuth in (deg,min,sec) [78, 38, 33.24]\n" } ], "prompt_number": 33 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.54,Page 157" }, { "cell_type": "code", "collapsed": false, "input": "#finding 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 = round((md - m) * 60,2)\n return [d, m, sd]\nc2 =24+30.0/60+20.0/3600;\nd2 =24+30.0/60+40.0/3600;\nc3 =25;\nd3 =25+1.0/60;\n\n#calculation\nalt =( c2+c3+d3+d2)/4;#mean observed altitude\nil =(10.6 -9.4) /4*15.0/3600; # error \nalt = alt +il;\nir = -57.0/3600/ tan (( alt *pi /180) ); # correction of refraction\nip =8.0/3600* cos (alt*pi /180) ; # correction of parallax\nalt =alt -ir+ip;#altitude corrected\nz=90 - alt;#ZM\ndelta =1+32.0/60+16.8/3600 -56.2/3600*(3.0/60+1.86/3600) ;#declination of sun\np=90 - delta ;#PM\nc =90 -36 -48.0/60 -30.0/3600;#ZP\ns=(p+z+c) /2;\ns1=s-c;\ns2=s-p;\ns3=s-z;\nA =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));#azimuth calculation\nA=A *180/ pi;\nA=A +81+59.0/60+10.0/3600;\nA=360 -A;\nA=deg_to_dms(A);\n\n#result\nprint \"Azimuth in (deg,min,sec)\",A;\nprint \"there is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Azimuth in (deg,min,sec) [170, 1, 36.93]\nthere is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\n" } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.55,Page 178" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =65+40.0/60+18.0/3600; # altitude\ndelta =53+12.0/60+10.0/3600; # declination\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; \nalpha =alpha -i;\nz=90 - alpha ; # zenith distance\nlat =delta -z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[28, 52, 2.23] Latitude in (deg,min,sec)\n" } ], "prompt_number": 58 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.56,Page 178" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =64+36.0/60+20.0/3600; # altitude\ndelta =26+12.0/60+10.0/3600; # declination\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\nalpha =alpha -i;\nz=90 - alpha ; # zenith distance\nlat = delta +z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Latitude in (deg,min,sec) [51, 36, 17.06]\n" } ], "prompt_number": 31 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.57,Page 178" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =44+12.0/60+30.0/3600; # altitude\nlongP =75+20.0/60+15.0/3600; # longitude of place\ndelta =22+18.0/60+12.8/3600; # declination of sun\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\ni2 =8.78/3600* cos( alpha ); #error due to parallax\ni3 =15.0/60+45.86/3600; #error due to semi diameter\nalpha =alpha -i+i2+i3;\nz=90 - alpha ; # zenith distance\ndelT = longP /15;\ni4 =6.82/3600* delT ; # error in time\ndelta =i4+ delta ;\nlat = delta +z;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[67, 51, 21.23] Latitude in (deg,min,sec)\n" } ], "prompt_number": 62 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.58,Page 180" }, { "cell_type": "code", "collapsed": false, "input": "#finding alpha1,alpha2\n\n#for alpha 1\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 = round((md - m) * 60,2)\n return [d, m, sd]\ntheta =80;\ndelta =46+45.0/60+30.0/3600;\n\n#calculation\nalpha1 =90 - theta + delta ;\nalpha1=deg_to_dms(alpha1);\n\n#result\nprint \"alpha1 to the north in (deg,min,sec)\",alpha1\n\n#for alpha2\n#calculation\nalpha2 = theta +delta -90;\nalpha2=deg_to_dms(alpha2)\n\n#result\nprint \"alpha2 to the south(deg,min,sec)\",alpha2", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[56, 45, 30.0] alpha1 to the north in (deg,min,sec)\n[36, 45, 30.0] lpha1 to the south(deg,min,sec)\n" } ], "prompt_number": 69 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.59,Page 181" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\ndelta1 =20+25.0/60+48.0/3600; # declination of star 1\ndelta2 =79+30.0/60+52.0/3600; # declination of star 2\nalpha1 =48+18.0/60+12.0/3600; #altitude of star 1\nalpha2 =47+54.0/60+6.0/3600; #altitude of star 2\n\n#calculation\nr1 =58.0/3600/ tan( alpha1 *pi /180) # error 1\nr2 =58.0/3600/ tan( alpha2 *pi /180) # error 2\nlat =90 -( alpha1 - alpha2 ) /2+( delta1 - delta2 ) /2+( r1 -r2)/2;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;\nprint \" there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "Latitude in (deg,min,sec) [60, 15, 24.63]\n there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer\n" } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.60,Page 182" }, { "cell_type": "code", "collapsed": false, "input": "#finding latitude,declination\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 = round((md - m) * 60,2)\n return [d, m, sd]\nalphal =18+36.0/60+40.0/3600; #altitude at lower culmination\nalphau =59+48.0/60+20.0/3600; #altitude at upper culmination\nlat =( alphal + alphau )/2;\nlat1=deg_to_dms(lat);\ndelta =90+ lat - alphau ;\ndelta1=deg_to_dms(delta);\n\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat1;\nprint \"Declination of star in (deg,min,sec)\",delta1", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[39, 12, 30.0] Latitude of star in (deg,min,sec)\n[69, 24, 10.0] Declination of star in (deg,min,sec)\n" } ], "prompt_number": 74 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.61,Page 183" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =40+36.0/60+30.0/3600; # altitude of star\ndelta =10+36.0/60+40.0/3600; # declination of star\nH =46+36.0/60+20.0/3600; # hour angle of star\n\n#calculation\nn= atan ( tan ( delta *pi /180) /cos(H*pi /180) );\nlat =n+ acos ( sin ( alpha *pi /180) *sin(n)/ sin ( delta *pi/180) );\nlat = lat *180/ pi;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[36, 49, 43.99] Latitude in (deg,min,sec)\n" } ], "prompt_number": 75 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.62,Page 183" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nalpha =42+10.0/60+40.0/3600; # altitude o f sun\ndelta =23+12.0/60+18.6/3600; # declination of sun ' s angle\nLMT =14+50.0/60;\n\n#calculation\ni =57.0/3600*1/ tan ( alpha *pi /180) ; # error\ni2 =8.78/3600* cos( alpha ); # correction due to parallax\ni3 =15.0/60+45.86/3600; # coreection due to semi diamter\nlongP =108+30.0/60; # longitude of place\nalpha =alpha -i+i2+i3;\ndelT = longP /15; # change in time\nGMT = LMT + delT ;\ni4 =1.2/3600* GMT; # error in time\nH=( GMT -12+ i4 - delT ) *15; # hour angle\ni5 =10.6/3600* GMT; # error in declination\ndelta = delta +i5;\nZM =(90 - alpha )*pi /180;\nPM =(90+ delta )*pi /180;\nA= asin ( sin (PM)/sin(ZM)* sin (H*pi /180) );\nA=pi -A;\nZP =2* atan ( sin (A/2+ H*pi /360) / sin (A/2-H*pi /360) *tan(PM/2- ZM /2) );\nlat =pi /2- ZP;\nlat = lat *180/ pi +1+6.0/60;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[1, 19, 7.46] Latitude in (deg,min,sec)\n" } ], "prompt_number": 78 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.63,Page 185" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\ndelta =15+20.0/60+48.0/3600; # declination of star\nInt =9+22.0/60+6.0/3600; # interval\n\n#calculation\ndint =Int *9.8565/3600; # change in interval\nH=( Int+ dint ) *15/2; # hour angle\nlat = atan (tan( delta *pi /180) /cos(H*pi /180) );\nlat = lat *180/ pi +5.0/6*16.0/3600;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[39, 22, 1.79] Latitude in (deg,min,sec)\n" } ], "prompt_number": 79 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.64,Page 186" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nRA =1+41.0/60+48.64/3600;\nlat =48+36.0/60+40/3600; # latitude\ndelta =88+58.0/60+28.26/3600; # declination of polaris\nGMM =16+48.0/60+20.86/3600;\nlongP =7+20.0/60; # longitude of place P\ni1 =51.0/3600; # error due to barometer\ni2 =1.0/3600; # error due to barometer\ni3 = -1.0/3600; # error due to temp\n\n#calculation\nlat =lat -i1+i2+i3;\ndelT = longP /15;\ni4= delT *9.8565/3600;\nlst = GMM +i4;\nLMT =20+24.0/60+50.0/3600;\ni6 =9.8565/3600* LMT ; # e r r o r i n LMT\nLST = LMT +i6+lst -24;\nH=LST -RA; # hour a n g l e\nH=H *15;\nlat =lat -(90 - delta )*cos(H*pi /180) +.5* sin (1/3600* pi/180) *(90 - delta ) **2*( sin (H*pi /180) )**2* tan ( lat *pi/180) ;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[49, 36, 18.45] Latitude in (deg,min,sec)\n" } ], "prompt_number": 81 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": "Example 1.65,Page 187" }, { "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 = round((md - m) * 60,2)\n return [d, m, sd]\nlongP =120 -4 -20.0/60; # longitude of point\nGST =8+30.0/60+20.0/3600; #GST on GMM\ndelta =6+15.0/60+2.0/3600; # deflection\nalpha =39+20.0/60+30.0/3600; # altitude\ntheta =56+54.0/60+30.0/3600; # longitude\n\n#calculation\ndelT = longP /15;\ni= delT *9.8565/3600; # error in time\nlst = GST +i; #LST on LMM\nLST =19+52.0/60+16.0/3600;\nRA=LST;\nLMN =LST -lst;\ni2=LMN *9.8565/3600; # error in LMN\nLMN =LMN -i2;\nOSM =10+55.0/60+30.0/3600; #Observed mean time\ni3 =1.0/60+25.0/3600; # e r r o r i n obs e r v ed t ime\nOSM =OSM -i3;\nLMT = OSM +4.0/15+21.0/60.0/15;\nI=LMN - LMT ; # interval\ni4 =1.21/3600; # error in interval\nI=I+i4;\nH=I; # hour angle\nB= cos ( delta *pi /180) * cos ( theta *pi /180) / cos ( alpha *pi/180) ;\nm =225* H **2*3600**2/2.0/206265.0;\nlat = alpha +m*B /3600;\nlat =90 - lat +6+15.0/60+2.0/3600;\nlat=deg_to_dms(lat);\n\n#result\nprint \"Latitude in (deg,min,sec)\",lat;", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "[56, 53, 17.77] Latitude in (deg,min,sec)\n" } ], "prompt_number": 85 }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }