pro prob_dist,ld,b,lprobd,hh=hh
; This routine accepts the log(distance) (distance in pc) of a star, and
; its galactic latitude b (in degrees).
; It returns ln(prob), where prob is the unnormalized probability of 
; finding a star per unit area in the sky and per unit log(dist).
; The routine assumes a galactic disk scale height of 300 pc, unless
; keyword hh is set, in which case hh overrides the default.

;constants
hh0=300.              ; disk scale height in pc
radian=180./!pi

if(keyword_set(hh)) then h=hh else h=hh0

z=sin(b/radian)*10.^ld        ; height above the plane
lprobd=3.*ld-z/h

end