Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion aurora/pipelines/time_series_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ def apply_prewhitening(decimation_obj, run_xrts_input):
prewhitened time series

"""
if not decimation_obj.prewhitening_type:
return run_xrts_input

if decimation_obj.prewhitening_type == "first difference":
run_xrts = run_xrts_input.differentiate("time")

else:
print(f"{decimation_obj.prewhitening_type} prehitening not yet implemented")
print(f"{decimation_obj.prewhitening_type} pre-whitening not implemented")
raise NotImplementedError
return run_xrts

Expand All @@ -75,6 +79,9 @@ def apply_recoloring(decimation_obj, stft_obj):
stft_obj : xarray.core.dataset.Dataset
Recolored time series of Fourier coefficients
"""
if not decimation_obj.prewhitening_type:
return stft_obj

if decimation_obj.prewhitening_type == "first difference":
# replace below with decimation_obj.get_fft_harmonics() ?
freqs = get_fft_harmonics(
Expand Down
17 changes: 16 additions & 1 deletion aurora/time_series/xarray_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,22 @@ def handle_nan(X, Y, RR, drop_dim=""):
RR = RR.rename(data_var_add_label_mapper)

merged_xr = X.merge(Y, join="exact")
merged_xr = merged_xr.merge(RR, join="exact")
# Workaround for issue #228
# merged_xr = merged_xr.merge(RR, join="exact")
try:
merged_xr = merged_xr.merge(RR, join="exact")
except ValueError:
print("Coordinate alignment mismatch -- see aurora issue #228 ")
matches = X.time.values == RR.time.values
print(f"{matches.sum()}/{len(matches)} timestamps match exactly")
deltas = X.time.values - RR.time.values
print(f"Maximum offset is {deltas.__abs__().max()}ns")
# print(f"X.time.[0]: {X.time[0].values}")
# print(f"RR.time.[0]: {RR.time[0].values}")
merged_xr = merged_xr.merge(RR, join="left")
for ch in list(RR.keys()):
merged_xr[ch].values = RR[ch].values

merged_xr = merged_xr.dropna(dim=drop_dim)
merged_xr = merged_xr.to_array(dim="channel")
X = merged_xr.sel(channel=input_channels)
Expand Down
9 changes: 8 additions & 1 deletion aurora/transfer_function/kernel_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ def __init__(self, **kwargs):
self.df = kwargs.get("df")
self.local_station_id = kwargs.get("local_station_id")
self.remote_station_id = kwargs.get("remote_station_id")
self._mini_summary_columns = ["survey", "station_id", "run_id", "start", "end"]
self._mini_summary_columns = [
"survey",
"station_id",
"run_id",
"start",
"end",
"duration",
]

def clone(self):
return copy.deepcopy(self)
Expand Down
8 changes: 4 additions & 4 deletions aurora/transfer_function/regression/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class RegressionEstimator(object):

Many of the robust transfer estimation methods we will use repeat the
model of solving Y = X*b +epsilon for b. X is variously called the "input",
"predictor", "explanatory", "confounding", "independent" variable(s) or the
"design matrix", "model matrix" or "regressor matrix".
"predictor", "explanatory", "confounding", "independent" "exogenous", variable(s)
or the "design matrix", "model matrix" or "regressor matrix".
Y are variously called the the "output", "predicted", "outcome",
"response", or "dependent" variable. I will try to use input and
output.
"response", "endogenous", "regressand", or "dependent" variable. I will try to
use input and output.

When we "regress Y on X", we use the values of variable X to predict
those of Y.
Expand Down
5 changes: 3 additions & 2 deletions tutorials/processing_configuration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"In this tutorial, we will use the synthetic dataset example to show some of the features of the config object.\n",
"\n",
"Hopefully, it will be fairly easy to add other parameters to the config, such as:\n",
"- coherncey sorting \n",
"- coherencey sorting \n",
"- polarization sorting\n",
"- ARMA prewhitening \n",
"- Other tools from the community\n",
Expand Down Expand Up @@ -1148,6 +1148,7 @@
"- Channel Nomenclature\n",
" - for example ex,ey maybe called e1, e2 in the mth5\n",
" - This is handled by passing a channel_nomenclature keyword argument.\n",
" - Examples of systems that might need this are LEMI and Phoenix\n",
"- Windowing Parameters\n",
" - Window shape (family)\n",
" - Window length\n",
Expand Down Expand Up @@ -1260,7 +1261,7 @@
"These legacy files have the following significance;\n",
"The first line, 25 indicates the number of bands, and there are 25 lines following, one line per frequency band.\n",
"\n",
"Each line is three numbers:\n",
"Each line comprises three numbers:\n",
"\n",
"`decimation_level, first_FC_index, last_FC_index`\n",
"\n",
Expand Down