FIELD ASTRONOMY

Example 1.1, Page 30

In [1]:
#finding difference of longitude

#initialisation of variable
from math import pi,tan,sqrt,sin
#part1
a =40; # longitude of A
b =73; # longitude of B

#calculation
dol =b-a; # difference of longitude

#result
print " difference of longitude is in degrees",round(dol);

#part2
a =20; # longitude of A
b =150; # longitude of B

#calculation
dol =b-a; # difference of longitude

#result
print " difference of longitude is in degrees ",round(dol);

#part3
a =-20; # longitude of A
b =50; # longitude of B

#calculation
dol =b-a; # difference of longitude

#result
print " difference of longitude is in degrees",round(dol);

#part4
a =-40; # longitude of A
b =150; # longitude of B

#calculation
dol =360-(b-a); # difference of longitude

#result
print " difference of longitude is in degrees",round(dol);
 difference of longitude is  33.0
 difference of longitude is  130.0
 difference of longitude is  70.0
 difference of longitude is  170.0

Example 1.2.1,Page 31

In [3]:
#finding distance between two points

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos
latA =28.0+42.0/60.0; # latitude of A
lonA =31.0*60.0+12.0; # longitude of A
latB =28.0+42.0/60.0; # latitude of B
lonB =47.0*60.0+24.0; # longitude of B

#calculation
d=( lonB - lonA )*cos( latA /180* pi);

#result
print  " distance between A & B in (km) ",round(d *1.852,3)
 distance between A & B in (km)  1578.989

Example 1.2.2,Page 31

In [2]:
#finding distance between two points

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos
latA =12.0+36.0/60.0; # latitude of A
lonA =115.0*60.0+6.0; # longitude of A
latB =12.0+36.0/60.0; # latitude of B
lonB =-150.0*60.0-24.0; # longitude of B

#calculation
d=( 360*60+lonB - lonA )*cos( latA /180* pi);

#result
print  " distance between A & B in (km)  ",round(d *1.852,3) 
 distance between A & B in (km)   10247.946

Example 1.3,Page 31

In [4]:
#finding distance between two points

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
latA =15;
latB =12.0+6.0/60.0;
lonA =50.0+12.0/60.0;
lonB =54.0;
Re =6370.0; # radius of earth

#calculation
b=(90 - latA )*pi /180;
a=(90 - latB )*pi /180;
P=( lonB - lonA )*pi /180;
p= acos ( cos (P)*sin(a)* sin (b)+ cos (a)*cos(b)); #spherical triangle law
x= atan ( cos (a/2-b/2)/ cos (a/2+b /2) * tan (pi /2-P /2) );#spherical triangle law 
y= atan ( sin (a/2-b/2)/ sin (a/2+b /2) * tan (pi /2-P /2) ); #spherical triangle law
dol =pi -x-y;
dol=dol*180/pi;
a=  dol *3600 %60;
b=  ((dol *3600 -a)%3600) /60;
c=( dol *3600 - b*60 -a) /3600;

#result
print " distance from A to B in (km)  ",round(p*Re,3);
print " direction of B from A towards east of south ",round(a,3),"seconds",b,"minutes",c,"degrees";
 distance from A to B in (km)   522.104
 direction of B from A towards east of south  35.16 seconds 19.0 minutes 52.0 degrees

Example 1.4,Page 33

In [27]:
#finding distance between two points

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = (md - m) * 60
    sd=round(sd,2)
    return [d, m, sd]
latA =45.0;
a1=45.0+13.108/60;
p =(300.0/60.0) *pi /180; # side AB
b=(90 - latA )*pi /180; # side PA

# calculation
a= acos ( cos (p)*cos(b)); # side BP
BC=a *180/ pi - latA ;
d=BC *1.852*60;
B=asin(sin(latA*pi/180)/sin(a1*pi/180));
B=deg_to_dms(B*180/pi);


#result
print " distance of BC in (km)",round(d,3)
print "the angle in deg,min,sec is",B
 distance of BC in (km) 24.181
the angle in deg,min,sce is [85, 0, 33.27]

Example 1.6.1,Page 37

In [13]:
#finding altitude and zenith distance of star

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
delta =42+15.0/60; # declination of star
theta =26+40.0/60; # lattude of star

#caculation
zend =90.0 - theta -90+ delta ;
alt =90.0 - zend ;

#for zenith distance
#a=  zend *3600 %60;
b=  ((zend *3600 )%3600) /60;
c=( zend *3600 - b*60 -a) /3600;
print " zenith distance ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for altitude
a=  alt *3600 %60;
b=  ((alt *3600 -a)%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";
 zenith distance  0.0 seconds 35.0 minutes 15.0 degrees
 altitude of star  0.0 seconds 25.0 minutes 74.0 degrees

Example 1.6.2,Page 36

In [12]:
#finding altitude and zenith distance of star

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
delta =23+20.0/60; # declination of star
theta =26+40.0/60; # lattude of star

#caculation
zend =90.0 + theta -90- delta ;
alt =90.0 - zend ;

#for zenith distance
a=  zend *3600 %60;
b=  ((zend *3600 -a)%3600) /60;
c=( zend *3600 - b*60 -a) /3600;
print " zenith distance ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for altitude

b=  ((alt *3600 )%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";
 zenith distance  0.0 seconds 20.0 minutes 3.0 degrees
 altitude of star  0.0 seconds 40.0 minutes 86.0 degrees

Example 1.6.3,Page 37

In [5]:
#finding altitude and zenith distance of star

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
delta =65+40.0/60; # declination of star
theta =26+40.0/60; # lattude of star

#caculation
zend =90.0 - theta -90+ delta ;
alt =90.0 - zend ;

#for zenith distance
a=  zend *3600 %60;
b=  ((zend *3600 -a)%3600) /60;
c=( zend *3600 - b*60 -a) /3600;
print " zenith distance ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for altitude
a=  alt *3600 %60;
b=  ((alt *3600 -a)%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";
 zenith distance  0.0 seconds 0.0 minutes 39.0 degrees
 altitude of star  0.0 seconds 0.0 minutes 51.0 degrees

Example 1.7,Page 37

In [10]:
#finding altitude and zenith distance of star

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
delta =85+20.0/60; # declination of star
theta =46+50.0/60; # lattude of star

#caculation
zend =90.0 - theta +90- delta ;
alt =90.0 - zend ;

#for zenith distance

b=  ((zend *3600 )%3600) /60;
c=( zend *3600 - b*60 -a) /3600;
print " zenith distance ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for altitude
a=  alt *3600 %60;
b=  ((alt *3600 -a)%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";
 zenith distance  0.0 seconds 50.0 minutes 47.0 degrees
 altitude of star  0.0 seconds 10.0 minutes 42.0 degrees

Example 1.8,Page 38

In [15]:
#finding altitude and zenith distance of star

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
delta =56+10.0/60; # declination of star
theta =56+10.0/60; # lattude of star

#caculation
zend =90.0 - theta +90- delta ;
alt =90.0 - zend ;

#for zenith distance
a=  zend *3600 %60;
b=  ((zend *3600-a )%3600) /60;
c=( zend *3600 - b*60 -a) /3600;
print " zenith distance ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for altitude
#a=  alt *3600 %60;
b=  ((alt *3600 )%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";
 zenith distance  0.0 seconds 40.0 minutes 67.0 degrees
 altitude of star  0.0 seconds 20.0 minutes 22.0 degrees

Example 1.9,Page 38

In [22]:
#finding latitude and declination 

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
import numpy as np
a=np.array([[1.0,-1.0],[1.0,1.0]])
b=np.array([59.0/3,332.0/3])

#calculation
x=np.linalg.solve(a,b);

#result
print"declination of star in (degrees)",round(x[0],3);
print"latitude of the place of observation (degrees)",x[1];
declination of star in (degrees) 65.167
latitude of the place of observation (degrees) 45.5

Example 1.10,Page 39

In [32]:
#finding azimuth and altitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
theta =20+30.0/60;
H =42+6.0/60; # hour angle
delta =50.0;


# in triangle ZPM

#calculation
PZ =(90 - delta )*pi /180;
H=H*pi /180;
PM =(90 - theta )*pi /180;
ZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));
alpha =pi /2- ZM;
alpha = alpha *180/ pi;
A =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));

if A <0:
    A=-A;
    A=acos(A)
    A=180-A*180/pi;
 

#for altitude
alt=alpha;
a=  alt *3600 %60;
b=((alt *3600-a )%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";


#for azimuth    
a=  A *3600 %60;
b=  ((A *3600-a )%3600) /60;
c=( A *3600 - b*60 -a) /3600;
print" azimuth of star in (degrees ) westwards ",round(a,3),"seconds",b,"minutes",c,"degrees";
 altitude of star  36.75 seconds 38.0 minutes 45.0 degrees
 azimuth of star in (degrees ) westwards  25.551 seconds 4.0 minutes 116.0 degrees

Example 1.11,Page 40

In [31]:
#finding azimuth and altitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
theta = -8 -30.0/60;
H =322.0; # hour angle
delta =50;


# in triangle ZPM

#calculation
PZ =(90 - delta )*pi /180;
H =2* pi -H*pi /180;
PM =(90 - theta )*pi /180;
ZM= acos (( cos (PZ)* cos (PM)+sin(PM)*sin(PZ)* cos (H)));
alpha =pi /2- ZM;
alpha=alpha*180/pi;
A =(( cos(PM)-cos (PZ)* cos (ZM))/ sin (PZ)/sin(ZM));

if A <0:
    A=-A;
    A=acos(A)
    A=180-A*180/pi;
 
#result
#for altitude
alt=alpha;
a=  alt *3600 %60;
b=((alt *3600-a )%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " altitude of star ",round(a,3),"seconds",b,"minutes",c,"degrees";


#for azimuth    
a=  A *3600 %60;
b=  ((A *3600-a )%3600) /60;
c=( A *3600 - b*60 -a) /3600;
print" azimuth of star in (degrees ) eastwards ",round(a,3),"seconds",b,"minutes",c,"degrees";
 altitude of star  48.256 seconds 48.0 minutes 22.0 degrees
 azimuth of star in (degrees ) eastwards  22.798 seconds 39.0 minutes 138.0 degrees

Example 1.12,Page 42

In [34]:
#finding hour angle

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
alpha =22+36.0/60; # altitude of star
A =42.0 # azimuth angle
delta =40.0; # latitude of observer

# in triangle ZPM

#calculation
PZ =(90 - delta )*pi /180;
A=A*pi /180;
ZM =(90 - alpha )*pi /180;
PM= acos (( cos (PZ)* cos (ZM)+sin(ZM)*sin(PZ)* cos (A)));
theta =pi /2- PM
theta=theta*180/pi;
H =(( cos(ZM)-cos (PZ)* cos (PM))/ sin (PZ)/sin(PM));
if H <0:
    H=-H;
    H=acos(H)
    H=180-H*180/pi;
 

#result
#for declination 
alt=theta;
a=  alt *3600 %60;
b=((alt *3600-a )%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " declination of star ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for hour angle
a=  H *3600 %60;
b=  ((H *3600-a )%3600) /60;
c=( H *3600 - b*60 -a) /3600;
print" hour angle of star  ",round(a,3),"seconds",b,"minutes",c,"degrees";
 declination of star  12.44 seconds 35.0 minutes 50.0 degrees
 hour angle of star   5.342 seconds 21.0 minutes 103.0 degrees

Example 1.13,Page 42

In [44]:
#finding hour angle

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
alpha =21+30.0/60; # a l t i t u d e o f s t a r
A =140.0 # azimuth a n g l e
delta =48.0; # l a t i t u d e o f o b s e r v e r

#calculation
PZ =(90 - delta )*pi /180;
A=A*pi /180;
ZM =(90 - alpha )*pi /180;
PM =( cos(PZ)*cos(ZM)+ sin (ZM)* sin (PZ)* cos (A));

if PM <0:
    PM=-PM
    PM=acos(PM)
    PM=180-PM*180/pi;

H= acos (( cos (ZM)-cos(PZ)*cos(PM*pi /180) )/ sin (PZ)/sin (PM*pi /180) );
H =2* pi -H;
H=H*180/pi;

#result
#for declination 
alt=PM-90;
a=  alt *3600 %60;
b=((alt *3600-a )%3600) /60;
c=( alt *3600 - b*60 -a) /3600;
print " declination of star southwards ",round(a,3),"seconds",b,"minutes",c,"degrees";

#for hour angle
a=  H *3600 %60;
b=  ((H *3600-a )%3600) /60;
c=( H *3600 - b*60 -a) /3600;
print" hour angle of star  ",round(a,3),"seconds",b,"minutes",c,"degrees";
 declination of star southwards  12.098 seconds 48.0 minutes 11.0 degrees
 hour angle of star   22.619 seconds 20.0 minutes 322.0 degrees

Example 1.14,Page 43

In [10]:
#finding hour angle

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = (md - m) * 60
    sd=round(sd,2)
    return [d, m, sd]
# part 1
delta =22+12.0/60;
theta =42+30.0/60;

#calculation
ZP =(90 - theta )*pi /180;
PM =(90 - delta )*pi /180;
A= acos ( cos (PM)/sin(ZP));
H=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi
A=deg_to_dms(A*180/ pi);
H=deg_to_dms(H/15);

#result
print " azimuth of setting sun in ( degrees,min,second)  ",A
print " suns hour angle in ( hr,min,second ) : ",H

#part 2
delta = -22 -12/60;
theta =42+30.0/60;

#calculation
ZP =(90 - theta )*pi /180;
PM =(90 - delta )*pi /180;
A= acos ( cos (PM)/sin(ZP));
H=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi
A=deg_to_dms(A*180/ pi);
H=deg_to_dms(H/15);

#result
print " azimuth of setting sun in ( degrees,min,second)  ",A
print " suns hour angle in ( hr,min,second ) : ",H
 azimuth of setting sun in ( degrees,min,second)   [59, 10, 14.72]
 suns hour angle in ( hr,min,second ) :  [7, 27, 50.23]
 azimuth of setting sun in ( degrees,min,second)   [120, 32, 13.17]
 suns hour angle in ( hr,min,second ) :  [4, 33, 4.97]

Example 1.15,Page 44

In [11]:
#finding hour angle

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
delta =22+12.0/60;
theta =42+30.0/60;
ef deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = (md - m) * 60
    sd=round(sd,2)
    return [d, m, sd]

#calculation
ZP =(90 - theta )*pi /180;
PM =(90 - delta )*pi /180;
A= acos ( cos (PM)/sin(ZP));
H=180 - acos ( tan (pi /2- ZP)*tan(pi /2- PM)) *180/ pi
A=deg_to_dms(180-A*180/ pi);
H=deg_to_dms(H/15);

#result
print " azimuth of setting sun in ( degrees,min,second)  ",A
print " suns hour angle in ( hr,min,second ) : ",H
 azimuth of setting sun in ( degrees,min,second)   [120, 49, 45.28]
 suns hour angle in ( hr,min,second ) :  [7, 27, 50.23]

Example 1.16,Page 61

In [1]:
#finding error in time

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
time = -3 -28.41/60; # greenwich time at july 1 1951
change = -11.82/60;
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = (md - m) * 60
    sd=round(sd,2)
    return [d, m, sd]

#calculation
c12 = change/24*12 # change of time in 12 hours
tch =time +c12;
tch=deg_to_dms(tch/60);

#result
print " greenwich  mean time error in 12 th hour(-ve) in( deg,min,sec)  ",tch
 greenwich  mean time error in 12 th hour(-ve) in( deg,min,sec)   [0, 3, 34.32]

Example 1.17,Page 61

In [5]:
#finding GAT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = (md - m) * 60
    return [d, m, sd]
#printing result in degree minute and seconds respectively 
GMN = -14*60 -10;
changeET =1*1.5;

#calculation
neterr =GMN+ changeET ;
GAT = time + neterr ;
GAT=GAT+10*3600+30*60;
hr= round ( GAT /3600) ;
b=GAT -hr *3600;
mi= round (b /60 -1);
c=GAT -hr *3600 - mi *60;

#result
print hr,"hour",mi,"minutes",c,"seconds of GAT"
10.0 hour 15.0 minutes 48.0265 seconds of GAT

Example 1.18,Page 62

In [21]:
#finding time

#part1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = (md - m) * 60
    return [d, m, sd]
A =50+12.0/60+48.0/3600;
time =A /15*3600

#calculation
hr= round ( time /3600) ;
b=time -hr *3600;
mi= round (b /60 -1);
c=time -hr *3600 - mi *60;

#result
print hr,"hour",mi,"minutes",c,"seconds of angles"

#part 2
#initialisation of variable
A =8+18.0/60+6.0/3600;
time =A /15*3600

#calculation
hr= round ( time /3600-1) ;
b=time -hr *3600;
mi= round (b /60 );
c=time -hr *3600 - mi *60;

#result
print hr,"hour",mi,"minutes",c,"seconds of angles"

#part 3
#initialisation of variable
A =258+36.0/60+30.0/3600;
time =A /15*3600

#calculation
hr= round ( time /3600) ;
b=time -hr *3600;
mi= round (b /60 );
c=time -hr *3600 - mi *60;

#result
print hr,"hour",mi,"minutes",c,"seconds of angles"
3.0 hour 20.0 minutes 51.2 seconds of angles
-0.0 hour 33.0 minutes 12.4 seconds of angles
17.0 hour 14.0 minutes 26.0 seconds of angles

Example 1.19,Page 62

In [15]:
#finding angle

#part1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
A =4+34.0/60+13.0/3600;

#calculation
angle =A *15;
angle=deg_to_dms(angle);

#result
print "angle in degree,minute,second respectively",angle

#part 2
#initialisation of variable
A =18+11.0/60+38.0/3600;

#calculation
angle =A *15;
angle=deg_to_dms(angle);

#result
print "angle in degree,minute,second respectively",angle
angle in degree,minute,second respectively [68, 33, 15.0]
angle in degree,minute,second respectively [272, 54, 30.0]

Example 1.20.a,Page 64

In [10]:
#finding local mean time

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =20 # longitude of the place
longSM =82+30.0/60; # longitude of standard meridion

#calculation
dolong =longSM - longP ; # difference in longitude
dot = dolong /15.0; # difference in time
LMT =20+24.0/60+6.0/3600 - dot ;
LMT=deg_to_dms(LMT)

#result
print "LMT in hours,minute,second respectively",LMT
[16, 14, 6.0] Local mean time in hours,minute,second respectively

Example 1.20.b,Page 64

In [11]:
#finding local mean time

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =-20 # longitude of the place
longSM =82+30.0/60; # longitude of standard meridion

#calculation
dolong =longSM - longP ; # difference in longitude
dot = dolong /15.0; # difference in time
LMT =20+24.0/60+6.0/3600 - dot ;
LMT=deg_to_dms(LMT)

#result
print "LMT in hours,minute,second respectively",LMT
[13, 34, 6.0] Local mean time in hours,minute,second respectively

Example 1.21.a,Page 64

In [12]:
#finding GMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
LMT =9+40.0/60+12.0/3600;
longP = -42 -36.0/60;

#calculation
dot = longP /15;
GMT =LMT -dot;
GMT=deg_to_dms(GMT);

#result
print "GMT in hours,minute,second respectively",GMT
[12, 30, 36.0] GMT in hours,minute,second respectively

Example 1.21.b,Page 64

In [14]:
#finding GMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
LMT =4+32.0/60+10.0/3600;
longP = -56 -32.0/60;

#calculation
dot = longP /15;
GMT =LMT +dot;
GMT=deg_to_dms(GMT);

#result
print "GMT in hours,minute,second respectively",GMT
[0, 46, 2.0] GMT in hours,minute,second respectively

Example 1.22,Page 65

In [1]:
#finding LMT

#initialisation of variable
#part1
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GCT =18+40.0/60+12.0/3600; # greenwich civil time
longP =72+30.0/60; # longitude of the place

#calculation
dot = longP /15.0;
LMT = GCT +dot;
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT

#part 2
#initiallisation of variable
GCT =18+40.0/60+12.0/3600; # greenwich civil time
longP =-72-30.0/60; # longitude of the place

#calculation
dot = longP /15.0;
LMT = GCT +dot;
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT

#part 3
#initialisation of variable
def deg_to_dms(deg):
    d = int(deg);
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d-24, m, sd]
GCT =18+40.0/60+12.0/3600; # greenwich civil time
longP =110+32.0/60; # longitude of the place

#calculation
dot = longP /15.0;
LMT = GCT +dot;
LMT=deg_to_dms(LMT);

#result
print "LMT of next day in hours,minute,second respectively",LMT
LMT in hours,minute,second respectively [23, 30, 12.0]
LMT in hours,minute,second respectively [13, 50, 12.0]
LMT of next day in hours,minute,second respectively [2, 2, 20.0]

Example 1.23,Page 66

In [27]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
LMT =10+20.0/60+30.0/3600; # local mean time
longP =102+30.0/60; # longitude of the place

#calculation
dot = longP /15;
GMT =LMT -dot;
mGMN =12 - GMT ; #mean time interval
i= mGMN *0.32/3600; # increase in mGMN
ETGMN =5.0/60+4.35/3600;
ch=i+ ETGMN ; # change in GMT
GMT =ch+GMT;
LMT = GMT +dot;
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT
[10, 25, 37.07] LMT in hours,minute,second respectively

Example 1.24,Page 67

In [29]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
LMT =15+12.0/60+40.0/3600; # local mean time
longP = -20 -30.0/60; # longitude of the place

#calculation
dot = longP /15;
GMT =LMT -dot;
mGMN =12 - GMT ; #mean time interval
i= mGMN *0.32/3600; # increase in mGMN
ETGMN =5.0/60+4.35/3600;
ch=i+ ETGMN ; # change in GMT
GMT =ch+GMT;
LMT = GMT +dot;
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT
[15, 17, 42.89] LMT in hours,minute,second respectively

Example 1.25,Page 70

In [30]:
#finding sidereal time

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
time =4+20.0/60+30.0/3600;

#calculation
accn = time *9.8565/3600; # acceleration
stime = time + accn ; # sidereal time
stime=deg_to_dms(stime);

#result
print "sidereal time in hours,minute,second respectively",stime
[4, 21, 12.79] sidereal time in hours,minute,second respectively

Example 1.26,Page 71

In [32]:
#finding mean time

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
stime =8+40.0/60+50.0/3600;

#calcculation
accn =-time *9.8565/3600; # acceleration
mtime = stime + accn ; # mean time
mtime=deg_to_dms(mtime);

#result
print "mean time in hours,minute,second respectively",mtime
[8, 40, 7.21] mean time in hours,minute,second respectively

Example 1.27,Page 72

In [34]:
#finding LST on LMM

#part 1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP = -160 -30.0/60 -30.0/3600; # longitude of the place
GST =16+30.0/60+12.0/3600; # standard time

#calculation
dot = longP /15; # difference in time
i= dot *9.8565/3600; # error
LST =GST -i;
LST=deg_to_dms(LST);

#result
print "LST of LMM in hours,minute,second respectively",LST

#part 2
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP = 160 +30.0/60 +30.0/3600; # longitude of the place
GST =16+30.0/60+12.0/3600; # standard time

#calculation
dot = longP /15; # difference in time
i= dot *9.8565/3600; # error
LST =GST -i;
LST=deg_to_dms(LST);

#result
print "LST of LMM in hours,minute,second respectively",LST
[16, 31, 57.47] LST of LMM in hours,minute,second respectively
[16, 28, 26.53] LST of LMM in hours,minute,second respectively

Example 1.28,Page 73

In [38]:
#finding LST 

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =85+20.0/60; # longitude of the place
GST =6+30.0/60; # standard time
GMN =6+32.0/60+12.0/3600;

#calculation
dot = longP /15; # difference in time
i= dot *9.8565/3600;  # error
LST =GMN -i; #LST at L .M.N
i2=GST *9.8565/3600; # error in GST
LST2 =GST+i2;
LST = LST + LST2 # lst at L .M.N
LST=deg_to_dms(LST);

#result
print "LST in hours,minute,second respectively",LST
[13, 2, 19.99] LST in hours,minute,second respectively

Example 1.29,Page 75

In [40]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =112+20.0/60+15.0/3600; # longitude of the place
GST =8+10.0/60+28.0/3600; #GST at GMM
lst =18+28.0/60+12.0/3600; 

#calculation
dot = longP /15; 
i= dot *9.8565/3600; # error
LST = GST +i; #LST at L .M.N
LMM =lst -LST;
i2=LMM *9.8565/3600; # error in LMM
LMT =LMM -i2; # local mean time
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT
[10, 14, 48.91] LMT  in hours,minute,second respectively

Example 1.30,Page 76

In [42]:
#finding LST

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =85+20.0/60; # longitude of the place
GST =18+30.0/60; # standard time
gst =6+32.0/60+12.0/3600; #GST at GMN

#calculation
dot = longP /15; 
GMT =GST -dot -12;
i= GMT *9.8565/3600; # error
GMT = GMT +i; # SI time
LST = GMT +dot+ gst ; #LST at LMT
LST=deg_to_dms(LST);

#result
print "LST  in hours,minute,second respectively",LST
[13, 2, 19.99] LST  in hours,minute,second respectively

Example 1.31,Page 78

In [44]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =112+20.0/60+15.0/3600; # longitude of the place
GST =8+10.0/60+28.0/3600; #GST at GMM
lst =18+28.0/60+12.0/3600; # local sidereal  time

#clculation
dot = longP /15; 
gmm = lst +dot - GST ; # SI at GMM
i= gmm *9.8565/3600; # error
gmm =gmm -i; #LST at L .M.N
LMT =gmm -dot; # local mean time
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT
[10, 14, 48.7] LMT  in hours,minute,second respectively

Example 1.32,Page 79

In [16]:
#finding LMT

#part 1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =162+30.0/60+15.0/3600; # longitude of the place
GST =10+30.0/60+15.0/3600; #GST at GMM
RA =22+11.0/60+30.0/3600; # local sidereal  time

#calculation
dot = longP /15; 
i= dot *9.8565/3600; # e r r o r
gmm = GST +i; #LST at L .M.N
lmn =RA -gmm; # SI o f LMN
i2=lmn *9.8565/3600; # error 2
LMT =lmn -i2;
LMT1=deg_to_dms(LMT);

#result
print "LMT observed at upper transit in hours,minute,second respectively",LMT1

#part 2
#initialisation of variable
i3 =12*9.8565/3600; # retardation

#calculation
LMT = LMT +12 - i3;
LMT=deg_to_dms(LMT);

#result
print "LMT observed at lower transit in hours,minute,second respectively",LMT
LMT observed at upper transit in hours,minute,second respectively [11, 37, 33.31]
LMT observed at lower transit in hours,minute,second respectively [23, 35, 35.04]

Example 1.33,Page 80

In [42]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =60+30.0/60; # longitude of the place
GST =7+30.0/60+48.6/3600; #GST at GMM
RA =17+28.0/60 +40.0/1600;

#calculation
dot = longP /15; 
i= dot *9.8565/3600; # error
gmm =GST -i; #LST at L .M.N
LMT =RA -gmm; # local mean time
i2=LMT*9.8296/3600;
GMT=LMT-i2-longP/15;
LMT=deg_to_dms(LMT);
GMT=deg_to_dms(GMT);

#result
print "LMT in hours,minute,second respectively",LMT
print "GMT in hours,minute,second respectively",GMT
LMT in hours,minute,second respectively [9, 59, 21.15]
GMT in hours,minute,second respectively [5, 55, 42.96]

Example 1.34,Page 82

In [17]:
#finding correct time

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GMT=13+21.0/60+54.0/3600; #GMT of the place
LongA=40+30.0/60; #longitude of A
LongB=-40-30.0/60; #longitude of B

#calculation
delA=LongA/15.0*9.8296/3600;#error
delB=LongB/15.0*9.8296/3600;#error
GA=GMT+delA;
GA=deg_to_dms(GA);
GB=GMT+delB;
GB=deg_to_dms(GB);

#result
print "corected time of A  in hours,minute,second respectively",GA
print "corected time of B  in hours,minute,second respectively",GB
corected time of A  in hours,minute,second respectively [13, 22, 20.54]
corected time of B  in hours,minute,second respectively [13, 21, 27.46]

Example 1.35,Page 83

In [41]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GMT=7+12.0/60+28.0/3600; #GMT of the place
Long=50+30.0/60; #longitude 
LMT=11+30.0/60+12.0/3600; 

#calculation
delA=LongA/15.0*9.8296/3600;#error
delB=LMT*9.8296/3600;#error
LA=GMT+delA; #LMT at transit
LMT=LMT-delB;
LMT=LMT+LA;
LMT=deg_to_dms(LMT);

#result
print "LMT in hours,minute,second respectively",LMT
LMT in hours,minute,second respectively [18, 41, 13.47]

Example 1.36,Page 84

In [43]:
#finding LMT

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GST=8+25.0/60+25.0/3600;

#calculation
GMT=24-GST;
i=GMT*9.8296/3600;
GMT=GMT-i;
GMT=deg_to_dms(GMT);

#result
print "GMT in hours,minute,second respectively",GMT
GMT in hours,minute,second respectively [15, 32, 1.89]

Example 1.37,Page 85

In [17]:
#finding LMT on July 2

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GMT=12+03.0/60+46.09/3600; #GMT of the place
LongA=-130.0; #longitude of A
LongB=49.0;  #longitude of B

#calculation
delA=LongA/15.0*11.71/24/3600;
delB=LongB/15.0*11.71/24/3600;
LMTA=GMT+delA;
LMTA=deg_to_dms(LMTA);
LMTB=GMT+delB;
LMTB=deg_to_dms(LMTB);

#result
print "LMT at A on July 2 in hours,minute,second respectively",LMTA
print "LMT at B on July 2 in hours,minute,second respectively",LMTB
[12, 3, 41.86] LMT at A in hours,minute,second respectively
[12, 3, 47.68] LMT at B in hours,minute,second respectively

Example 1.38,Page 86

In [20]:
#finding LST

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
Lat=50+30.0/60; # latitude of place
Dec=74+22/60; #declination of place
RA=14+50.0/60+52.0/3600;

#calculation
H=acos(tan(Lat*pi/180)/tan(Dec*pi/180));
H=H*180/pi;
H=H/15.0;
LST=H+RA;
LST=deg_to_dms(LST);

#result       
print "LST  in hours,minute,second respectively",LST
[19, 29, 26.59] LST  in hours,minute,second respectively

Example 1.39,Page 87

In [21]:
#finding HA

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
Long=120+30.0/60; #langitude
GST=14+30.0/60+28.25/3600;
GMT=2+5.0/60;
LMN=12.0;
LST=14+31.0/60+47.43/3600;
RA=23+20.0/60+20.0/3600;

#calculation
e1=Long*15.0*9.8565/3600;
GST=GST+e1;
LMT=GMT+24-8-2.0/60;
LMM=LMN+24-LMT; #mean LMN
e2=LMM*9.8565/3600;
LMM=LMM+e2;
LST=LST+24-LMM;
HA=LST-RA+24;
HA=deg_to_dms(HA);

#result
print "HA in hours,minutes,seconds respectively",HA
[21, 11, 30.51] HA in hours,minutes,seconds respectively

Example 1.40,Page 86

In [40]:
#finding HA

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
Long=75+28.0/60; #langitude
LMT=5+30.0/60;
GST=20+15.0/60+32.58/3600;

#calculation
e1=Long/15.0*9.8565/3600;
GST=GST+e1;
e2=LMT*9.8565/3600;
LMT=LMT+e2;
HA=GST+LMT;
HAMS=HA-LMT-12+e2;
HA=deg_to_dms(HA);
HAMS=deg_to_dms(HAMS);

#result
print "HA in hours,minutes,seconds respectively",HA
print "HAMS in hours,minutes,seconds respectively",HAMS
HA in hours,minutes,seconds respectively [25, 47, 16.38]
HAMS in hours,minutes,seconds respectively [8, 17, 16.38]

Example 1.41,Page 90

In [39]:
#finding sun's declination

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
Long=45.0; #langitude
del1=1067.2/3600;
del2=1083.9/3600;
del3=1100.3/3600;
f0=-16-14.0/60-24.0/3600;

#calculation
n=(10-Long/15)/24.0;
Del0=del2-del1;
Del1=del3-del2;
fn=-f0+n*del2+n*(n-1)/4*(Del0+Del1)
fn=deg_to_dms(fn);

#result
print "sun's declination in hours,minutes,seconds respectively",fn
sun's declination in hours,minutes,seconds respectively [16, 19, 38.43]

Example 1.42,Page 101

In [38]:
#finding azimuth of A & B and vertical difference

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
aziA =32+41.0/60+30.0/3600; # azimuth o f A
aziB =110+28.0/60+42.0/3600; # azimuth o f B
vaA =10+21.0/60+12.0/3600; # vertical angle of A
vaB = -2 -18.0/60 -30.0/3600; # vertical angle o f B
lA1 =11;
lB1 =11.5;
rA1 =7.5;
rB1 =7;
lB2 =10;
lA2 =10.5;
rB2 =7.5;
rA2 =8;
d =20;
# partA
#calculation
sigl =lA1+ lA2 ;
sigr =rA1+ rA2 ;
b= sigl /4*d- sigr /4*d;
i= tan( vaA );
caziA = aziA +i *29.95/3600;
caziA1=deg_to_dms(caziA);

#result
print "corrected azimuth of A in (degrees,minutes,seconds)",caziA1

#part2 
#calculation
i= tan( vaB );
caziB = aziB +i*b /3600;
ha=caziB - caziA;
caziB=deg_to_dms(caziB);
ha=deg_to_dms(ha);

#result
print "corrected azimuth of B in (degrees,minutes,seconds)",caziB
print "horizontal difference of angle between A & B in (degrees,minutes,seconds)",ha
corrected azimuth of A in (degrees,minutes,seconds) [32, 42, 10.04]
corrected azimuth of B in (degrees,minutes,seconds) [110, 29, 15.02]
horizontal difference of angle between A & B in (degrees,minutes,seconds) [77, 47, 4.98]

Example 1.43,Page 102

In [12]:
#finding altitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
v1 =18+36.0/60+48.0/3600; # vertical angle 1
v2 =18+35.0/60+56.0/3600; # vertical angle 2
slm =28+36.0/60+20.0/3600; # altitude of sun measured
ds =15.0/60+59.35/3600; # dia of sun

#calculation
mv =( v1+v2) /2; #mean vertical angle
i=v1 -v2; # error
sl=slm+i; #new altitude of sun
sl=sl+ds;
ir = -57.0/3600/( tan( slm *pi /180+26* pi /180/3600) );#error due to refraction
sl=sl+ir;
ip =8.8/3600* cos( slm *pi /180+26* pi /180/3600);# error due to parallex
sl=sl+ip;
sl=deg_to_dms(sl);

#result
print "corrected altitude in (deg,min,sec) respectively",sl
[28, 51, 34.59] corrected altitude in (deg,min,sec) respectively

Example 1.44,Page 115

In [17]:
#finding chronometer error

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
long =4+30.0/60;
i= long *9.8565/3600; # longitude
gst =14+38.0/60+12.0/3600; #GST on GMM
lst =gst -i; #LST on LMM
RA =7+36.0/60+21.24/3600;

#calculation
LST =RA;
SI=LST - lst +24;
LCT =17+56.0/60+8.86/3600 -1; # local chronometer time
i2=SI *9.8296/3600;
LMM =SI -i2;
ce=LCT - LMM ;

#result
print  " chronometer error in (s)",round(ce *3600,2)
2.19  chronometer error in (s)

Exampe 1.45,Page 116

In [21]:
#finding chronometer error

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
c =90 -36 -30.0/60 -30.0/3600; # co latitude
p =90 -16 -12.0/60 -18.4/3600; # co declination
z =90 -30 -12.0/60 -30.0/3600; # co altitude
s=(p+z+c) /2;

#calculation
s1=s-c;
s2=s-p;
s3=s-z;
H =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin (s*pi/180) / sin (s3*pi /180) ));
H=H *180/ pi;
H=24 -H /15;
LST =H +5+18.0/60+12.45/3600 -24;
ce =1+2.0/60+5.25/3600 - LST ;

#result
print  " chronometer error in (s)",round (ce *3600+2,2)
19.34  chronometer error in (s)

Example 1.46,Page 118

In [2]:
#finding chronometer error

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
c =90 -36 -40.0/60 -30.0/3600; # co latitude
p =90 -17 -26.0/60 -42.1/3600; # co declination
z =90 -36 -14.0/60 -16.8/3600; # co altitude

#calculation
s=(p+z+c) /2;
s1=s-c;
s2=s-p;
s3=s-z;
H =2* atan ( sqrt (sin(s1*pi /180) * sin (s2*pi /180) / sin(s*pi/180) / sin (s3*pi /180) ));
H=H *180/ pi;
H=H /15;
i =12 -11 -56.0/60 -22.8/3600; # error in time
LAT =15+49.0/60+40.6/3600; # local actual time
GAT =LAT -H;
GMT =GAT -i;
LMT = GMT +H;
ce =15+49.0/60+12.6/3600 - LMT;
ce=deg_to_dms(ce)

#result
print  " chronometer error in (s)",ce
 chronometer error in (s) [0, 3, 9.2]

Example 1.47,Page 119

In [3]:
#finding chronometer error

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
RA =17+12.0/60+48.0/3600;
gst =9+26.0/60+12.0/3600; #GST on GMN
long =138.0/15+45.0/15/60; # l o n g i t u d e
lst =- long *9.85645/3600+9+26.0/60+12.0/3600; #LST on LMN
LST =17+12.0/60+48.0/3600; # local sidereal time

#calculation
SI=LST - lst ;
MI=-SI *9.8296/3600+ SI;
LCT =7+47.0/60+2.0/3600; # local chronometer time
ce=LCT -MI;

#result
print " chronometer error in (s)",round(ce *3600,2) 
 chronometer error in (s) 11.52

Example 1.48,Page 145

In [34]:
#finding azimuth,latitude,LMT

#part 1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
theta =54+30.0/60; # l o g i t u d e
delta =62+12.0/60+21.0/3600; # d e c l i n a t i o n

#calculation
lat = asin (sin( theta *pi /180) /sin( delta *pi /180) );
lat = lat *180/ pi;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;

#part 2
#initialisation of variable
A =53+25.0/60; # azimuth of star
h =65+18.0/60+42.0/3600; # horizontal angle

#calculation
A=A+h;
A=360-A;
A=deg_to_dms(A);

#result
print "Azimuth in (deg,min,sec)",A;

#part 3 
#initialisation of variable
lst =4+39.0/60+6.5/3600; #LST o f LMN
LST =10+58.0/60+38.0/3600+2+49.0/60+25.3/3600; #LST of observation

#calculation
LMN =LST -lst;
i= LMN *9.8565/3600; # e r r o r
LMT =LMN -i;
LMT=deg_to_dms(LMT)

#results
print "LMT in (hr,min,sec)",LMT;
[66, 58, 7.13] Latitude in (deg,min,sec)
[241, 16, 18.0] Azimuth in (deg,min,sec)
[9, 7, 26.62] LMT in (hr,min,sec)

Example 1.49,Page 148

In [6]:
#finding azimuth,latitude,LMT

#part 1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
theta =53+32.0/60; # logitude
delta =56+42.0/60+53.2/3600; # declination
lat = asin (sin ( theta *pi /180) /sin( delta *pi /180) );
lat = lat *180/ pi;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;

#part 2
#initialisation of variable
As= asin ( cos ( delta *pi /180) /cos ( theta *pi /180) ); #azimuth of star
h =75+18.0/60+20.0/3600; # angle between line and star

#calculation
A=h-As *180/ pi;
A=360 -A;
A=deg_to_dms(A);

#result
print "Azimuth in (deg,min,sec)",A;

#part 3
#initialisation of variable
LST =10+58.0/60+3.9/3600+22+10.0/60+38.5/3600 -24; #LST of observation
long =5+40.0/60+18.0/3600; # longitude

#calculation
i= long *9.8565/3600; # error
lst =4+58.0/60+23.84/3600+ i; #LST on LMN
LMM =LST -lst;
i2=LMM *9.8565/3600; # error in LMM
LMT =LMM -i2;
LMT=deg_to_dms(LMT)

#results
print "LMT in (hr,min,sec)",LMT;
Latitude in (deg,min,sec) [74, 9, 33.08]
Azimuth in (deg,min,sec) [352, 7, 3.66]
LMT in (hr,min,sec) [4, 8, 41.69]

Example 1.50,Page 151

In [3]:
#finding azimuth

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
Long =(15.0+30.0/60); 
GMT =19+12.0/60+28.6/3600;
GST=10+12.0/60+36.2/3600;
RA=10 +12.0/60 +6.3/3600;
theta=35.0;
delta=20+6.0/60+48.4/3600;

#calculation
i= Long/15.0 *9.8656/3600; 
LSTofLMM=GST-i;
LMT = GMT + Long/15.0 ;
i2=LMT *9.8656/3600; # error in LMT
SI = LMT +i2;
LST =LSTofLMM+ SI ;
H=LST-RA ; # hour angle
H=H *15;
H=360 -H;
B=atan(tan(delta*pi/180)/cos(H*pi/180));
B=B*180/pi;
x=B-theta; #defined as 'B-theta'
As= atan ( tan ((H) *pi /180) * cos((B) *pi /180) / sin ((x)*pi /180) );#calculating azimuth 
h =36+28.0/60+18.0/3600; # angle between line and star
A =180+ As *180/ pi -h; #azimuth
A=deg_to_dms(A);

#result
print "Azimuth in (deg,min,sec)",A;
print "there is a miscalculation in the step of calculating As thus resulted in change in answer"
Azimuth in (deg,min,sec) [55, 16, 8.27]
there is a miscalculation in the step of calculating As thus resulted in change in answer

Example 1.51,Page 153

In [35]:
#finding azimuth

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alpha =33+35.0/60+10.0/3600; # altitude
ZM =90 - alpha ;
delta =22+5.0/60+35.0/3600; # declination
PM =90 - delta ;
theta =52+30.0/60+20.0/3600; # latitude
ZP =90 - theta ;

#calculation
As= acos (( cos (PM*pi /180) -cos(ZP*pi /180) * cos (ZM*pi/180) )/( sin (ZP*pi /180) *sin(ZM*pi /180) ));
h =18+20.0/60+30.0/3600; # angle between line and star
A=As *180/ pi+h;
A=deg_to_dms(A);

#result
print "Azimuth in (deg,min,sec)",A;
Azimuth in (deg,min,sec) [115, 27, 19.68]

Example 1.52,Page 154

In [34]:
#finding declination,altitude

#part 1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GAT =5+17.0/60+6.0/60; #GAT 
delta =17+46.0/60+52.0/3600; # declination

#calculation
i =37.0/3600* GAT ;
delta =delta -i;
delta1=deg_to_dms(delta);

#result
print "Declination in (deg,min,sec)",delta1;

#part 2
#initialisation of variable
p=90 - delta ; # co declination
altitude =23+15.0/60+20.0/3600; # altitude of sun
i2 =2.0/60+12.0/3600; # error due to refraction
i3 =8.0/3600; # error due to parallax

#calculation
altitude = altitude -i2+i3;
c =90 -55 -46.0/60 -12.0/3600; # colatitude
z=90 - altitude ; # co altitude
s=(p+z+c) /2;
s1=s-c;
s2=s-p;
s3=s-z;
A =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));
A=A *180/ pi;
A=deg_to_dms(A);

#result
print "Altitude in (deg,min,sec)",A;
Declination in (deg,min,sec) [17, 43, 32.82]
Altitude in (deg,min,sec) [92, 23, 10.67]

Example 1.53,Page 156

In [33]:
#finding azimuth

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
GMT =17+5.0/60+2.0/3600; 
i =9.8565/3600* GMT;
GST =3+12.0/60+12.0/3600;
wl =1+18.0/60; # west longitude
RA =16+23.0/60+30.0/3600;

#calculation
H= GMT +i+ GST +wl -RA; # hour angle
H=H *15;
p =90 -29 -52.0/60;
c =90 -52 -8.0/60;
z= acos ( cos (H*pi /180) * sin (p*pi /180) *sin(c*pi /180) + cos(p*pi /180) * cos (c*pi /180) );
A= asin ( sin (p*pi /180) * sin (H*pi /180) /sin(z));
A=A *180/ pi
A=deg_to_dms(A);

#result
print "Azimuth in (deg,min,sec)",A;
Azimuth in (deg,min,sec) [78, 38, 33.24]

Example 1.54,Page 157

In [5]:
#finding azimuth

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
c2 =24+30.0/60+20.0/3600;
d2 =24+30.0/60+40.0/3600;
c3 =25;
d3 =25+1.0/60;

#calculation
alt =( c2+c3+d3+d2)/4;#mean observed altitude
il =(10.6 -9.4) /4*15.0/3600; # error 
alt = alt +il;
ir = -57.0/3600/ tan (( alt *pi /180) ); # correction of refraction
ip =8.0/3600* cos (alt*pi /180) ; # correction of parallax
alt =alt -ir+ip;#altitude corrected
z=90 - alt;#ZM
delta =1+32.0/60+16.8/3600 -56.2/3600*(3.0/60+1.86/3600) ;#declination of sun
p=90 - delta ;#PM
c =90 -36 -48.0/60 -30.0/3600;#ZP
s=(p+z+c) /2;
s1=s-c;
s2=s-p;
s3=s-z;
A =2* atan ( sqrt (sin(s3*pi /180) * sin (s1*pi /180) / sin (s*pi/180) / sin (s2*pi /180) ));#azimuth calculation
A=A *180/ pi;
A=A +81+59.0/60+10.0/3600;
A=360 -A;
A=deg_to_dms(A);

#result
print "Azimuth in (deg,min,sec)",A;
print "there is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer"
Azimuth in (deg,min,sec) [170, 1, 36.93]
there is a miscalculation in the step of calculating Azimuth and error due to refrection thus resulted in change in answer

Example 1.55,Page 178

In [58]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alpha =65+40.0/60+18.0/3600; # altitude
delta =53+12.0/60+10.0/3600; # declination

#calculation
i =57.0/3600*1/ tan ( alpha *pi /180) ; 
alpha =alpha -i;
z=90 - alpha ; # zenith distance
lat =delta -z;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat
[28, 52, 2.23] Latitude in (deg,min,sec)

Example 1.56,Page 178

In [31]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alpha =64+36.0/60+20.0/3600; # altitude
delta =26+12.0/60+10.0/3600; # declination

#calculation
i =57.0/3600*1/ tan ( alpha *pi /180) ; # error
alpha =alpha -i;
z=90 - alpha ; # zenith distance
lat = delta +z;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat
Latitude in (deg,min,sec) [51, 36, 17.06]

Example 1.57,Page 178

In [62]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alpha =44+12.0/60+30.0/3600; # altitude
longP =75+20.0/60+15.0/3600; # longitude of place
delta =22+18.0/60+12.8/3600; # declination of sun

#calculation
i =57.0/3600*1/ tan ( alpha *pi /180) ; # error
i2 =8.78/3600* cos( alpha ); #error due to parallax
i3 =15.0/60+45.86/3600; #error due to semi diameter
alpha =alpha -i+i2+i3;
z=90 - alpha ; # zenith distance
delT = longP /15;
i4 =6.82/3600* delT ; # error in time
delta =i4+ delta ;
lat = delta +z;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat
[67, 51, 21.23] Latitude in (deg,min,sec)

Example 1.58,Page 180

In [69]:
#finding alpha1,alpha2

#for alpha 1
#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
theta =80;
delta =46+45.0/60+30.0/3600;

#calculation
alpha1 =90 - theta + delta ;
alpha1=deg_to_dms(alpha1);

#result
print "alpha1 to the north in (deg,min,sec)",alpha1

#for alpha2
#calculation
alpha2 = theta +delta -90;
alpha2=deg_to_dms(alpha2)

#result
print "alpha2 to the south(deg,min,sec)",alpha2
[56, 45, 30.0] alpha1 to the north in (deg,min,sec)
[36, 45, 30.0] lpha1 to the south(deg,min,sec)

Example 1.59,Page 181

In [8]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
delta1 =20+25.0/60+48.0/3600; # declination of star 1
delta2 =79+30.0/60+52.0/3600; # declination of star 2
alpha1 =48+18.0/60+12.0/3600; #altitude of star 1
alpha2 =47+54.0/60+6.0/3600; #altitude of star 2

#calculation
r1 =58.0/3600/ tan( alpha1 *pi /180) # error 1
r2 =58.0/3600/ tan( alpha2 *pi /180) # error 2
lat =90 -( alpha1 - alpha2 ) /2+( delta1 - delta2 ) /2+( r1 -r2)/2;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;
print " there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer"
Latitude in (deg,min,sec) [60, 15, 24.63]
 there is a miscalculation in the step of calculating (delta1-delta2)/2 so there is a difference in the answer

Example 1.60,Page 182

In [74]:
#finding latitude,declination

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alphal =18+36.0/60+40.0/3600; #altitude at lower culmination
alphau =59+48.0/60+20.0/3600; #altitude at upper culmination
lat =( alphal + alphau )/2;
lat1=deg_to_dms(lat);
delta =90+ lat - alphau ;
delta1=deg_to_dms(delta);


#result
print "Latitude in (deg,min,sec)",lat1;
print "Declination of star in (deg,min,sec)",delta1
[39, 12, 30.0] Latitude of star in (deg,min,sec)
[69, 24, 10.0] Declination of star in (deg,min,sec)

Example 1.61,Page 183

In [75]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alpha =40+36.0/60+30.0/3600; # altitude of star
delta =10+36.0/60+40.0/3600; # declination of star
H =46+36.0/60+20.0/3600; # hour angle of star

#calculation
n= atan ( tan ( delta *pi /180) /cos(H*pi /180) );
lat =n+ acos ( sin ( alpha *pi /180) *sin(n)/ sin ( delta *pi/180) );
lat = lat *180/ pi;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;
[36, 49, 43.99] Latitude in (deg,min,sec)

Example 1.62,Page 183

In [78]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
alpha =42+10.0/60+40.0/3600; # altitude o f sun
delta =23+12.0/60+18.6/3600; # declination of sun ' s angle
LMT =14+50.0/60;

#calculation
i =57.0/3600*1/ tan ( alpha *pi /180) ; # error
i2 =8.78/3600* cos( alpha ); # correction due to parallax
i3 =15.0/60+45.86/3600; # coreection due to semi diamter
longP =108+30.0/60; # longitude of place
alpha =alpha -i+i2+i3;
delT = longP /15; # change in time
GMT = LMT + delT ;
i4 =1.2/3600* GMT; # error in time
H=( GMT -12+ i4 - delT ) *15; # hour angle
i5 =10.6/3600* GMT; # error in declination
delta = delta +i5;
ZM =(90 - alpha )*pi /180;
PM =(90+ delta )*pi /180;
A= asin ( sin (PM)/sin(ZM)* sin (H*pi /180) );
A=pi -A;
ZP =2* atan ( sin (A/2+ H*pi /360) / sin (A/2-H*pi /360) *tan(PM/2- ZM /2) );
lat =pi /2- ZP;
lat = lat *180/ pi +1+6.0/60;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;
[1, 19, 7.46] Latitude in (deg,min,sec)

Example 1.63,Page 185

In [79]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
delta =15+20.0/60+48.0/3600; # declination of star
Int =9+22.0/60+6.0/3600; # interval

#calculation
dint =Int *9.8565/3600; # change in interval
H=( Int+ dint ) *15/2; # hour angle
lat = atan (tan( delta *pi /180) /cos(H*pi /180) );
lat = lat *180/ pi +5.0/6*16.0/3600;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;
[39, 22, 1.79] Latitude in (deg,min,sec)

Example 1.64,Page 186

In [81]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
RA =1+41.0/60+48.64/3600;
lat =48+36.0/60+40/3600; # latitude
delta =88+58.0/60+28.26/3600; # declination of polaris
GMM =16+48.0/60+20.86/3600;
longP =7+20.0/60; # longitude of place P
i1 =51.0/3600; # error due to barometer
i2 =1.0/3600; # error due to barometer
i3 = -1.0/3600; # error due to temp

#calculation
lat =lat -i1+i2+i3;
delT = longP /15;
i4= delT *9.8565/3600;
lst = GMM +i4;
LMT =20+24.0/60+50.0/3600;
i6 =9.8565/3600* LMT ; # e r r o r i n LMT
LST = LMT +i6+lst -24;
H=LST -RA; # hour a n g l e
H=H *15;
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) ;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;
[49, 36, 18.45] Latitude in (deg,min,sec)

Example 1.65,Page 187

In [85]:
#finding latitude

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan,asin
def deg_to_dms(deg):
    d = int(deg)
    md = abs(deg - d) * 60
    m = int(md)
    sd = round((md - m) * 60,2)
    return [d, m, sd]
longP =120 -4 -20.0/60; # longitude of point
GST =8+30.0/60+20.0/3600; #GST on GMM
delta =6+15.0/60+2.0/3600; # deflection
alpha =39+20.0/60+30.0/3600; # altitude
theta =56+54.0/60+30.0/3600; # longitude

#calculation
delT = longP /15;
i= delT *9.8565/3600; # error in time
lst = GST +i; #LST on LMM
LST =19+52.0/60+16.0/3600;
RA=LST;
LMN =LST -lst;
i2=LMN *9.8565/3600; # error in LMN
LMN =LMN -i2;
OSM =10+55.0/60+30.0/3600; #Observed mean time
i3 =1.0/60+25.0/3600; # e r r o r i n obs e r v ed t ime
OSM =OSM -i3;
LMT = OSM +4.0/15+21.0/60.0/15;
I=LMN - LMT ; # interval
i4 =1.21/3600; # error in interval
I=I+i4;
H=I; # hour angle
B= cos ( delta *pi /180) * cos ( theta *pi /180) / cos ( alpha *pi/180) ;
m =225* H **2*3600**2/2.0/206265.0;
lat = alpha +m*B /3600;
lat =90 - lat +6+15.0/60+2.0/3600;
lat=deg_to_dms(lat);

#result
print "Latitude in (deg,min,sec)",lat;
[56, 53, 17.77] Latitude in (deg,min,sec)
In [ ]: