Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug caused by error being moved from attrs to coord #335

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions indica/converters/line_of_sight.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,16 +605,16 @@ def map_profile_to_los(
self.check_equilibrium()
profile = self.check_rho_and_profile(profile_to_map, t, calc_rho)

coords = profile_to_map.coords
dims = profile_to_map.dims
along_los: DataArray
if "R" in coords and "z" in coords:
if "R" in dims and "z" in dims:
R_ = self.R
z_ = self.z

along_los = profile_to_map.interp(R=R_, z=z_).T
elif "rho_poloidal" in coords or "rho_toroidal" in coords:
elif "rho_poloidal" in dims or "rho_toroidal" in dims:
rho_ = self.rho
if "theta" in coords:
if "theta" in dims:
theta_ = self.theta
along_los = profile.interp(rho_poloidal=rho_, theta=theta_)
else:
Expand All @@ -629,8 +629,8 @@ def map_profile_to_los(
else:
raise NotImplementedError("Coordinates not recognized...")

drop_coords = [coord for coord in coords if coord != "t"]
along_los = along_los.drop_vars(drop_coords)
drop_dims = [dim for dim in dims if dim != "t"]
along_los = along_los.drop_vars(drop_dims)
self.along_los = along_los
self.profile_to_map = profile_to_map

Expand Down
Loading