Skip to content

Commit

Permalink
bug: extract parquet: removed useless dist
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed Jul 2, 2024
1 parent 88e2a67 commit 9f398fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyposeidon/telemac.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ def extract_t_elev_2D(
xstr: str = 'longitude',
ystr: str = 'latitude'):
lons, lats = ds[xstr].values, ds[ystr].values
indx, dist_ = closest_n_points(np.array([x, y]).T, 1, np.array([lons,lats]).T)
indx, _ = closest_n_points(np.array([x, y]).T, 1, np.array([lons,lats]).T)
ds_ = ds.isel(node=indx[0])
elev_ = ds_[var].values
t_ = [pd.Timestamp(ti) for ti in ds_.time.values]
return pd.Series(elev_, index=t_), np.round(dist_, 2), float(ds_[xstr]), float(ds_[ystr])
return pd.Series(elev_, index=t_), float(ds_[xstr]), float(ds_[ystr])



Expand Down Expand Up @@ -1454,7 +1454,7 @@ def get_output_data(
logger.info("extracting parquet files from TELEMAC Selafin output \n")
for i_s, id_ in enumerate(station_df[station_id_str]):
s = station_df[station_df[station_id_str] == id_]
mod, d_, mlon, mlat = extract_t_elev_2D(ds, s.longitude.values[0], s.latitude.values[0], var, xstr, ystr)
mod, mlon, mlat = extract_t_elev_2D(ds, s.longitude.values[0], s.latitude.values[0], var, xstr, ystr)
mod.to_frame().to_parquet(os.path.join(work_folder, f"{id_}.parquet"))


Expand Down

0 comments on commit 9f398fa

Please sign in to comment.