Skip to content

Commit

Permalink
Merge pull request svalinn#162 from svalinn/poloidal_degree_change
Browse files Browse the repository at this point in the history
Poloidal degree change
  • Loading branch information
connoramoreno authored Oct 2, 2024
2 parents 30af9b9 + bc8e98e commit d36017b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions parastell/nwl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def flux_coords(plas_eq, wall_s, coords, num_threads):
for theta_coord_chunk in theta_coord_chunks
for theta_coord in theta_coord_chunk
]
# Ensures theta_coords are all positive (add 360 degrees where needed)
theta_coords = (theta_coords + 2 * np.pi) % 2 * np.pi

return phi_coords.tolist(), theta_coords


Expand Down Expand Up @@ -339,8 +342,9 @@ def nwl_plot(
# Define minimum and maximum bin edges for each dimension
phi_min = 0 - tor_ext / num_phi / 2
phi_max = tor_ext + tor_ext / num_phi / 2
theta_min = -pol_ext / 2 - pol_ext / num_theta / 2
theta_max = pol_ext / 2 + pol_ext / num_theta / 2

theta_min = 0 - pol_ext / num_theta / 2
theta_max = pol_ext + pol_ext / num_theta / 2

# Bin particle crossings
count_mat, phi_bins, theta_bins = np.histogram2d(
Expand All @@ -353,12 +357,12 @@ def nwl_plot(
# adjust endpoints to eliminate overlap
phi_bins[0] = 0
phi_bins[-1] = tor_ext
theta_bins[0] = -pol_ext / 2
theta_bins[-1] = pol_ext / 2
theta_bins[0] = 0
theta_bins[-1] = pol_ext

# Compute centroids of bin dimensions
phi_pts = np.linspace(0, tor_ext, num=num_phi)
theta_pts = np.linspace(-pol_ext / 2, pol_ext / 2, num=num_theta)
theta_pts = np.linspace(0, pol_ext, num=num_theta)

# Define fusion neutron energy (eV)
n_energy = 14.1e6
Expand Down

0 comments on commit d36017b

Please sign in to comment.