Skip to content

Commit

Permalink
Merge pull request #305 from rschwant/develop
Browse files Browse the repository at this point in the history
Update aircraft pairing (no changes to results)
  • Loading branch information
rschwant authored Nov 12, 2024
2 parents 37e6234 + 63a8d2a commit 50772b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion melodies_monet/util/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,13 @@ def vert_interp(ds_model,df_obs,var_name_list):
var_out_list.append(out)

df_model = xr.merge(var_out_list).to_dataframe().reset_index()
df_model.fillna({'pressure_model':df_model.pressure_obs},inplace=True)
for time in df_model.time.unique():
if df_model[df_model.time == time].pressure_obs.unique() > df_model[df_model.time == time].pressure_model.max():
df_model.fillna({'pressure_model':df_model[df_model.time == time].pressure_obs},inplace=True)
elif df_model[df_model.time == time].pressure_obs.unique() < df_model[df_model.time == time].pressure_model.min():
df_model.fillna({'pressure_model':df_model[df_model.time == time].pressure_obs},inplace=True)
print('Warning: You are pairing obs data above the model top. This is not recommended.')
print(time)
df_model.drop(labels=['x','y','z','pressure_obs','time_obs'], axis=1, inplace=True)
df_model.rename(columns={'pressure_model':'pressure_obs'}, inplace=True)

Expand Down

0 comments on commit 50772b3

Please sign in to comment.