PRO L0B0P0,rok,m,d,st,L,B,P,ro ; ; Some spherical astronomy exercise... ; INPUTS: rok = year (yyyy) ; m = month ; d = day ; st = hour ; OUTPUTS: L = Carrington longitude of the central meridian ; B = disk centre latitude ; P = position angle of solar axis ; ro = apparent solar radius ; all in degrees ; ; Copyright M. Klvana and M. Sobotka, ASU AVCR Ondrejov, Czech Rep., 2008 ;julian date: if m lt 3 then $ jd=double(365.)*rok+d+31.*(m-1)+fix((rok-1)/4.)-fix(0.75*fix(((rok-1)/100.)+1))+1721059. $ else $ jd=double(365.)*rok+d+31.*(m-1)-fix(0.4*m+2.3)+fix(rok/4.)-fix(0.75*fix(rok/100.)+1)+1721059. jd=jd+st/24.+0.5 ;odstraneni chyby vypoctu po 28.2.2001, kdy chybi jeden den if m gt 2 and rok gt 2000 then jd=jd+1 ;and the rest... T=(jd-2415020)/36525. tt=double(rok)-1850 E=0.409318494-0.000227862*T om1=4.523602532-33.75714512*T om2=1.285725882+0.000243618*tt g= 6.25658358+628.3019452*T I=double(0.12653637) MM=(360-360/25.38*(jd-2398220))*!pi/180. lam=4.881530777+628.3319504*T+.033452143*sin(g)+.000349065*sin(2*g)-.000082418*sin(om1) x=atan(-1*cos(lam)*tan(E)) y=atan(-1*cos(lam-om2)*tan(I)) P=(x+y) tanB=sin(lam-om2)*sin(I) B=atan(tanB/(sqrt(1-tanB^2))) cosLM=(-1)*cos(lam-om2)/cos(B) sinLM=(-1)*sin(lam-om2)*cos(I)/cos(B) if (cosLM eq 0) and (sinLM gt 0) then begin L=!pi/2. goto, hop endif if (cosLM eq 0) and (sinLM lt 0) then begin L=3*!pi/2. goto, hop endif tanLM=sinLM/cosLM L=MM+atan(tanLM) L=L/(2*!pi) L=(L-ceil(L))*(2*!pi) if sinLM gt 0 and cosLM lt 0 then L=L+(3*!pi) if sinLM lt 0 and cosLM lt 0 then L=L+(3*!pi) if sinLM gt 0 and cosLM gt 0 then L=L+(2*!pi) if sinLM lt 0 and cosLM gt 0 then L=L+(2*!pi) if L gt (2*!pi) then L=L-(2*!pi) hop: ro=.00465993/(1-0.01672*cos(g)) ro=(ro/(2*!pi)-fix(ro/(2*!pi)))*(2*!pi) print,'JD =',jd L=L*!radeg print,'L =',L B=B*!radeg print,'B =',B P=P*!radeg print,'P =',P ro=ro*!radeg print,'Ro =',ro END