Skip to content

Commit

Permalink
debug concat
Browse files Browse the repository at this point in the history
  • Loading branch information
xumi1993 committed Feb 28, 2024
1 parent b682077 commit eab9aaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion seispy/recalrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def match_eq(eq_lst, pathname, logger, ref_comp='Z', suffix='SAC', offset=0,
this_eq.get_time_offset(results.iloc[0]['date'])
this_df = pd.DataFrame([[this_eq, datestr]], columns=new_col, index=results.index.values)
eq_match_lst.append(this_df)
eq_match = pd.concat(eq_match_lst)
eq_match = pd.concat(eq_match_lst)
ind = eq_match.index.drop_duplicates(keep=False)
eq_match = eq_match.loc[ind]
return pd.concat([eq_lst, eq_match], axis=1, join='inner')
Expand Down
10 changes: 8 additions & 2 deletions seispy/rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ def fetch_waveform(eq_lst, para, model, logger):
this_eq.get_time_offset(row['date'])
this_df = pd.DataFrame([[daz.delta, daz.baz, this_eq, datestr]], columns=new_col, index=[i])
eqall.append(this_df)
eq_match = pd.concat(eqall)
if not eqall:
logger.RFlog.error('No waveforms fetched')
sys.exit(1)
eq_match = pd.concat(eqall)
ind = eq_match.index.drop_duplicates(keep=False)
eq_match = eq_match.loc[ind]
return pd.concat([eq_lst, eq_match], axis=1, join='inner')
Expand Down Expand Up @@ -220,7 +223,10 @@ def match_eq(eq_lst, pathname, stla, stlo, logger, ref_comp='Z', suffix='SAC', o
daz = distaz(stla, stlo, results.iloc[0]['evla'], results.iloc[0]['evlo'])
this_df = pd.DataFrame([[daz.delta, daz.baz, this_eq, datestr]], columns=new_col, index=results.index.values)
eq_match_lst.append(this_df)
eq_match = pd.concat(eq_match_lst)
if not eq_match_lst:
logger.RFlog.error('No earthquakes matched')
sys.exit(1)
eq_match = pd.concat(eq_match_lst)
ind = eq_match.index.drop_duplicates(keep=False)
eq_match = eq_match.loc[ind]
return pd.concat([eq_lst, eq_match], axis=1, join='inner')
Expand Down

0 comments on commit eab9aaf

Please sign in to comment.