Blame view

src/idl/dustem_plaw_vdist.pro 614 Bytes
a38807fc   Annie Hughes   first commit of f...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FUNCTION DUSTEM_PLAW_VDIST, x, par 
; generates a volume normalized power law x^par(0)
; returns distribution in nr of grains : dn/da
; x : grain size 
; par(0) : power law index
; par(1) : VOLUME normalization 
; par(2) : curvature parameter beta 
; par(3) : large size threshold At

 np = n_elements(x)
 y = x^par(0)
; curvature term
 if ((par(2) NE 0) AND (par(3) NE 0)) then begin 
     psgn = par(2)/ABS(par(2))
     y = y * ( 1.d0 + ABS(par(2))*x/par(3) )^psgn
 endif 
 vy = x^4 * y 
 dx = ALOG(x(1:np-1)) - ALOG(x(0:np-2)) 
 yi = TOTAL( (vy(1:np-1) + vy(0:np-2))*0.5*dx )
 y = par(1) * y / yi
RETURN, y
END