def apply_emtf(df_E,
df_B,
emtf_key,
index,
extrapolate0=True):
"""
Apply the EMTF associated with *emtf_key* to magnetometer data
found in *df_B* and store result to *df_E*. Use USArray .xml
repository information :class:`Index` to process the 3-D EMTFs.
"""
logger.info('applying transfer function {}'.format(emtf_key))
interval = NP.diff(df_B.index.values[:2])[0] / NP.timedelta64(1, 's')
Bx = df_B.B_X.values
By = df_B.B_Y.values
if emtf_key.startswith('USArray'):
xml_fname = index[emtf_key][1]
Ex, Ey = tf_3D(Bx, By, interval, xml_fname, extrapolate0=extrapolate0)
else:
Ex, Ey = tf_1D(Bx, By, interval, emtf_key)
df_E[emtf_key + '_X'] = Ex
df_E[emtf_key + '_Y'] = Ey
return df_E
评论列表
文章目录