; ; PURPOSE: Grid spacing ; WRITTEN: May 1993 Xuepu Zhao ; Modified: May 2006 Xuepu Zhao ; PRO zgrid06,iph,jth,phd,thd,lad,cth,sth,cmp,csc,scs,RUP=rup if N_params() LT 1 then begin print,'PRO zgrid06,iph,jth,phd,thd,lad,cth,sth,cmp,scs,/rup' return endif ; calculate cth,sth,thd,phd thd = fltarr(jth) lad = thd sth = thd cth = thd phd = fltarr(iph) dcth=2.0/jth for j=0,jth-1 do begin cth(j)=(j+0.5)*dcth-1.0 ; from south to north thr=acos(cth(j)) sth(j) = SIN(thr) thd(j) = thr/!dtor lad(j) = 90-thd(j) endfor dph=360./iph for i=0,iph-1 do phd(i) = i*dph+dph ; from left to right ; calculate csc,scs if n_elements(cmp) eq 1 then begin csc=fltarr(jth) cpc=fltarr(iph) scs=cpc for j=0,jth-1 do csc(j)=1/sth(j) for i=0,iph-1 do begin dphr=(phd(i)-cmp)*!dtor cpc(i)=cos(dphr) scs(i)=1/cpc(i) endfor endif if keyword_set(rup) then begin lphd=phd & lthd=thd & llad=lad & lcth=cth & lsth=sth & lscs=scs for j=0, jth-1 do begin thd(j)=lthd(jth-j) lad(j)=llad(jth-1) cth(j)=lcth(jth-j) sth(j)=lsth(jth-1) endfor for i=0,iph-1 do begin phd(i)=lphd(iph-i) scs(i)=lscs(iph-i) endfor endif END