Skip to content

Commit

Permalink
Merge pull request #1001 from ToFuProject/Issue1000_VosBroadBand
Browse files Browse the repository at this point in the history
Issue1000 vos broad band
  • Loading branch information
Didou09 authored Dec 17, 2024
2 parents ef3c432 + 9eac489 commit 226e913
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tofu/data/_class8_los_angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,13 @@ def _vos_from_los(

phi = np.arctan2(ptsy, ptsx)
phimin, phimax = np.nanmin(phi), np.nanmax(phi)

# across pi?
if phimax - phimin > np.pi:
phimin, phimax = phimax, phimin + 2.*np.pi
phimin = np.min(phi[phi > 0])
phimax = np.max(phi[phi < 0])
phimax = phimax + 2*np.pi

dphi[(0,) + ind] = phimin
dphi[(1,) + ind] = phimax

Expand Down
2 changes: 1 addition & 1 deletion tofu/data/_class8_vos_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def _get_dphi_from_R_phor(
dphi = np.full((2, R.size), np.nan)
for ir, rr in enumerate(R):

nphi = np.ceil(rr*(phimax - phimin) / (0.05*res)).astype(int)
nphi = np.ceil(rr*np.abs(phimax - phimin) / (0.05*res)).astype(int) + 1
phi = np.linspace(phimin, phimax, nphi)

ind = path.contains_points(
Expand Down

0 comments on commit 226e913

Please sign in to comment.