Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change default spectral_bins_per_emission_channel and max_psf_radius_aus #84

Merged
merged 1 commit into from
Nov 9, 2024
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
2 changes: 1 addition & 1 deletion src/microsim/schema/modality/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._simple import Confocal, Identity, Widefield
from ._simple_psf import Confocal, Identity, Widefield

Modality = Confocal | Widefield | Identity

Expand Down
40 changes: 3 additions & 37 deletions src/microsim/schema/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import random
from typing import Any, ClassVar, Literal
from typing import Any, ClassVar

from pydantic import Field, model_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
Expand Down Expand Up @@ -35,7 +35,7 @@ class Settings(SimBaseModel, BaseSettings):
default_factory=lambda: random.randint(0, 2**32 - 1)
)
max_psf_radius_aus: float | None = Field(
8,
6,
description=(
"When simulating, restrict generated lateral PSF size to no more than this "
"many Airy units. Decreasing this can *dramatically* speed up simulations, "
Expand All @@ -44,18 +44,8 @@ class Settings(SimBaseModel, BaseSettings):
),
)
cache: CacheSettings = Field(default_factory=CacheSettings)
binning_strategy: Literal["equal_area", "equal_space"] = Field(
"equal_space",
description=(
"The strategy to use for binning data. `'equal_area'` will divide the "
"spectrum into intervals with intensity integral, while `'equal_space'` "
"will divide the range of values into equally spaced bins. Note that "
"`'equal_area'` is more accurate, but is not supported in the case of "
"multiple fluorophores."
),
)
spectral_bins_per_emission_channel: int = Field(
4,
1,
description="Number of wavelengths to use (per channel) when simulating the "
"optical image. By default, a single centroid wavelength is used to approximate"
"the emission wavelength. Increasing this will make the simulation more "
Expand All @@ -71,30 +61,6 @@ class Settings(SimBaseModel, BaseSettings):
"intensity above this threshold). Then, the spectrum is discretized into "
"spectral_bins_per_emission_channel bins.",
)
num_wavelength_bins: int = Field(
32,
description=(
"Number of bins to use when discretizing the wavelength spectrum."
"It regards the wavelength range for illumination and excitation spectra."
"Increasing this will increase accuracy but also increase memory usage."
),
)
min_wavelength: int = Field(
300,
description=(
"Minimum wavelength to consider in the simulation."
"It is used to define the range of the wavelength spectrum when "
"fluorophores are not defined."
),
)
max_wavelength: int = Field(
800,
description=(
"Maximum wavelength to consider in the simulation."
"It is used to define the range of the wavelength spectrum when "
"fluorophores are not defined."
),
)

model_config: ClassVar[SettingsConfigDict] = SettingsConfigDict(
validate_assignment=True,
Expand Down
Loading