From 1713a732b85ab8ea5715f9613c5fef413a59f1ea Mon Sep 17 00:00:00 2001 From: Marco Sertoli Date: Fri, 5 Jul 2024 10:50:11 +0100 Subject: [PATCH] Fixed bug caused by error being moved from attrs to coord --- indica/converters/line_of_sight.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indica/converters/line_of_sight.py b/indica/converters/line_of_sight.py index 3aaf6808..b10ea5df 100644 --- a/indica/converters/line_of_sight.py +++ b/indica/converters/line_of_sight.py @@ -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: @@ -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