@ -68,7 +68,7 @@ def parse_crest_toes(df_raw_features, df_profiles):
# Try get the value from the other profile if we return nan or empty dataframe
# Try get the value from the other profile if we return nan or empty dataframe
df_z = df_profile . loc [ idx [ site_id , param , x_val ] , : ]
df_z = df_profile . loc [ idx [ site_id , param , x_val ] , : ]
if df_z. empty :
if np. isnan ( df_z . z ) :
if param == " prestorm " :
if param == " prestorm " :
new_param = " poststorm "
new_param = " poststorm "
elif param == " poststorm " :
elif param == " poststorm " :
@ -77,16 +77,6 @@ def parse_crest_toes(df_raw_features, df_profiles):
else :
else :
z_val = df_z . z
z_val = df_z . z
# # Try get the value from the other profile if we return nan or empty dataframe
# if df_profile.query(query).empty:
# if param == "prestorm":
# query = query.replace('prestorm', 'poststorm')
# elif param == "poststorm":
# query = query.replace('poststorm', 'prestorm')
# z_val = df_profile.query(query).iloc[0].z
# else:
# z_val = df_profile.query(query).iloc[0].z
# Put results back into merged dataframe
# Put results back into merged dataframe
df_crest_toes . loc [ ( site_id , param ) , " dune_ {} _z " . format ( loc ) ] = z_val
df_crest_toes . loc [ ( site_id , param ) , " dune_ {} _z " . format ( loc ) ] = z_val