Skip to content

Commit

Permalink
Fixed bug caused by error being moved from attrs to coord (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosertoli authored Jul 5, 2024
1 parent 1a57377 commit b79b1f1
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit b79b1f1

Please sign in to comment.