-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor windows into spectrum_regions.py from config
- Loading branch information
David Wallace
committed
Mar 6, 2024
1 parent
e03e136
commit df2ecb2
Showing
6 changed files
with
41 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
[first_order] | ||
|
||
[first_order.models] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
[second_order] | ||
|
||
[second_order.models] | ||
|
10 changes: 10 additions & 0 deletions
10
src/raman_fitting/config/default_models/spectrum_windows.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[spectrum] | ||
|
||
[spectrum.windows] | ||
full = {"min" = 200, "max" = 3600} | ||
full_first_and_second = {"min" = 800, "max" = 3500} | ||
low = {"min" = 150, "max" = 850, "extra_margin" = 10} | ||
first_order = {"min" = 900, "max" = 2000} | ||
mid = {"min" = 1850, "max" = 2150, "extra_margin" = 10} | ||
normalization = {"min" = 1500, "max" = 1675, "extra_margin" = 10} | ||
second_order = {"min" = 2150, "max" = 3380} |
20 changes: 20 additions & 0 deletions
20
src/raman_fitting/models/deconvolution/spectrum_regions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from enum import StrEnum | ||
from typing import Dict | ||
|
||
from pydantic import BaseModel | ||
from raman_fitting.config.default_models import load_config_from_toml_files | ||
|
||
|
||
def get_default_regions_from_toml_files() -> Dict[str, Dict[str, float]]: | ||
default_windows = load_config_from_toml_files().get("spectrum", {}).get("windows", {}) | ||
return default_windows | ||
|
||
|
||
WindowNames = StrEnum('WindowNames', " ".join(get_default_regions_from_toml_files()), module=__name__) | ||
|
||
|
||
class SpectrumWindowLimits(BaseModel): | ||
name: WindowNames | ||
min: int | ||
max: int | ||
extra_margin: int = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters