;procedure to calculate the azimuth and zenith angle ;of the Moon from its right ascension and declination ;Modified from ~schee/idl/stephem.pro by DPS, 930921 ;Inputs: yr,mo,day,hr,min,sec,lat,lon - Time of exposure of ;image and latitude and longitude of camera. ;Outputs: ;az : azimuth of the Moon ;za : zenith angle of the Moon PRO MEPHEM,yr,mo,day,hr,min,sec,lat,lon,az,za ut = (sec/3600. + min/60. + hr)/24. IF yr LT 1900 THEN yr=yr+1900 ; ensure year is not abbreviated jdf=ymdh2jdf(yr,mo,day,ut*24.) ; get fractional Julian date moonpos,jdf,moonra,moondec ; calculate Moon coords, in radians jday = JULDAY(mo, day, yr) lsidt = LMST(jday, ut, lon) ; calculate local mean sidereal time lat = lat * !DTOR lsidt = lsidt*2*!PI hangle = lsidt - moonra sinalt = SIN(moondec)*SIN(lat) + COS(hangle)*COS(moondec)*COS(lat) za = ACOS(sinalt) sinaz = -COS(moondec)*SIN(hangle)/SIN(za) cosaz = (SIN(moondec) - sinalt*sin(lat))/(SIN(za)*COS(lat)) az = ATAN(sinaz, cosaz) vis = WHERE(sinalt GT 0.) az = az*!RADEG IF az LT 0 THEN az=az+360. za = za*!RADEG RETURN END