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