added white theme, some features to processing and saving
This commit is contained in:
@@ -9,6 +9,7 @@ from python_app.models.run_config_schema import (
|
||||
GprRxGeometryModel,
|
||||
GprTxGeometryModel,
|
||||
PreprocessAssetModel,
|
||||
PreprocessNotchModel,
|
||||
RunConfigModel,
|
||||
)
|
||||
from python_app.models.run_config_validation import load_ring_payload, load_switch_payload, validate_gpr_model
|
||||
@@ -137,6 +138,18 @@ def run_config_from_dict(payload: dict[str, Any]) -> RunConfigModel:
|
||||
_as_dict(s11_preprocess_payload.get("reference"), "preprocess.s11.reference"),
|
||||
model.preprocess.s11.reference,
|
||||
)
|
||||
notch_payload = _as_dict(preprocess_payload.get("notch"), "preprocess.notch")
|
||||
model.preprocess.notch = PreprocessNotchModel(
|
||||
enabled=bool(notch_payload.get("enabled", model.preprocess.notch.enabled)),
|
||||
taper_width_hz=float(notch_payload.get("taper_width_hz", model.preprocess.notch.taper_width_hz)),
|
||||
taper_type=str(notch_payload.get("taper_type", model.preprocess.notch.taper_type)),
|
||||
bands_hz=[],
|
||||
)
|
||||
bands_payload = notch_payload.get("bands_hz", [])
|
||||
if isinstance(bands_payload, list):
|
||||
for band in bands_payload:
|
||||
if isinstance(band, (list, tuple)) and len(band) == 2:
|
||||
model.preprocess.notch.bands_hz.append((float(band[0]), float(band[1])))
|
||||
|
||||
model.gpr.mode = str(gpr_payload.get("mode", model.gpr.mode))
|
||||
model.gpr.relative_permittivity = float(
|
||||
@@ -282,6 +295,12 @@ def run_config_to_dict(model: RunConfigModel) -> dict[str, Any]:
|
||||
"bundle_path": model.preprocess.s11.reference.bundle_path,
|
||||
},
|
||||
},
|
||||
"notch": {
|
||||
"enabled": model.preprocess.notch.enabled,
|
||||
"bands_hz": [[low_hz, high_hz] for low_hz, high_hz in model.preprocess.notch.bands_hz],
|
||||
"taper_width_hz": model.preprocess.notch.taper_width_hz,
|
||||
"taper_type": model.preprocess.notch.taper_type,
|
||||
},
|
||||
},
|
||||
"gpr": {
|
||||
"mode": model.gpr.mode,
|
||||
|
||||
Reference in New Issue
Block a user