Skip to content

Commit

Permalink
Removed the dependency of ray length on ejecta_truncation value, but …
Browse files Browse the repository at this point in the history
…ignored for craters larger than ~Imbrium. (this may cause memory issues, need to test!)
  • Loading branch information
Austin Blevins committed Nov 13, 2023
1 parent ada06b7 commit e5431c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ejecta/ejecta_ray_pattern.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ subroutine ejecta_ray_pattern(user,surf,crater,inc,xi,xf,yi,yf,rray,Nraymax,fpea

!TEMPORARY

if (user%dorays) then
if (user%dorays .and. crater%fcrat<1500000._DP) then
do i = 1,Nraymax
thetari(i) = 2 * pi * i / Nraymax
end do
call shuffle(thetari) ! randomize the ray pattern

call random_number(rn) ! randomize the ray orientation
rmax = user%ejecta_truncation
rmax = rray
rmin = crater%continuous / crater%frad
!rmax = rray / crater%frad
!rmin = l1 / crater%frad
Expand All @@ -108,7 +108,8 @@ subroutine ejecta_ray_pattern(user,surf,crater,inc,xi,xf,yi,yf,rray,Nraymax,fpea
xbar = xp - crater%xl
ybar = yp - crater%yl

areafrac = util_area_intersection(user%ejecta_truncation * crater%frad,xbar,ybar,user%pix)
!areafrac = util_area_intersection(user%ejecta_truncation * crater%frad,xbar,ybar,user%pix)
areafrac = util_area_intersection(rray * crater%frad,xbar,ybar,user%pix)
r = sqrt(xbar**2 + ybar**2) / crater%frad
theta = mod(atan2(ybar,xbar) + pi + rn * 2 * pi,2 * pi)
diffdistribution(i,j) = areafrac * ejecta_ray_pattern_func(theta,r,rmin,rmax,thetari,rray,Nraymax,fpeak,rayp,rayq,rayfmult,l1,.false.)
Expand Down

0 comments on commit e5431c4

Please sign in to comment.