File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
massbalancemachine/data_processing Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -195,13 +195,19 @@ def _retrieve_topo_features(
195195 """Find the nearest recorded point with topographical features on the glacier for each stake."""
196196
197197 for gdir , gdir_grid in zip (glacier_directories , gdirs_gridded ):
198- lat = grouped_stakes .get_group (gdir .rgi_id )[["POINT_LAT" ]].values .flatten ()
199- lon = grouped_stakes .get_group (gdir .rgi_id )[["POINT_LON" ]].values .flatten ()
198+ lat = xr .DataArray (
199+ grouped_stakes .get_group (gdir .rgi_id )[["POINT_LAT" ]].values .flatten (),
200+ dims = "points" ,
201+ )
202+ lon = xr .DataArray (
203+ grouped_stakes .get_group (gdir .rgi_id )[["POINT_LON" ]].values .flatten (),
204+ dims = "points" ,
205+ )
200206
201207 topo_data = (
202208 gdir_grid .sel (x = lon , y = lat , method = "nearest" )[voi ]
203209 .to_dataframe ()
204210 .reset_index (drop = True )
205211 )
206212
207- df .loc [df ["RGIId" ] == gdir .rgi_id , voi ] = topo_data [voi ]
213+ df .loc [df ["RGIId" ] == gdir .rgi_id , voi ] = topo_data [voi ]. values
You can’t perform that action at this time.
0 commit comments