diff options
author | debashisdeb | 2014-06-20 15:42:42 +0530 |
---|---|---|
committer | debashisdeb | 2014-06-20 15:42:42 +0530 |
commit | 83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (patch) | |
tree | f54eab21dd3d725d64a495fcd47c00d37abed004 /Surveying_Volume_3/Chapter_1_.ipynb | |
parent | a78126bbe4443e9526a64df9d8245c4af8843044 (diff) | |
download | Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.gz Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.bz2 Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.zip |
removing problem statements
Diffstat (limited to 'Surveying_Volume_3/Chapter_1_.ipynb')
-rw-r--r-- | Surveying_Volume_3/Chapter_1_.ipynb | 2837 |
1 files changed, 2597 insertions, 240 deletions
diff --git a/Surveying_Volume_3/Chapter_1_.ipynb b/Surveying_Volume_3/Chapter_1_.ipynb index 3327643c..863599de 100644 --- a/Surveying_Volume_3/Chapter_1_.ipynb +++ b/Surveying_Volume_3/Chapter_1_.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "Chapter 1" + "name": "", + "signature": "sha256:34f1fb57a7660b9339f74e6fbb3f9bfcb7a1b64529d9da2cc37598b495c31a85" }, "nbformat": 3, "nbformat_minor": 0, @@ -11,25 +12,78 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "FIELD ASTRONOMY" + "source": [ + "FIELD ASTRONOMY" + ] }, { "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.1, Page 30" + "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);", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin\n", + "#part1\n", + "a =40; # longitude of A\n", + "b =73; # longitude of B\n", + "\n", + "#calculation\n", + "dol =b-a; # difference of longitude\n", + "\n", + "#result\n", + "print \" difference of longitude is in degrees\",round(dol);\n", + "\n", + "#part2\n", + "a =20; # longitude of A\n", + "b =150; # longitude of B\n", + "\n", + "#calculation\n", + "dol =b-a; # difference of longitude\n", + "\n", + "#result\n", + "print \" difference of longitude is in degrees \",round(dol);\n", + "\n", + "#part3\n", + "a =-20; # longitude of A\n", + "b =50; # longitude of B\n", + "\n", + "#calculation\n", + "dol =b-a; # difference of longitude\n", + "\n", + "#result\n", + "print \" difference of longitude is in degrees\",round(dol);\n", + "\n", + "#part4\n", + "a =-40; # longitude of A\n", + "b =150; # longitude of B\n", + "\n", + "#calculation\n", + "dol =360-(b-a); # difference of longitude\n", + "\n", + "#result\n", + "print \" 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" + "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 @@ -38,19 +92,38 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.2.1,Page 31" + "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)", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos\n", + "latA =28.0+42.0/60.0; # latitude of A\n", + "lonA =31.0*60.0+12.0; # longitude of A\n", + "latB =28.0+42.0/60.0; # latitude of B\n", + "lonB =47.0*60.0+24.0; # longitude of B\n", + "\n", + "#calculation\n", + "d=( lonB - lonA )*cos( latA /180* pi);\n", + "\n", + "#result\n", + "print \" 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" + "text": [ + " distance between A & B in (km) 1578.989\n" + ] } ], "prompt_number": 3 @@ -59,19 +132,37 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.2.2,Page 31" + "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) ", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos\n", + "latA =12.0+36.0/60.0; # latitude of A\n", + "lonA =115.0*60.0+6.0; # longitude of A\n", + "latB =12.0+36.0/60.0; # latitude of B\n", + "lonB =-150.0*60.0-24.0; # longitude of B\n", + "\n", + "#calculation\n", + "d=( 360*60+lonB - lonA )*cos( latA /180* pi);\n", + "\n", + "#result\n", + "print \" 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" + "text": [ + " distance between A & B in (km) 10247.946\n" + ] } ], "prompt_number": 2 @@ -80,19 +171,52 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.3,Page 31" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "latA =15;\n", + "latB =12.0+6.0/60.0;\n", + "lonA =50.0+12.0/60.0;\n", + "lonB =54.0;\n", + "Re =6370.0; # radius of earth\n", + "\n", + "#calculation\n", + "b=(90 - latA )*pi /180;\n", + "a=(90 - latB )*pi /180;\n", + "P=( lonB - lonA )*pi /180;\n", + "p= acos ( cos (P)*sin(a)* sin (b)+ cos (a)*cos(b)); #spherical triangle law\n", + "x= atan ( cos (a/2-b/2)/ cos (a/2+b /2) * tan (pi /2-P /2) );#spherical triangle law \n", + "y= atan ( sin (a/2-b/2)/ sin (a/2+b /2) * tan (pi /2-P /2) ); #spherical triangle law\n", + "dol =pi -x-y;\n", + "dol=dol*180/pi;\n", + "a= dol *3600 %60;\n", + "b= ((dol *3600 -a)%3600) /60;\n", + "c=( dol *3600 - b*60 -a) /3600;\n", + "\n", + "#result\n", + "print \" distance from A to B in (km) \",round(p*Re,3);\n", + "print \" 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" + "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 @@ -101,19 +225,52 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.4,Page 33" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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", + "latA =45.0;\n", + "a1=45.0+13.108/60;\n", + "p =(300.0/60.0) *pi /180; # side AB\n", + "b=(90 - latA )*pi /180; # side PA\n", + "\n", + "# calculation\n", + "a= acos ( cos (p)*cos(b)); # side BP\n", + "BC=a *180/ pi - latA ;\n", + "d=BC *1.852*60;\n", + "B=asin(sin(latA*pi/180)/sin(a1*pi/180));\n", + "B=deg_to_dms(B*180/pi);\n", + "\n", + "\n", + "#result\n", + "print \" distance of BC in (km)\",round(d,3)\n", + "print \"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" + "text": [ + " distance of BC in (km) 24.181\n", + "the angle in deg,min,sce is [85, 0, 33.27]\n" + ] } ], "prompt_number": 27 @@ -122,19 +279,48 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.6.1,Page 37" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "delta =42+15.0/60; # declination of star\n", + "theta =26+40.0/60; # lattude of star\n", + "\n", + "#caculation\n", + "zend =90.0 - theta -90+ delta ;\n", + "alt =90.0 - zend ;\n", + "\n", + "#for zenith distance\n", + "#a= zend *3600 %60;\n", + "b= ((zend *3600 )%3600) /60;\n", + "c=( zend *3600 - b*60 -a) /3600;\n", + "print \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for altitude\n", + "a= alt *3600 %60;\n", + "b= ((alt *3600 -a)%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" 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" + "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 @@ -143,19 +329,47 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.6.2,Page 36" + "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\";", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "delta =23+20.0/60; # declination of star\n", + "theta =26+40.0/60; # lattude of star\n", + "\n", + "#caculation\n", + "zend =90.0 + theta -90- delta ;\n", + "alt =90.0 - zend ;\n", + "\n", + "#for zenith distance\n", + "a= zend *3600 %60;\n", + "b= ((zend *3600 -a)%3600) /60;\n", + "c=( zend *3600 - b*60 -a) /3600;\n", + "print \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for altitude\n", + "\n", + "b= ((alt *3600 )%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" 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" + "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 @@ -164,19 +378,47 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.6.3,Page 37" + "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\";", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "delta =65+40.0/60; # declination of star\n", + "theta =26+40.0/60; # lattude of star\n", + "\n", + "#caculation\n", + "zend =90.0 - theta -90+ delta ;\n", + "alt =90.0 - zend ;\n", + "\n", + "#for zenith distance\n", + "a= zend *3600 %60;\n", + "b= ((zend *3600 -a)%3600) /60;\n", + "c=( zend *3600 - b*60 -a) /3600;\n", + "print \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for altitude\n", + "a= alt *3600 %60;\n", + "b= ((alt *3600 -a)%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" 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" + "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 @@ -185,19 +427,47 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.7,Page 37" + "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\";", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "delta =85+20.0/60; # declination of star\n", + "theta =46+50.0/60; # lattude of star\n", + "\n", + "#caculation\n", + "zend =90.0 - theta +90- delta ;\n", + "alt =90.0 - zend ;\n", + "\n", + "#for zenith distance\n", + "\n", + "b= ((zend *3600 )%3600) /60;\n", + "c=( zend *3600 - b*60 -a) /3600;\n", + "print \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for altitude\n", + "a= alt *3600 %60;\n", + "b= ((alt *3600 -a)%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" 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" + "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 @@ -206,19 +476,47 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.8,Page 38" + "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\";", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "delta =56+10.0/60; # declination of star\n", + "theta =56+10.0/60; # lattude of star\n", + "\n", + "#caculation\n", + "zend =90.0 - theta +90- delta ;\n", + "alt =90.0 - zend ;\n", + "\n", + "#for zenith distance\n", + "a= zend *3600 %60;\n", + "b= ((zend *3600-a )%3600) /60;\n", + "c=( zend *3600 - b*60 -a) /3600;\n", + "print \" zenith distance \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for altitude\n", + "#a= alt *3600 %60;\n", + "b= ((alt *3600 )%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" 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" + "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 @@ -227,19 +525,38 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.9,Page 38" + "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];", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "import numpy as np\n", + "a=np.array([[1.0,-1.0],[1.0,1.0]])\n", + "b=np.array([59.0/3,332.0/3])\n", + "\n", + "#calculation\n", + "x=np.linalg.solve(a,b);\n", + "\n", + "#result\n", + "print\"declination of star in (degrees)\",round(x[0],3);\n", + "print\"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" + "text": [ + "declination of star in (degrees) 65.167\n", + "latitude of the place of observation (degrees) 45.5\n" + ] } ], "prompt_number": 22 @@ -248,19 +565,64 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.10,Page 39" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "theta =20+30.0/60;\n", + "H =42+6.0/60; # hour angle\n", + "delta =50.0;\n", + "\n", + "\n", + "# in triangle ZPM\n", + "\n", + "#calculation\n", + "PZ =(90 - delta )*pi /180;\n", + "H=H*pi /180;\n", + "PM =(90 - theta )*pi /180;\n", + "ZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\n", + "alpha =pi /2- ZM;\n", + "alpha = alpha *180/ pi;\n", + "A =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n", + "\n", + "if A <0:\n", + " A=-A;\n", + " A=acos(A)\n", + " A=180-A*180/pi;\n", + " \n", + "\n", + "#for altitude\n", + "alt=alpha;\n", + "a= alt *3600 %60;\n", + "b=((alt *3600-a )%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "\n", + "#for azimuth \n", + "a= A *3600 %60;\n", + "b= ((A *3600-a )%3600) /60;\n", + "c=( A *3600 - b*60 -a) /3600;\n", + "print\" 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" + "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 @@ -269,19 +631,64 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.11,Page 40" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "theta = -8 -30.0/60;\n", + "H =322.0; # hour angle\n", + "delta =50;\n", + "\n", + "\n", + "# in triangle ZPM\n", + "\n", + "#calculation\n", + "PZ =(90 - delta )*pi /180;\n", + "H =2* pi -H*pi /180;\n", + "PM =(90 - theta )*pi /180;\n", + "ZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));\n", + "alpha =pi /2- ZM;\n", + "alpha=alpha*180/pi;\n", + "A =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));\n", + "\n", + "if A <0:\n", + " A=-A;\n", + " A=acos(A)\n", + " A=180-A*180/pi;\n", + " \n", + "#result\n", + "#for altitude\n", + "alt=alpha;\n", + "a= alt *3600 %60;\n", + "b=((alt *3600-a )%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" altitude of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "\n", + "#for azimuth \n", + "a= A *3600 %60;\n", + "b= ((A *3600-a )%3600) /60;\n", + "c=( A *3600 - b*60 -a) /3600;\n", + "print\" 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" + "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 @@ -290,19 +697,61 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.12,Page 42" + "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\";", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "alpha =22+36.0/60; # altitude of star\n", + "A =42.0 # azimuth angle\n", + "delta =40.0; # latitude of observer\n", + "\n", + "# in triangle ZPM\n", + "\n", + "#calculation\n", + "PZ =(90 - delta )*pi /180;\n", + "A=A*pi /180;\n", + "ZM =(90 - alpha )*pi /180;\n", + "PM= acos (( cos (PZ)* cos (ZM)+sin(ZM)*sin(PZ)* cos (A)));\n", + "theta =pi /2- PM\n", + "theta=theta*180/pi;\n", + "H =(( cos(ZM)-cos (PZ)* cos (PM))/ sin (PZ)/sin(PM));\n", + "if H <0:\n", + " H=-H;\n", + " H=acos(H)\n", + " H=180-H*180/pi;\n", + " \n", + "\n", + "#result\n", + "#for declination \n", + "alt=theta;\n", + "a= alt *3600 %60;\n", + "b=((alt *3600-a )%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" declination of star \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for hour angle\n", + "a= H *3600 %60;\n", + "b= ((H *3600-a )%3600) /60;\n", + "c=( H *3600 - b*60 -a) /3600;\n", + "print\" 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" + "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 @@ -311,19 +760,61 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.13,Page 42" + "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\";", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "alpha =21+30.0/60; # a l t i t u d e o f s t a r\n", + "A =140.0 # azimuth a n g l e\n", + "delta =48.0; # l a t i t u d e o f o b s e r v e r\n", + "\n", + "#calculation\n", + "PZ =(90 - delta )*pi /180;\n", + "A=A*pi /180;\n", + "ZM =(90 - alpha )*pi /180;\n", + "PM =( cos(PZ)*cos(ZM)+ sin (ZM)* sin (PZ)* cos (A));\n", + "\n", + "if PM <0:\n", + " PM=-PM\n", + " PM=acos(PM)\n", + " PM=180-PM*180/pi;\n", + "\n", + "H= acos (( cos (ZM)-cos(PZ)*cos(PM*pi /180) )/ sin (PZ)/sin (PM*pi /180) );\n", + "H =2* pi -H;\n", + "H=H*180/pi;\n", + "\n", + "#result\n", + "#for declination \n", + "alt=PM-90;\n", + "a= alt *3600 %60;\n", + "b=((alt *3600-a )%3600) /60;\n", + "c=( alt *3600 - b*60 -a) /3600;\n", + "print \" declination of star southwards \",round(a,3),\"seconds\",b,\"minutes\",c,\"degrees\";\n", + "\n", + "#for hour angle\n", + "a= H *3600 %60;\n", + "b= ((H *3600-a )%3600) /60;\n", + "c=( H *3600 - b*60 -a) /3600;\n", + "print\" 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" + "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 @@ -332,19 +823,68 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.14,Page 43" + "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", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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\n", + "delta =22+12.0/60;\n", + "theta =42+30.0/60;\n", + "\n", + "#calculation\n", + "ZP =(90 - theta )*pi /180;\n", + "PM =(90 - delta )*pi /180;\n", + "A= acos ( cos (PM)/sin(ZP));\n", + "H=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\n", + "A=deg_to_dms(A*180/ pi);\n", + "H=deg_to_dms(H/15);\n", + "\n", + "#result\n", + "print \" azimuth of setting sun in ( degrees,min,second) \",A\n", + "print \" suns hour angle in ( hr,min,second ) : \",H\n", + "\n", + "#part 2\n", + "delta = -22 -12/60;\n", + "theta =42+30.0/60;\n", + "\n", + "#calculation\n", + "ZP =(90 - theta )*pi /180;\n", + "PM =(90 - delta )*pi /180;\n", + "A= acos ( cos (PM)/sin(ZP));\n", + "H=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\n", + "A=deg_to_dms(A*180/ pi);\n", + "H=deg_to_dms(H/15);\n", + "\n", + "#result\n", + "print \" azimuth of setting sun in ( degrees,min,second) \",A\n", + "print \" 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" + "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 @@ -353,19 +893,50 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.15,Page 44" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "delta =22+12.0/60;\n", + "theta =42+30.0/60;\n", + "ef 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\n", + "ZP =(90 - theta )*pi /180;\n", + "PM =(90 - delta )*pi /180;\n", + "A= acos ( cos (PM)/sin(ZP));\n", + "H=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi\n", + "A=deg_to_dms(180-A*180/ pi);\n", + "H=deg_to_dms(H/15);\n", + "\n", + "#result\n", + "print \" azimuth of setting sun in ( degrees,min,second) \",A\n", + "print \" 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" + "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 @@ -374,19 +945,45 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.16,Page 61" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "time = -3 -28.41/60; # greenwich time at july 1 1951\n", + "change = -11.82/60;\n", + "def 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\n", + "c12 = change/24*12 # change of time in 12 hours\n", + "tch =time +c12;\n", + "tch=deg_to_dms(tch/60);\n", + "\n", + "#result\n", + "print \" 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" + "text": [ + " greenwich mean time error in 12 th hour(-ve) in( deg,min,sec) [0, 3, 34.32]\n" + ] } ], "prompt_number": 1 @@ -395,19 +992,49 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.17,Page 61" + "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\"", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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 \n", + "GMN = -14*60 -10;\n", + "changeET =1*1.5;\n", + "\n", + "#calculation\n", + "neterr =GMN+ changeET ;\n", + "GAT = time + neterr ;\n", + "GAT=GAT+10*3600+30*60;\n", + "hr= round ( GAT /3600) ;\n", + "b=GAT -hr *3600;\n", + "mi= round (b /60 -1);\n", + "c=GAT -hr *3600 - mi *60;\n", + "\n", + "#result\n", + "print 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" + "text": [ + "10.0 hour 15.0 minutes 48.0265 seconds of GAT\n" + ] } ], "prompt_number": 5 @@ -416,19 +1043,75 @@ "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" + "source": [ + "Example 1.18,Page 62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#part1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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", + "A =50+12.0/60+48.0/3600;\n", + "time =A /15*3600\n", + "\n", + "#calculation\n", + "hr= round ( time /3600) ;\n", + "b=time -hr *3600;\n", + "mi= round (b /60 -1);\n", + "c=time -hr *3600 - mi *60;\n", + "\n", + "#result\n", + "print hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "A =8+18.0/60+6.0/3600;\n", + "time =A /15*3600\n", + "\n", + "#calculation\n", + "hr= round ( time /3600-1) ;\n", + "b=time -hr *3600;\n", + "mi= round (b /60 );\n", + "c=time -hr *3600 - mi *60;\n", + "\n", + "#result\n", + "print hr,\"hour\",mi,\"minutes\",c,\"seconds of angles\"\n", + "\n", + "#part 3\n", + "#initialisation of variable\n", + "A =258+36.0/60+30.0/3600;\n", + "time =A /15*3600\n", + "\n", + "#calculation\n", + "hr= round ( time /3600) ;\n", + "b=time -hr *3600;\n", + "mi= round (b /60 );\n", + "c=time -hr *3600 - mi *60;\n", + "\n", + "#result\n", + "print 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\n", + "17.0 hour 14.0 minutes 26.0 seconds of angles\n" + ] } ], "prompt_number": 21 @@ -437,19 +1120,55 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.19,Page 62" + "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", + "input": [ + "\n", + "\n", + "#part1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "A =4+34.0/60+13.0/3600;\n", + "\n", + "#calculation\n", + "angle =A *15;\n", + "angle=deg_to_dms(angle);\n", + "\n", + "#result\n", + "print \"angle in degree,minute,second respectively\",angle\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "A =18+11.0/60+38.0/3600;\n", + "\n", + "#calculation\n", + "angle =A *15;\n", + "angle=deg_to_dms(angle);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "angle in degree,minute,second respectively [68, 33, 15.0]\n", + "angle in degree,minute,second respectively [272, 54, 30.0]\n" + ] } ], "prompt_number": 15 @@ -458,19 +1177,45 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.20.a,Page 64" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =20 # longitude of the place\n", + "longSM =82+30.0/60; # longitude of standard meridion\n", + "\n", + "#calculation\n", + "dolong =longSM - longP ; # difference in longitude\n", + "dot = dolong /15.0; # difference in time\n", + "LMT =20+24.0/60+6.0/3600 - dot ;\n", + "LMT=deg_to_dms(LMT)\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[16, 14, 6.0] Local mean time in hours,minute,second respectively\n" + ] } ], "prompt_number": 10 @@ -479,19 +1224,45 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.20.b,Page 64" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =-20 # longitude of the place\n", + "longSM =82+30.0/60; # longitude of standard meridion\n", + "\n", + "#calculation\n", + "dolong =longSM - longP ; # difference in longitude\n", + "dot = dolong /15.0; # difference in time\n", + "LMT =20+24.0/60+6.0/3600 - dot ;\n", + "LMT=deg_to_dms(LMT)\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[13, 34, 6.0] Local mean time in hours,minute,second respectively\n" + ] } ], "prompt_number": 11 @@ -500,19 +1271,44 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.21.a,Page 64" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "LMT =9+40.0/60+12.0/3600;\n", + "longP = -42 -36.0/60;\n", + "\n", + "#calculation\n", + "dot = longP /15;\n", + "GMT =LMT -dot;\n", + "GMT=deg_to_dms(GMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[12, 30, 36.0] GMT in hours,minute,second respectively\n" + ] } ], "prompt_number": 12 @@ -521,19 +1317,44 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.21.b,Page 64" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "LMT =4+32.0/60+10.0/3600;\n", + "longP = -56 -32.0/60;\n", + "\n", + "#calculation\n", + "dot = longP /15;\n", + "GMT =LMT +dot;\n", + "GMT=deg_to_dms(GMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[0, 46, 2.0] GMT in hours,minute,second respectively\n" + ] } ], "prompt_number": 14 @@ -542,19 +1363,79 @@ "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" + "source": [ + "Example 1.22,Page 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "#part1\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "GCT =18+40.0/60+12.0/3600; # greenwich civil time\n", + "longP =72+30.0/60; # longitude of the place\n", + "\n", + "#calculation\n", + "dot = longP /15.0;\n", + "LMT = GCT +dot;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"LMT in hours,minute,second respectively\",LMT\n", + "\n", + "#part 2\n", + "#initiallisation of variable\n", + "GCT =18+40.0/60+12.0/3600; # greenwich civil time\n", + "longP =-72-30.0/60; # longitude of the place\n", + "\n", + "#calculation\n", + "dot = longP /15.0;\n", + "LMT = GCT +dot;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"LMT in hours,minute,second respectively\",LMT\n", + "\n", + "#part 3\n", + "#initialisation of variable\n", + "def 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]\n", + "GCT =18+40.0/60+12.0/3600; # greenwich civil time\n", + "longP =110+32.0/60; # longitude of the place\n", + "\n", + "#calculation\n", + "dot = longP /15.0;\n", + "LMT = GCT +dot;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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]\n", + "LMT in hours,minute,second respectively [13, 50, 12.0]\n", + "LMT of next day in hours,minute,second respectively [2, 2, 20.0]\n" + ] } ], "prompt_number": 1 @@ -563,19 +1444,50 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.23,Page 66" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "LMT =10+20.0/60+30.0/3600; # local mean time\n", + "longP =102+30.0/60; # longitude of the place\n", + "\n", + "#calculation\n", + "dot = longP /15;\n", + "GMT =LMT -dot;\n", + "mGMN =12 - GMT ; #mean time interval\n", + "i= mGMN *0.32/3600; # increase in mGMN\n", + "ETGMN =5.0/60+4.35/3600;\n", + "ch=i+ ETGMN ; # change in GMT\n", + "GMT =ch+GMT;\n", + "LMT = GMT +dot;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[10, 25, 37.07] LMT in hours,minute,second respectively\n" + ] } ], "prompt_number": 27 @@ -584,19 +1496,50 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.24,Page 67" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "LMT =15+12.0/60+40.0/3600; # local mean time\n", + "longP = -20 -30.0/60; # longitude of the place\n", + "\n", + "#calculation\n", + "dot = longP /15;\n", + "GMT =LMT -dot;\n", + "mGMN =12 - GMT ; #mean time interval\n", + "i= mGMN *0.32/3600; # increase in mGMN\n", + "ETGMN =5.0/60+4.35/3600;\n", + "ch=i+ ETGMN ; # change in GMT\n", + "GMT =ch+GMT;\n", + "LMT = GMT +dot;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[15, 17, 42.89] LMT in hours,minute,second respectively\n" + ] } ], "prompt_number": 29 @@ -605,19 +1548,43 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.25,Page 70" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "time =4+20.0/60+30.0/3600;\n", + "\n", + "#calculation\n", + "accn = time *9.8565/3600; # acceleration\n", + "stime = time + accn ; # sidereal time\n", + "stime=deg_to_dms(stime);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[4, 21, 12.79] sidereal time in hours,minute,second respectively\n" + ] } ], "prompt_number": 30 @@ -626,19 +1593,43 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.26,Page 71" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "stime =8+40.0/60+50.0/3600;\n", + "\n", + "#calcculation\n", + "accn =-time *9.8565/3600; # acceleration\n", + "mtime = stime + accn ; # mean time\n", + "mtime=deg_to_dms(mtime);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[8, 40, 7.21] mean time in hours,minute,second respectively\n" + ] } ], "prompt_number": 32 @@ -647,19 +1638,68 @@ "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" + "source": [ + "Example 1.27,Page 72" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#part 1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP = -160 -30.0/60 -30.0/3600; # longitude of the place\n", + "GST =16+30.0/60+12.0/3600; # standard time\n", + "\n", + "#calculation\n", + "dot = longP /15; # difference in time\n", + "i= dot *9.8565/3600; # error\n", + "LST =GST -i;\n", + "LST=deg_to_dms(LST);\n", + "\n", + "#result\n", + "print \"LST of LMM in hours,minute,second respectively\",LST\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP = 160 +30.0/60 +30.0/3600; # longitude of the place\n", + "GST =16+30.0/60+12.0/3600; # standard time\n", + "\n", + "#calculation\n", + "dot = longP /15; # difference in time\n", + "i= dot *9.8565/3600; # error\n", + "LST =GST -i;\n", + "LST=deg_to_dms(LST);\n", + "\n", + "#result\n", + "print \"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 @@ -668,19 +1708,49 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.28,Page 73" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =85+20.0/60; # longitude of the place\n", + "GST =6+30.0/60; # standard time\n", + "GMN =6+32.0/60+12.0/3600;\n", + "\n", + "#calculation\n", + "dot = longP /15; # difference in time\n", + "i= dot *9.8565/3600; # error\n", + "LST =GMN -i; #LST at L .M.N\n", + "i2=GST *9.8565/3600; # error in GST\n", + "LST2 =GST+i2;\n", + "LST = LST + LST2 # lst at L .M.N\n", + "LST=deg_to_dms(LST);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[13, 2, 19.99] LST in hours,minute,second respectively\n" + ] } ], "prompt_number": 38 @@ -689,19 +1759,48 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.29,Page 75" + "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", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =112+20.0/60+15.0/3600; # longitude of the place\n", + "GST =8+10.0/60+28.0/3600; #GST at GMM\n", + "lst =18+28.0/60+12.0/3600; \n", + "\n", + "#calculation\n", + "dot = longP /15; \n", + "i= dot *9.8565/3600; # error\n", + "LST = GST +i; #LST at L .M.N\n", + "LMM =lst -LST;\n", + "i2=LMM *9.8565/3600; # error in LMM\n", + "LMT =LMM -i2; # local mean time\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[10, 14, 48.91] LMT in hours,minute,second respectively\n" + ] } ], "prompt_number": 40 @@ -710,19 +1809,47 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.30,Page 76" + "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", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =85+20.0/60; # longitude of the place\n", + "GST =18+30.0/60; # standard time\n", + "gst =6+32.0/60+12.0/3600; #GST at GMN\n", + "\n", + "#calculation\n", + "dot = longP /15; \n", + "GMT =GST -dot -12;\n", + "i= GMT *9.8565/3600; # error\n", + "GMT = GMT +i; # SI time\n", + "LST = GMT +dot+ gst ; #LST at LMT\n", + "LST=deg_to_dms(LST);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[13, 2, 19.99] LST in hours,minute,second respectively\n" + ] } ], "prompt_number": 42 @@ -731,19 +1858,48 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.31,Page 78" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =112+20.0/60+15.0/3600; # longitude of the place\n", + "GST =8+10.0/60+28.0/3600; #GST at GMM\n", + "lst =18+28.0/60+12.0/3600; # local sidereal time\n", + "\n", + "#clculation\n", + "dot = longP /15; \n", + "gmm = lst +dot - GST ; # SI at GMM\n", + "i= gmm *9.8565/3600; # error\n", + "gmm =gmm -i; #LST at L .M.N\n", + "LMT =gmm -dot; # local mean time\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[10, 14, 48.7] LMT in hours,minute,second respectively\n" + ] } ], "prompt_number": 44 @@ -752,19 +1908,62 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.32,Page 79" + "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", + "input": [ + "\n", + "\n", + "#part 1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =162+30.0/60+15.0/3600; # longitude of the place\n", + "GST =10+30.0/60+15.0/3600; #GST at GMM\n", + "RA =22+11.0/60+30.0/3600; # local sidereal time\n", + "\n", + "#calculation\n", + "dot = longP /15; \n", + "i= dot *9.8565/3600; # e r r o r\n", + "gmm = GST +i; #LST at L .M.N\n", + "lmn =RA -gmm; # SI o f LMN\n", + "i2=lmn *9.8565/3600; # error 2\n", + "LMT =lmn -i2;\n", + "LMT1=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"LMT observed at upper transit in hours,minute,second respectively\",LMT1\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "i3 =12*9.8565/3600; # retardation\n", + "\n", + "#calculation\n", + "LMT = LMT +12 - i3;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "LMT observed at upper transit in hours,minute,second respectively [11, 37, 33.31]\n", + "LMT observed at lower transit in hours,minute,second respectively [23, 35, 35.04]\n" + ] } ], "prompt_number": 16 @@ -773,19 +1972,52 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.33,Page 80" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "longP =60+30.0/60; # longitude of the place\n", + "GST =7+30.0/60+48.6/3600; #GST at GMM\n", + "RA =17+28.0/60 +40.0/1600;\n", + "\n", + "#calculation\n", + "dot = longP /15; \n", + "i= dot *9.8565/3600; # error\n", + "gmm =GST -i; #LST at L .M.N\n", + "LMT =RA -gmm; # local mean time\n", + "i2=LMT*9.8296/3600;\n", + "GMT=LMT-i2-longP/15;\n", + "LMT=deg_to_dms(LMT);\n", + "GMT=deg_to_dms(GMT);\n", + "\n", + "#result\n", + "print \"LMT in hours,minute,second respectively\",LMT\n", + "print \"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" + "text": [ + "LMT in hours,minute,second respectively [9, 59, 21.15]\n", + "GMT in hours,minute,second respectively [5, 55, 42.96]\n" + ] } ], "prompt_number": 42 @@ -794,19 +2026,50 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.34,Page 82" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "GMT=13+21.0/60+54.0/3600; #GMT of the place\n", + "LongA=40+30.0/60; #longitude of A\n", + "LongB=-40-30.0/60; #longitude of B\n", + "\n", + "#calculation\n", + "delA=LongA/15.0*9.8296/3600;#error\n", + "delB=LongB/15.0*9.8296/3600;#error\n", + "GA=GMT+delA;\n", + "GA=deg_to_dms(GA);\n", + "GB=GMT+delB;\n", + "GB=deg_to_dms(GB);\n", + "\n", + "#result\n", + "print \"corected time of A in hours,minute,second respectively\",GA\n", + "print \"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" + "text": [ + "corected time of A in hours,minute,second respectively [13, 22, 20.54]\n", + "corected time of B in hours,minute,second respectively [13, 21, 27.46]\n" + ] } ], "prompt_number": 17 @@ -815,19 +2078,48 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.35,Page 83" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "GMT=7+12.0/60+28.0/3600; #GMT of the place\n", + "Long=50+30.0/60; #longitude \n", + "LMT=11+30.0/60+12.0/3600; \n", + "\n", + "#calculation\n", + "delA=LongA/15.0*9.8296/3600;#error\n", + "delB=LMT*9.8296/3600;#error\n", + "LA=GMT+delA; #LMT at transit\n", + "LMT=LMT-delB;\n", + "LMT=LMT+LA;\n", + "LMT=deg_to_dms(LMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "LMT in hours,minute,second respectively [18, 41, 13.47]\n" + ] } ], "prompt_number": 41 @@ -836,19 +2128,44 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.36,Page 84" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "GST=8+25.0/60+25.0/3600;\n", + "\n", + "#calculation\n", + "GMT=24-GST;\n", + "i=GMT*9.8296/3600;\n", + "GMT=GMT-i;\n", + "GMT=deg_to_dms(GMT);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "GMT in hours,minute,second respectively [15, 32, 1.89]\n" + ] } ], "prompt_number": 43 @@ -857,19 +2174,50 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.37,Page 85" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "GMT=12+03.0/60+46.09/3600; #GMT of the place\n", + "LongA=-130.0; #longitude of A\n", + "LongB=49.0; #longitude of B\n", + "\n", + "#calculation\n", + "delA=LongA/15.0*11.71/24/3600;\n", + "delB=LongB/15.0*11.71/24/3600;\n", + "LMTA=GMT+delA;\n", + "LMTA=deg_to_dms(LMTA);\n", + "LMTB=GMT+delB;\n", + "LMTB=deg_to_dms(LMTB);\n", + "\n", + "#result\n", + "print \"LMT at A on July 2 in hours,minute,second respectively\",LMTA\n", + "print \"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" + "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 @@ -878,19 +2226,47 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.38,Page 86" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "Lat=50+30.0/60; # latitude of place\n", + "Dec=74+22/60; #declination of place\n", + "RA=14+50.0/60+52.0/3600;\n", + "\n", + "#calculation\n", + "H=acos(tan(Lat*pi/180)/tan(Dec*pi/180));\n", + "H=H*180/pi;\n", + "H=H/15.0;\n", + "LST=H+RA;\n", + "LST=deg_to_dms(LST);\n", + "\n", + "#result \n", + "print \"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" + "text": [ + "[19, 29, 26.59] LST in hours,minute,second respectively\n" + ] } ], "prompt_number": 20 @@ -899,19 +2275,54 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.39,Page 87" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "Long=120+30.0/60; #langitude\n", + "GST=14+30.0/60+28.25/3600;\n", + "GMT=2+5.0/60;\n", + "LMN=12.0;\n", + "LST=14+31.0/60+47.43/3600;\n", + "RA=23+20.0/60+20.0/3600;\n", + "\n", + "#calculation\n", + "e1=Long*15.0*9.8565/3600;\n", + "GST=GST+e1;\n", + "LMT=GMT+24-8-2.0/60;\n", + "LMM=LMN+24-LMT; #mean LMN\n", + "e2=LMM*9.8565/3600;\n", + "LMM=LMM+e2;\n", + "LST=LST+24-LMM;\n", + "HA=LST-RA+24;\n", + "HA=deg_to_dms(HA);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[21, 11, 30.51] HA in hours,minutes,seconds respectively\n" + ] } ], "prompt_number": 21 @@ -920,19 +2331,52 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.40,Page 86" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "Long=75+28.0/60; #langitude\n", + "LMT=5+30.0/60;\n", + "GST=20+15.0/60+32.58/3600;\n", + "\n", + "#calculation\n", + "e1=Long/15.0*9.8565/3600;\n", + "GST=GST+e1;\n", + "e2=LMT*9.8565/3600;\n", + "LMT=LMT+e2;\n", + "HA=GST+LMT;\n", + "HAMS=HA-LMT-12+e2;\n", + "HA=deg_to_dms(HA);\n", + "HAMS=deg_to_dms(HAMS);\n", + "\n", + "#result\n", + "print \"HA in hours,minutes,seconds respectively\",HA\n", + "print \"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" + "text": [ + "HA in hours,minutes,seconds respectively [25, 47, 16.38]\n", + "HAMS in hours,minutes,seconds respectively [8, 17, 16.38]\n" + ] } ], "prompt_number": 40 @@ -941,19 +2385,49 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.41,Page 90" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "Long=45.0; #langitude\n", + "del1=1067.2/3600;\n", + "del2=1083.9/3600;\n", + "del3=1100.3/3600;\n", + "f0=-16-14.0/60-24.0/3600;\n", + "\n", + "#calculation\n", + "n=(10-Long/15)/24.0;\n", + "Del0=del2-del1;\n", + "Del1=del3-del2;\n", + "fn=-f0+n*del2+n*(n-1)/4*(Del0+Del1)\n", + "fn=deg_to_dms(fn);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "sun's declination in hours,minutes,seconds respectively [16, 19, 38.43]\n" + ] } ], "prompt_number": 39 @@ -962,19 +2436,72 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.42,Page 101" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "aziA =32+41.0/60+30.0/3600; # azimuth o f A\n", + "aziB =110+28.0/60+42.0/3600; # azimuth o f B\n", + "vaA =10+21.0/60+12.0/3600; # vertical angle of A\n", + "vaB = -2 -18.0/60 -30.0/3600; # vertical angle o f B\n", + "lA1 =11;\n", + "lB1 =11.5;\n", + "rA1 =7.5;\n", + "rB1 =7;\n", + "lB2 =10;\n", + "lA2 =10.5;\n", + "rB2 =7.5;\n", + "rA2 =8;\n", + "d =20;\n", + "# partA\n", + "#calculation\n", + "sigl =lA1+ lA2 ;\n", + "sigr =rA1+ rA2 ;\n", + "b= sigl /4*d- sigr /4*d;\n", + "i= tan( vaA );\n", + "caziA = aziA +i *29.95/3600;\n", + "caziA1=deg_to_dms(caziA);\n", + "\n", + "#result\n", + "print \"corrected azimuth of A in (degrees,minutes,seconds)\",caziA1\n", + "\n", + "#part2 \n", + "#calculation\n", + "i= tan( vaB );\n", + "caziB = aziB +i*b /3600;\n", + "ha=caziB - caziA;\n", + "caziB=deg_to_dms(caziB);\n", + "ha=deg_to_dms(ha);\n", + "\n", + "#result\n", + "print \"corrected azimuth of B in (degrees,minutes,seconds)\",caziB\n", + "print \"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" + "text": [ + "corrected azimuth of A in (degrees,minutes,seconds) [32, 42, 10.04]\n", + "corrected azimuth of B in (degrees,minutes,seconds) [110, 29, 15.02]\n", + "horizontal difference of angle between A & B in (degrees,minutes,seconds) [77, 47, 4.98]\n" + ] } ], "prompt_number": 38 @@ -983,19 +2510,52 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.43,Page 102" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "v1 =18+36.0/60+48.0/3600; # vertical angle 1\n", + "v2 =18+35.0/60+56.0/3600; # vertical angle 2\n", + "slm =28+36.0/60+20.0/3600; # altitude of sun measured\n", + "ds =15.0/60+59.35/3600; # dia of sun\n", + "\n", + "#calculation\n", + "mv =( v1+v2) /2; #mean vertical angle\n", + "i=v1 -v2; # error\n", + "sl=slm+i; #new altitude of sun\n", + "sl=sl+ds;\n", + "ir = -57.0/3600/( tan( slm *pi /180+26* pi /180/3600) );#error due to refraction\n", + "sl=sl+ir;\n", + "ip =8.8/3600* cos( slm *pi /180+26* pi /180/3600);# error due to parallex\n", + "sl=sl+ip;\n", + "sl=deg_to_dms(sl);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[28, 51, 34.59] corrected altitude in (deg,min,sec) respectively\n" + ] } ], "prompt_number": 12 @@ -1004,19 +2564,50 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.44,Page 115" + "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)", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "long =4+30.0/60;\n", + "i= long *9.8565/3600; # longitude\n", + "gst =14+38.0/60+12.0/3600; #GST on GMM\n", + "lst =gst -i; #LST on LMM\n", + "RA =7+36.0/60+21.24/3600;\n", + "\n", + "#calculation\n", + "LST =RA;\n", + "SI=LST - lst +24;\n", + "LCT =17+56.0/60+8.86/3600 -1; # local chronometer time\n", + "i2=SI *9.8296/3600;\n", + "LMM =SI -i2;\n", + "ce=LCT - LMM ;\n", + "\n", + "#result\n", + "print \" 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" + "text": [ + "2.19 chronometer error in (s)\n" + ] } ], "prompt_number": 17 @@ -1025,19 +2616,51 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Exampe 1.45,Page 116" + "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)", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "c =90 -36 -30.0/60 -30.0/3600; # co latitude\n", + "p =90 -16 -12.0/60 -18.4/3600; # co declination\n", + "z =90 -30 -12.0/60 -30.0/3600; # co altitude\n", + "s=(p+z+c) /2;\n", + "\n", + "#calculation\n", + "s1=s-c;\n", + "s2=s-p;\n", + "s3=s-z;\n", + "H =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin (s*pi/180) / sin (s3*pi /180) ));\n", + "H=H *180/ pi;\n", + "H=24 -H /15;\n", + "LST =H +5+18.0/60+12.45/3600 -24;\n", + "ce =1+2.0/60+5.25/3600 - LST ;\n", + "\n", + "#result\n", + "print \" 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" + "text": [ + "19.34 chronometer error in (s)\n" + ] } ], "prompt_number": 21 @@ -1046,19 +2669,56 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example 1.46,Page 118" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "c =90 -36 -40.0/60 -30.0/3600; # co latitude\n", + "p =90 -17 -26.0/60 -42.1/3600; # co declination\n", + "z =90 -36 -14.0/60 -16.8/3600; # co altitude\n", + "\n", + "#calculation\n", + "s=(p+z+c) /2;\n", + "s1=s-c;\n", + "s2=s-p;\n", + "s3=s-z;\n", + "H =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin(s*pi/180) / sin (s3*pi /180) ));\n", + "H=H *180/ pi;\n", + "H=H /15;\n", + "i =12 -11 -56.0/60 -22.8/3600; # error in time\n", + "LAT =15+49.0/60+40.6/3600; # local actual time\n", + "GAT =LAT -H;\n", + "GMT =GAT -i;\n", + "LMT = GMT +H;\n", + "ce =15+49.0/60+12.6/3600 - LMT;\n", + "ce=deg_to_dms(ce)\n", + "\n", + "#result\n", + "print \" chronometer error in (s)\",ce" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": " chronometer error in (s) [0, 3, 9.2]\n" + "text": [ + " chronometer error in (s) [0, 3, 9.2]\n" + ] } ], "prompt_number": 2 @@ -1067,19 +2727,48 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.47,Page 119" + "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) ", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan\n", + "def 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]\n", + "RA =17+12.0/60+48.0/3600;\n", + "gst =9+26.0/60+12.0/3600; #GST on GMN\n", + "long =138.0/15+45.0/15/60; # l o n g i t u d e\n", + "lst =- long *9.85645/3600+9+26.0/60+12.0/3600; #LST on LMN\n", + "LST =17+12.0/60+48.0/3600; # local sidereal time\n", + "\n", + "#calculation\n", + "SI=LST - lst ;\n", + "MI=-SI *9.8296/3600+ SI;\n", + "LCT =7+47.0/60+2.0/3600; # local chronometer time\n", + "ce=LCT -MI;\n", + "\n", + "#result\n", + "print \" 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" + "text": [ + " chronometer error in (s) 11.52\n" + ] } ], "prompt_number": 3 @@ -1088,19 +2777,74 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.48,Page 145" + "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;", + "input": [ + "\n", + "\n", + "#part 1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "theta =54+30.0/60; # l o g i t u d e\n", + "delta =62+12.0/60+21.0/3600; # d e c l i n a t i o n\n", + "\n", + "#calculation\n", + "lat = asin (sin( theta *pi /180) /sin( delta *pi /180) );\n", + "lat = lat *180/ pi;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"Latitude in (deg,min,sec)\",lat;\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "A =53+25.0/60; # azimuth of star\n", + "h =65+18.0/60+42.0/3600; # horizontal angle\n", + "\n", + "#calculation\n", + "A=A+h;\n", + "A=360-A;\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"Azimuth in (deg,min,sec)\",A;\n", + "\n", + "#part 3 \n", + "#initialisation of variable\n", + "lst =4+39.0/60+6.5/3600; #LST o f LMN\n", + "LST =10+58.0/60+38.0/3600+2+49.0/60+25.3/3600; #LST of observation\n", + "\n", + "#calculation\n", + "LMN =LST -lst;\n", + "i= LMN *9.8565/3600; # e r r o r\n", + "LMT =LMN -i;\n", + "LMT=deg_to_dms(LMT)\n", + "\n", + "#results\n", + "print \"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" + "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 @@ -1109,19 +2853,74 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.49,Page 148" + "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", + "input": [ + "\n", + "\n", + "#part 1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "theta =53+32.0/60; # logitude\n", + "delta =56+42.0/60+53.2/3600; # declination\n", + "lat = asin (sin ( theta *pi /180) /sin( delta *pi /180) );\n", + "lat = lat *180/ pi;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"Latitude in (deg,min,sec)\",lat;\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "As= asin ( cos ( delta *pi /180) /cos ( theta *pi /180) ); #azimuth of star\n", + "h =75+18.0/60+20.0/3600; # angle between line and star\n", + "\n", + "#calculation\n", + "A=h-As *180/ pi;\n", + "A=360 -A;\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"Azimuth in (deg,min,sec)\",A;\n", + "\n", + "#part 3\n", + "#initialisation of variable\n", + "LST =10+58.0/60+3.9/3600+22+10.0/60+38.5/3600 -24; #LST of observation\n", + "long =5+40.0/60+18.0/3600; # longitude\n", + "\n", + "#calculation\n", + "i= long *9.8565/3600; # error\n", + "lst =4+58.0/60+23.84/3600+ i; #LST on LMN\n", + "LMM =LST -lst;\n", + "i2=LMM *9.8565/3600; # error in LMM\n", + "LMT =LMM -i2;\n", + "LMT=deg_to_dms(LMT)\n", + "\n", + "#results\n", + "print \"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" + "text": [ + "Latitude in (deg,min,sec) [74, 9, 33.08]\n", + "Azimuth in (deg,min,sec) [352, 7, 3.66]\n", + "LMT in (hr,min,sec) [4, 8, 41.69]\n" + ] } ], "prompt_number": 6 @@ -1130,19 +2929,63 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.50,Page 151" + "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\"", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "Long =(15.0+30.0/60); \n", + "GMT =19+12.0/60+28.6/3600;\n", + "GST=10+12.0/60+36.2/3600;\n", + "RA=10 +12.0/60 +6.3/3600;\n", + "theta=35.0;\n", + "delta=20+6.0/60+48.4/3600;\n", + "\n", + "#calculation\n", + "i= Long/15.0 *9.8656/3600; \n", + "LSTofLMM=GST-i;\n", + "LMT = GMT + Long/15.0 ;\n", + "i2=LMT *9.8656/3600; # error in LMT\n", + "SI = LMT +i2;\n", + "LST =LSTofLMM+ SI ;\n", + "H=LST-RA ; # hour angle\n", + "H=H *15;\n", + "H=360 -H;\n", + "B=atan(tan(delta*pi/180)/cos(H*pi/180));\n", + "B=B*180/pi;\n", + "x=B-theta; #defined as 'B-theta'\n", + "As= atan ( tan ((H) *pi /180) * cos((B) *pi /180) / sin ((x)*pi /180) );#calculating azimuth \n", + "h =36+28.0/60+18.0/3600; # angle between line and star\n", + "A =180+ As *180/ pi -h; #azimuth\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"Azimuth in (deg,min,sec)\",A;\n", + "print \"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" + "text": [ + "Azimuth in (deg,min,sec) [55, 16, 8.27]\n", + "there is a miscalculation in the step of calculating As thus resulted in change in answer\n" + ] } ], "prompt_number": 3 @@ -1151,19 +2994,49 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.51,Page 153 " + "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;", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alpha =33+35.0/60+10.0/3600; # altitude\n", + "ZM =90 - alpha ;\n", + "delta =22+5.0/60+35.0/3600; # declination\n", + "PM =90 - delta ;\n", + "theta =52+30.0/60+20.0/3600; # latitude\n", + "ZP =90 - theta ;\n", + "\n", + "#calculation\n", + "As= acos (( cos (PM*pi /180) -cos(ZP*pi /180) * cos (ZM*pi/180) )/( sin (ZP*pi /180) *sin(ZM*pi /180) ));\n", + "h =18+20.0/60+30.0/3600; # angle between line and star\n", + "A=As *180/ pi+h;\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "Azimuth in (deg,min,sec) [115, 27, 19.68]\n" + ] } ], "prompt_number": 35 @@ -1172,19 +3045,68 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.52,Page 154" + "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;", + "input": [ + "\n", + "\n", + "#part 1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "GAT =5+17.0/60+6.0/60; #GAT \n", + "delta =17+46.0/60+52.0/3600; # declination\n", + "\n", + "#calculation\n", + "i =37.0/3600* GAT ;\n", + "delta =delta -i;\n", + "delta1=deg_to_dms(delta);\n", + "\n", + "#result\n", + "print \"Declination in (deg,min,sec)\",delta1;\n", + "\n", + "#part 2\n", + "#initialisation of variable\n", + "p=90 - delta ; # co declination\n", + "altitude =23+15.0/60+20.0/3600; # altitude of sun\n", + "i2 =2.0/60+12.0/3600; # error due to refraction\n", + "i3 =8.0/3600; # error due to parallax\n", + "\n", + "#calculation\n", + "altitude = altitude -i2+i3;\n", + "c =90 -55 -46.0/60 -12.0/3600; # colatitude\n", + "z=90 - altitude ; # co altitude\n", + "s=(p+z+c) /2;\n", + "s1=s-c;\n", + "s2=s-p;\n", + "s3=s-z;\n", + "A =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));\n", + "A=A *180/ pi;\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "Declination in (deg,min,sec) [17, 43, 32.82]\n", + "Altitude in (deg,min,sec) [92, 23, 10.67]\n" + ] } ], "prompt_number": 34 @@ -1193,19 +3115,51 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.53,Page 156" + "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;", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "GMT =17+5.0/60+2.0/3600; \n", + "i =9.8565/3600* GMT;\n", + "GST =3+12.0/60+12.0/3600;\n", + "wl =1+18.0/60; # west longitude\n", + "RA =16+23.0/60+30.0/3600;\n", + "\n", + "#calculation\n", + "H= GMT +i+ GST +wl -RA; # hour angle\n", + "H=H *15;\n", + "p =90 -29 -52.0/60;\n", + "c =90 -52 -8.0/60;\n", + "z= acos ( cos (H*pi /180) * sin (p*pi /180) *sin(c*pi /180) + cos(p*pi /180) * cos (c*pi /180) );\n", + "A= asin ( sin (p*pi /180) * sin (H*pi /180) /sin(z));\n", + "A=A *180/ pi\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "Azimuth in (deg,min,sec) [78, 38, 33.24]\n" + ] } ], "prompt_number": 33 @@ -1214,19 +3168,63 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.54,Page 157" + "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\"", + "input": [ + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "c2 =24+30.0/60+20.0/3600;\n", + "d2 =24+30.0/60+40.0/3600;\n", + "c3 =25;\n", + "d3 =25+1.0/60;\n", + "\n", + "#calculation\n", + "alt =( c2+c3+d3+d2)/4;#mean observed altitude\n", + "il =(10.6 -9.4) /4*15.0/3600; # error \n", + "alt = alt +il;\n", + "ir = -57.0/3600/ tan (( alt *pi /180) ); # correction of refraction\n", + "ip =8.0/3600* cos (alt*pi /180) ; # correction of parallax\n", + "alt =alt -ir+ip;#altitude corrected\n", + "z=90 - alt;#ZM\n", + "delta =1+32.0/60+16.8/3600 -56.2/3600*(3.0/60+1.86/3600) ;#declination of sun\n", + "p=90 - delta ;#PM\n", + "c =90 -36 -48.0/60 -30.0/3600;#ZP\n", + "s=(p+z+c) /2;\n", + "s1=s-c;\n", + "s2=s-p;\n", + "s3=s-z;\n", + "A =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));#azimuth calculation\n", + "A=A *180/ pi;\n", + "A=A +81+59.0/60+10.0/3600;\n", + "A=360 -A;\n", + "A=deg_to_dms(A);\n", + "\n", + "#result\n", + "print \"Azimuth in (deg,min,sec)\",A;\n", + "print \"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" + "text": [ + "Azimuth in (deg,min,sec) [170, 1, 36.93]\n", + "there is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer\n" + ] } ], "prompt_number": 5 @@ -1235,19 +3233,46 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.55,Page 178" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alpha =65+40.0/60+18.0/3600; # altitude\n", + "delta =53+12.0/60+10.0/3600; # declination\n", + "\n", + "#calculation\n", + "i =57.0/3600*1/ tan ( alpha *pi /180) ; \n", + "alpha =alpha -i;\n", + "z=90 - alpha ; # zenith distance\n", + "lat =delta -z;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[28, 52, 2.23] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 58 @@ -1256,19 +3281,46 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.56,Page 178" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alpha =64+36.0/60+20.0/3600; # altitude\n", + "delta =26+12.0/60+10.0/3600; # declination\n", + "\n", + "#calculation\n", + "i =57.0/3600*1/ tan ( alpha *pi /180) ; # error\n", + "alpha =alpha -i;\n", + "z=90 - alpha ; # zenith distance\n", + "lat = delta +z;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "Latitude in (deg,min,sec) [51, 36, 17.06]\n" + ] } ], "prompt_number": 31 @@ -1277,19 +3329,52 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.57,Page 178" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alpha =44+12.0/60+30.0/3600; # altitude\n", + "longP =75+20.0/60+15.0/3600; # longitude of place\n", + "delta =22+18.0/60+12.8/3600; # declination of sun\n", + "\n", + "#calculation\n", + "i =57.0/3600*1/ tan ( alpha *pi /180) ; # error\n", + "i2 =8.78/3600* cos( alpha ); #error due to parallax\n", + "i3 =15.0/60+45.86/3600; #error due to semi diameter\n", + "alpha =alpha -i+i2+i3;\n", + "z=90 - alpha ; # zenith distance\n", + "delT = longP /15;\n", + "i4 =6.82/3600* delT ; # error in time\n", + "delta =i4+ delta ;\n", + "lat = delta +z;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[67, 51, 21.23] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 62 @@ -1298,19 +3383,53 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.58,Page 180" + "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", + "input": [ + "\n", + "\n", + "#for alpha 1\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "theta =80;\n", + "delta =46+45.0/60+30.0/3600;\n", + "\n", + "#calculation\n", + "alpha1 =90 - theta + delta ;\n", + "alpha1=deg_to_dms(alpha1);\n", + "\n", + "#result\n", + "print \"alpha1 to the north in (deg,min,sec)\",alpha1\n", + "\n", + "#for alpha2\n", + "#calculation\n", + "alpha2 = theta +delta -90;\n", + "alpha2=deg_to_dms(alpha2)\n", + "\n", + "#result\n", + "print \"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" + "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 @@ -1319,19 +3438,49 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.59,Page 181" + "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\"", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "delta1 =20+25.0/60+48.0/3600; # declination of star 1\n", + "delta2 =79+30.0/60+52.0/3600; # declination of star 2\n", + "alpha1 =48+18.0/60+12.0/3600; #altitude of star 1\n", + "alpha2 =47+54.0/60+6.0/3600; #altitude of star 2\n", + "\n", + "#calculation\n", + "r1 =58.0/3600/ tan( alpha1 *pi /180) # error 1\n", + "r2 =58.0/3600/ tan( alpha2 *pi /180) # error 2\n", + "lat =90 -( alpha1 - alpha2 ) /2+( delta1 - delta2 ) /2+( r1 -r2)/2;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"Latitude in (deg,min,sec)\",lat;\n", + "print \" 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" + "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 @@ -1340,19 +3489,46 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.60,Page 182" + "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", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alphal =18+36.0/60+40.0/3600; #altitude at lower culmination\n", + "alphau =59+48.0/60+20.0/3600; #altitude at upper culmination\n", + "lat =( alphal + alphau )/2;\n", + "lat1=deg_to_dms(lat);\n", + "delta =90+ lat - alphau ;\n", + "delta1=deg_to_dms(delta);\n", + "\n", + "\n", + "#result\n", + "print \"Latitude in (deg,min,sec)\",lat1;\n", + "print \"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" + "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 @@ -1361,19 +3537,46 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.61,Page 183" + "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;", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alpha =40+36.0/60+30.0/3600; # altitude of star\n", + "delta =10+36.0/60+40.0/3600; # declination of star\n", + "H =46+36.0/60+20.0/3600; # hour angle of star\n", + "\n", + "#calculation\n", + "n= atan ( tan ( delta *pi /180) /cos(H*pi /180) );\n", + "lat =n+ acos ( sin ( alpha *pi /180) *sin(n)/ sin ( delta *pi/180) );\n", + "lat = lat *180/ pi;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[36, 49, 43.99] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 75 @@ -1382,19 +3585,61 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.62,Page 183" + "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;", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "alpha =42+10.0/60+40.0/3600; # altitude o f sun\n", + "delta =23+12.0/60+18.6/3600; # declination of sun ' s angle\n", + "LMT =14+50.0/60;\n", + "\n", + "#calculation\n", + "i =57.0/3600*1/ tan ( alpha *pi /180) ; # error\n", + "i2 =8.78/3600* cos( alpha ); # correction due to parallax\n", + "i3 =15.0/60+45.86/3600; # coreection due to semi diamter\n", + "longP =108+30.0/60; # longitude of place\n", + "alpha =alpha -i+i2+i3;\n", + "delT = longP /15; # change in time\n", + "GMT = LMT + delT ;\n", + "i4 =1.2/3600* GMT; # error in time\n", + "H=( GMT -12+ i4 - delT ) *15; # hour angle\n", + "i5 =10.6/3600* GMT; # error in declination\n", + "delta = delta +i5;\n", + "ZM =(90 - alpha )*pi /180;\n", + "PM =(90+ delta )*pi /180;\n", + "A= asin ( sin (PM)/sin(ZM)* sin (H*pi /180) );\n", + "A=pi -A;\n", + "ZP =2* atan ( sin (A/2+ H*pi /360) / sin (A/2-H*pi /360) *tan(PM/2- ZM /2) );\n", + "lat =pi /2- ZP;\n", + "lat = lat *180/ pi +1+6.0/60;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[1, 19, 7.46] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 78 @@ -1403,19 +3648,46 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.63,Page 185" + "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;", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "delta =15+20.0/60+48.0/3600; # declination of star\n", + "Int =9+22.0/60+6.0/3600; # interval\n", + "\n", + "#calculation\n", + "dint =Int *9.8565/3600; # change in interval\n", + "H=( Int+ dint ) *15/2; # hour angle\n", + "lat = atan (tan( delta *pi /180) /cos(H*pi /180) );\n", + "lat = lat *180/ pi +5.0/6*16.0/3600;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[39, 22, 1.79] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 79 @@ -1424,19 +3696,58 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.64,Page 186" + "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;", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "RA =1+41.0/60+48.64/3600;\n", + "lat =48+36.0/60+40/3600; # latitude\n", + "delta =88+58.0/60+28.26/3600; # declination of polaris\n", + "GMM =16+48.0/60+20.86/3600;\n", + "longP =7+20.0/60; # longitude of place P\n", + "i1 =51.0/3600; # error due to barometer\n", + "i2 =1.0/3600; # error due to barometer\n", + "i3 = -1.0/3600; # error due to temp\n", + "\n", + "#calculation\n", + "lat =lat -i1+i2+i3;\n", + "delT = longP /15;\n", + "i4= delT *9.8565/3600;\n", + "lst = GMM +i4;\n", + "LMT =20+24.0/60+50.0/3600;\n", + "i6 =9.8565/3600* LMT ; # e r r o r i n LMT\n", + "LST = LMT +i6+lst -24;\n", + "H=LST -RA; # hour a n g l e\n", + "H=H *15;\n", + "lat =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) ;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[49, 36, 18.45] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 81 @@ -1445,19 +3756,65 @@ "cell_type": "heading", "level": 3, "metadata": {}, - "source": "Example 1.65,Page 187" + "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;", + "input": [ + "\n", + "\n", + "#initialisation of variable\n", + "from math import pi,tan,sqrt,sin,cos,acos,atan,asin\n", + "def 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]\n", + "longP =120 -4 -20.0/60; # longitude of point\n", + "GST =8+30.0/60+20.0/3600; #GST on GMM\n", + "delta =6+15.0/60+2.0/3600; # deflection\n", + "alpha =39+20.0/60+30.0/3600; # altitude\n", + "theta =56+54.0/60+30.0/3600; # longitude\n", + "\n", + "#calculation\n", + "delT = longP /15;\n", + "i= delT *9.8565/3600; # error in time\n", + "lst = GST +i; #LST on LMM\n", + "LST =19+52.0/60+16.0/3600;\n", + "RA=LST;\n", + "LMN =LST -lst;\n", + "i2=LMN *9.8565/3600; # error in LMN\n", + "LMN =LMN -i2;\n", + "OSM =10+55.0/60+30.0/3600; #Observed mean time\n", + "i3 =1.0/60+25.0/3600; # e r r o r i n obs e r v ed t ime\n", + "OSM =OSM -i3;\n", + "LMT = OSM +4.0/15+21.0/60.0/15;\n", + "I=LMN - LMT ; # interval\n", + "i4 =1.21/3600; # error in interval\n", + "I=I+i4;\n", + "H=I; # hour angle\n", + "B= cos ( delta *pi /180) * cos ( theta *pi /180) / cos ( alpha *pi/180) ;\n", + "m =225* H **2*3600**2/2.0/206265.0;\n", + "lat = alpha +m*B /3600;\n", + "lat =90 - lat +6+15.0/60+2.0/3600;\n", + "lat=deg_to_dms(lat);\n", + "\n", + "#result\n", + "print \"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" + "text": [ + "[56, 53, 17.77] Latitude in (deg,min,sec)\n" + ] } ], "prompt_number": 85 @@ -1465,7 +3822,7 @@ { "cell_type": "code", "collapsed": false, - "input": "", + "input": [], "language": "python", "metadata": {}, "outputs": [] |