Skip to content

Commit 438ba49

Browse files
committed
fixing bugs with feature weighting
1 parent ffb37fc commit 438ba49

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

aurora/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"sink": sys.stdout,
1414
"level": "INFO",
1515
"colorize": True,
16-
"format": "<level>{time} | {level: <3} | {name} | {function} | {message}</level>",
16+
"format": "<level>{time} | {level: <3} | {name} | {function} | line: {line} | {message}</level>",
1717
},
1818
],
1919
"extra": {"user": "someone"},

aurora/pipelines/feature_weights.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ def extract_features(
4040
except Exception as e:
4141
msg = f"Features could not be accessed from MTH5 -- {e}\n"
4242
msg += "Calculating features on the fly (development only)"
43-
logger.warning(msg)
43+
logger.info(msg)
4444

4545
for (
4646
chws
4747
) in dec_level_config.channel_weight_specs: # This refers to solving a TF equation
4848
# Loop over features and compute them
4949
msg = f"channel weight spec:\n {chws}"
50-
logger.info(msg)
50+
logger.debug(msg)
5151
for fws in chws.feature_weight_specs:
5252
msg = f"feature weight spec: {fws}"
53-
logger.info(msg)
53+
logger.debug(msg)
5454
feature = fws.feature
5555
msg = f"feature: {feature}"
56-
logger.info(msg)
56+
logger.debug(msg)
5757
msg = f"feature type: {type(feature).__name__}, has validate_station_ids: {hasattr(feature, 'validate_station_ids')}"
58-
logger.info(msg)
58+
logger.debug(msg)
5959
feature_chunks = []
6060
if feature.name == "coherence":
6161
msg = f"{feature.name} is not supported as a data weighting feature"
@@ -110,7 +110,7 @@ def extract_features(
110110
decimation_obj=dec_level_config, run_xrds=ch2_data
111111
)
112112
msg = f"Data for computing {feature.name} on {start} -- {end} ready"
113-
logger.info(msg)
113+
logger.debug(msg)
114114
# Compute the feature.
115115
freqs, coherence_spectrogram = feature.compute(ch1_data, ch2_data)
116116
# TODO: consider making get_time_axis() a method of the feature class
@@ -194,7 +194,7 @@ def calculate_weights(
194194
# loop the channel weight specs
195195
for chws in dec_level_config.channel_weight_specs:
196196
msg = f"{chws}"
197-
logger.info(msg)
197+
logger.debug(msg)
198198
# TODO: Consider calculating all the weight kernels in advance, case switching on the combination style.
199199
if chws.combination_style == "multiplication":
200200
print(f"chws.combination_style {chws.combination_style}")
@@ -203,10 +203,10 @@ def calculate_weights(
203203
# loop the feature weight specs
204204
for fws in chws.feature_weight_specs:
205205
msg = f"feature weight spec: {fws}"
206-
logger.info(msg)
206+
logger.debug(msg)
207207
feature = fws.feature
208208
msg = f"feature: {feature}"
209-
logger.info(msg)
209+
logger.debug(msg)
210210
# TODO: confirm that the feature object has its data
211211
print("feature.data", feature.data, len(feature.data))
212212

0 commit comments

Comments
 (0)