AMS-BP 0.0.11__py3-none-any.whl → 0.0.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AMS_BP/__init__.py +1 -1
- AMS_BP/configio/configmodels.py +14 -11
- AMS_BP/configio/convertconfig.py +32 -23
- AMS_BP/metadata/metadata.py +2 -2
- AMS_BP/optics/psf/psf_engine.py +79 -35
- AMS_BP/run_cell_simulation.py +3 -3
- AMS_BP/sim_config.toml +41 -11
- AMS_BP/sim_microscopy.py +1 -1
- {ams_bp-0.0.11.dist-info → ams_bp-0.0.22.dist-info}/METADATA +19 -42
- {ams_bp-0.0.11.dist-info → ams_bp-0.0.22.dist-info}/RECORD +13 -13
- {ams_bp-0.0.11.dist-info → ams_bp-0.0.22.dist-info}/WHEEL +0 -0
- {ams_bp-0.0.11.dist-info → ams_bp-0.0.22.dist-info}/entry_points.txt +0 -0
- {ams_bp-0.0.11.dist-info → ams_bp-0.0.22.dist-info}/licenses/LICENSE +0 -0
AMS_BP/__init__.py
CHANGED
AMS_BP/configio/configmodels.py
CHANGED
@@ -60,19 +60,22 @@ class GlobalParameters(BaseModel):
|
|
60
60
|
|
61
61
|
|
62
62
|
class CondensateParameters(BaseModel):
|
63
|
-
initial_centers: List[List[float]] = Field(
|
64
|
-
|
65
|
-
diffusion_coefficient: List[float] = Field(
|
66
|
-
description="Diffusion coefficients in um^2/s"
|
63
|
+
initial_centers: List[List[List[float]]] = Field(
|
64
|
+
description="Initial centers in um"
|
67
65
|
)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
@field_validator(
|
72
|
-
"initial_centers", "initial_scale", "diffusion_coefficient", "hurst_exponent"
|
66
|
+
initial_scale: List[List[float]] = Field(description="Initial scale in um")
|
67
|
+
diffusion_coefficient: List[List[float]] = Field(
|
68
|
+
description="Diffusion coefficients in um^2/s"
|
73
69
|
)
|
74
|
-
|
75
|
-
|
70
|
+
hurst_exponent: List[List[float]]
|
71
|
+
density_dif: List[int]
|
72
|
+
|
73
|
+
# @field_validator(
|
74
|
+
# "initial_centers", "initial_scale", "diffusion_coefficient", "hurst_exponent"
|
75
|
+
# )
|
76
|
+
# def convert_to_array(cls, v):
|
77
|
+
# return np.array(v)
|
78
|
+
#
|
76
79
|
|
77
80
|
|
78
81
|
class OutputParameters(BaseModel):
|
AMS_BP/configio/convertconfig.py
CHANGED
@@ -324,11 +324,12 @@ class ConfigLoader:
|
|
324
324
|
):
|
325
325
|
# Create PSFParameters instance
|
326
326
|
parameters = PSFParameters(
|
327
|
-
|
327
|
+
emission_wavelength=wavelength,
|
328
328
|
numerical_aperture=float(params_config["numerical_aperture"]),
|
329
329
|
pixel_size=pixel_size,
|
330
330
|
z_step=float(params_config["z_step"]) if z_step is None else z_step,
|
331
331
|
refractive_index=float(params_config.get("refractive_index", 1.0)),
|
332
|
+
pinhole_diameter=params_config.get("pinhole_diameter", None),
|
332
333
|
)
|
333
334
|
|
334
335
|
# Create PSF engine
|
@@ -680,7 +681,7 @@ class ConfigLoader:
|
|
680
681
|
)
|
681
682
|
|
682
683
|
# make sampling function
|
683
|
-
|
684
|
+
sampling_functions = make_samplingfunction(
|
684
685
|
condensate_params=base_config.CondensateParameters, cell=cell
|
685
686
|
)
|
686
687
|
|
@@ -689,7 +690,7 @@ class ConfigLoader:
|
|
689
690
|
molecule_params=base_config.MoleculeParameters,
|
690
691
|
cell=cell,
|
691
692
|
condensate_params=base_config.CondensateParameters,
|
692
|
-
|
693
|
+
sampling_functions=sampling_functions,
|
693
694
|
)
|
694
695
|
|
695
696
|
# create the track generator
|
@@ -776,34 +777,42 @@ def make_sample(global_params, cell_params) -> SamplePlane:
|
|
776
777
|
return sample_plane
|
777
778
|
|
778
779
|
|
779
|
-
def make_condensatedict(condensate_params, cell) -> dict:
|
780
|
-
condensates_dict =
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
780
|
+
def make_condensatedict(condensate_params, cell) -> List[dict]:
|
781
|
+
condensates_dict = []
|
782
|
+
for i in range(len(condensate_params.initial_centers)):
|
783
|
+
condensates_dict.append(
|
784
|
+
create_condensate_dict(
|
785
|
+
initial_centers=condensate_params.initial_centers[i],
|
786
|
+
initial_scale=condensate_params.initial_scale[i],
|
787
|
+
diffusion_coefficient=condensate_params.diffusion_coefficient[i],
|
788
|
+
hurst_exponent=condensate_params.hurst_exponent[i],
|
789
|
+
cell=cell,
|
790
|
+
)
|
791
|
+
)
|
787
792
|
return condensates_dict
|
788
793
|
|
789
794
|
|
790
|
-
def make_samplingfunction(condensate_params, cell) -> Callable:
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
795
|
+
def make_samplingfunction(condensate_params, cell) -> List[Callable]:
|
796
|
+
sampling_functions = []
|
797
|
+
for i in range(len(condensate_params.initial_centers)):
|
798
|
+
sampling_functions.append(
|
799
|
+
tp(
|
800
|
+
num_subspace=len(condensate_params.initial_centers[i]),
|
801
|
+
subspace_centers=condensate_params.initial_centers[i],
|
802
|
+
subspace_radius=condensate_params.initial_scale[i],
|
803
|
+
density_dif=condensate_params.density_dif[i],
|
804
|
+
cell=cell,
|
805
|
+
)
|
806
|
+
)
|
807
|
+
return sampling_functions
|
799
808
|
|
800
809
|
|
801
|
-
def gen_initial_positions(molecule_params, cell, condensate_params,
|
810
|
+
def gen_initial_positions(molecule_params, cell, condensate_params, sampling_functions):
|
802
811
|
initials = []
|
803
812
|
for i in range(len(molecule_params.num_molecules)):
|
804
813
|
num_molecules = molecule_params.num_molecules[i]
|
805
814
|
initial_positions = gen_points(
|
806
|
-
pdf=
|
815
|
+
pdf=sampling_functions[i],
|
807
816
|
total_points=num_molecules,
|
808
817
|
min_x=cell.origin[0],
|
809
818
|
max_x=cell.origin[0] + cell.dimensions[0],
|
@@ -811,7 +820,7 @@ def gen_initial_positions(molecule_params, cell, condensate_params, sampling_fun
|
|
811
820
|
max_y=cell.origin[1] + cell.dimensions[1],
|
812
821
|
min_z=-cell.dimensions[2] / 2,
|
813
822
|
max_z=cell.dimensions[2] / 2,
|
814
|
-
density_dif=condensate_params.density_dif,
|
823
|
+
density_dif=condensate_params.density_dif[i],
|
815
824
|
)
|
816
825
|
initials.append(initial_positions)
|
817
826
|
return initials
|
AMS_BP/metadata/metadata.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Iterator, List, Literal, Union
|
1
|
+
from typing import Dict, Iterator, List, Literal, Union
|
2
2
|
|
3
3
|
from pydantic import BaseModel
|
4
4
|
|
@@ -77,7 +77,7 @@ class MetaData(BaseModel):
|
|
77
77
|
PhysicalSizeXUnit: Literal["nm", "m"]
|
78
78
|
PhysicalSizeY: float
|
79
79
|
PhysicalSizeYUnit: Literal["nm", "m"]
|
80
|
-
|
80
|
+
Channel: Dict[Literal["Name"], List[str]]
|
81
81
|
|
82
82
|
def __post_init__(self):
|
83
83
|
if isinstance(self.notes, (list, str)):
|
AMS_BP/optics/psf/psf_engine.py
CHANGED
@@ -5,52 +5,61 @@ from typing import Literal, Optional, Tuple
|
|
5
5
|
import numpy as np
|
6
6
|
from numpy.typing import NDArray
|
7
7
|
|
8
|
+
AIRYFACTOR = 1.0
|
9
|
+
|
8
10
|
|
9
11
|
@dataclass(frozen=True)
|
10
12
|
class PSFParameters:
|
11
|
-
"""Parameters for PSF (Point Spread Function)
|
13
|
+
"""Parameters for emission PSF (Point Spread Function) at the detector.
|
14
|
+
|
15
|
+
|
16
|
+
This class defines parameters that determine how light from a point source
|
17
|
+
(e.g., a fluorescent molecule) diffracts through the collection optics
|
18
|
+
to form a pattern at the detector.
|
12
19
|
|
13
20
|
Attributes:
|
14
|
-
|
15
|
-
numerical_aperture: Numerical aperture of the
|
16
|
-
pixel_size: Size of pixels in micrometers
|
21
|
+
emission_wavelength: Emission wavelength in nanometers
|
22
|
+
numerical_aperture: Numerical aperture of the collection objective
|
23
|
+
pixel_size: Size of pixels in micrometers at the detector
|
17
24
|
z_step: Axial step size in micrometers
|
18
25
|
refractive_index: Refractive index of the medium (default: 1.0 for air)
|
26
|
+
pinhole_diameter: Diameter of the pinhole in micrometers (default: None for widefield)
|
27
|
+
The pinhole spatially filters the emitted light before it reaches
|
28
|
+
the detector.
|
19
29
|
"""
|
20
30
|
|
21
|
-
|
31
|
+
emission_wavelength: float
|
22
32
|
numerical_aperture: float
|
23
33
|
pixel_size: float
|
24
34
|
z_step: float
|
25
35
|
refractive_index: float = 1.0
|
26
|
-
|
27
|
-
# def __post_init__(self) -> None:
|
28
|
-
# """Validate parameters after initialization."""
|
29
|
-
# if any(
|
30
|
-
# param <= 0
|
31
|
-
# for param in (
|
32
|
-
# self.wavelength,
|
33
|
-
# self.numerical_aperture,
|
34
|
-
# self.pixel_size,
|
35
|
-
# self.z_step,
|
36
|
-
# self.refractive_index,
|
37
|
-
# )
|
38
|
-
# ):
|
39
|
-
# raise ValueError("All parameters must be positive numbers")
|
40
|
-
# if self.numerical_aperture >= self.refractive_index:
|
41
|
-
# raise ValueError("Numerical aperture must be less than refractive index")
|
36
|
+
pinhole_diameter: Optional[float] = None # um
|
42
37
|
|
43
38
|
@cached_property
|
44
39
|
def wavelength_um(self) -> float:
|
45
|
-
"""
|
46
|
-
return self.
|
40
|
+
"""Emission wavelength in micrometers."""
|
41
|
+
return self.emission_wavelength / 1000.0
|
42
|
+
|
43
|
+
@cached_property
|
44
|
+
def pinhole_radius(self) -> Optional[float]:
|
45
|
+
"""Pinhole radius in micrometers."""
|
46
|
+
return (
|
47
|
+
self.pinhole_diameter / 2.0 if self.pinhole_diameter is not None else None
|
48
|
+
)
|
47
49
|
|
48
50
|
|
49
51
|
class PSFEngine:
|
50
|
-
"""Engine for
|
52
|
+
"""Engine for calculating emission light PSF at the detector.
|
53
|
+
|
54
|
+
This class calculates how light from a point source (like a fluorescent molecule)
|
55
|
+
spreads due to diffraction through the collection optics to form a pattern at
|
56
|
+
the detector. For confocal systems, it can include the effect of a pinhole
|
57
|
+
that spatially filters the light before detection.
|
51
58
|
|
52
|
-
This
|
53
|
-
|
59
|
+
Note: This PSF describes only the diffraction of emitted light through the
|
60
|
+
collection optics. While a confocal microscope uses focused illumination to
|
61
|
+
excite molecules, that illumination pattern does not affect how the emitted
|
62
|
+
light diffracts to form the PSF we calculate here.
|
54
63
|
"""
|
55
64
|
|
56
65
|
def __init__(self, params: PSFParameters):
|
@@ -79,34 +88,69 @@ class PSFEngine:
|
|
79
88
|
self._norm_sigma_xy = self._sigma_xy / 2.355
|
80
89
|
self._norm_sigma_z = self._sigma_z / 2.355
|
81
90
|
|
91
|
+
# Generate pinhole mask if specified
|
92
|
+
if self.params.pinhole_radius is not None:
|
93
|
+
if self.params.pinhole_radius < AIRYFACTOR * self._sigma_xy:
|
94
|
+
raise ValueError(
|
95
|
+
f"Pinhole size ({self.params.pinhole_radius} um) is smaller than {AIRYFACTOR} times the Airy lobe. This will diffract the emission light in the pinhole; an ideal pinhole size for this setup is {self._sigma_xy} um."
|
96
|
+
)
|
97
|
+
self._pinhole_mask = self._generate_pinhole_mask()
|
98
|
+
else:
|
99
|
+
self._pinhole_mask = None
|
100
|
+
|
101
|
+
def _generate_pinhole_mask(self) -> NDArray[np.float64]:
|
102
|
+
"""Generate a binary mask representing the pinhole's spatial filtering.
|
103
|
+
|
104
|
+
The pinhole blocks emission light based on position in the image plane,
|
105
|
+
affecting what portion of the diffracted light reaches the detector.
|
106
|
+
"""
|
107
|
+
x, y = self._grid_xy
|
108
|
+
r = np.sqrt(x**2 + y**2)
|
109
|
+
return (r <= self.params.pinhole_radius).astype(np.float64)
|
110
|
+
|
82
111
|
@lru_cache(maxsize=128)
|
83
112
|
def psf_z(self, z_val: float) -> NDArray[np.float64]:
|
84
|
-
"""
|
113
|
+
"""Calculate the PSF at the detector for a point source at z_val.
|
114
|
+
|
115
|
+
This represents how light from a point source at position z_val
|
116
|
+
diffracts through the collection optics to form a pattern at the
|
117
|
+
detector. If a pinhole is present, it spatially filters this pattern.
|
85
118
|
|
86
119
|
Args:
|
87
|
-
z_val: Z-position in micrometers
|
120
|
+
z_val: Z-position of the point source in micrometers
|
88
121
|
|
89
122
|
Returns:
|
90
|
-
2D array containing the
|
123
|
+
2D array containing the light intensity pattern at the detector
|
91
124
|
"""
|
92
125
|
x, y = self._grid_xy
|
93
126
|
|
94
|
-
#
|
127
|
+
# Calculate how light from the point source diffracts through collection optics
|
95
128
|
r_squared = (x / self._norm_sigma_xy) ** 2 + (y / self._norm_sigma_xy) ** 2
|
96
129
|
z_term = (z_val / self._norm_sigma_z) ** 2
|
97
|
-
|
130
|
+
psf_at_detector = np.exp(-0.5 * (r_squared + z_term))
|
131
|
+
|
132
|
+
if self._pinhole_mask is not None:
|
133
|
+
# Apply pinhole's spatial filtering
|
134
|
+
return psf_at_detector * self._pinhole_mask
|
135
|
+
|
136
|
+
return psf_at_detector
|
98
137
|
|
99
138
|
@lru_cache(maxsize=128)
|
100
139
|
def psf_z_xy0(self, z_val: float) -> float:
|
101
|
-
"""
|
140
|
+
"""Calculate the PSF intensity at the center of the detector.
|
141
|
+
|
142
|
+
For a point source at z_val, this gives the intensity of light
|
143
|
+
that reaches the detector center (x=y=0). This point is always
|
144
|
+
within the pinhole if one is present.
|
102
145
|
|
103
146
|
Args:
|
104
|
-
z_val: Z-position in micrometers
|
147
|
+
z_val: Z-position of the point source in micrometers
|
105
148
|
|
106
149
|
Returns:
|
107
|
-
|
150
|
+
Light intensity at detector center
|
108
151
|
"""
|
109
|
-
|
152
|
+
z_term = (z_val / self._norm_sigma_z) ** 2
|
153
|
+
return np.exp(-0.5 * z_term)
|
110
154
|
|
111
155
|
@cache
|
112
156
|
def _3d_normalization_A(
|
AMS_BP/run_cell_simulation.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
"""
|
2
2
|
run_cell_simulation.py
|
3
3
|
|
4
|
-
This file contains the command-line interface (CLI) for the
|
4
|
+
This file contains the command-line interface (CLI) for the AMS_BP package.
|
5
5
|
|
6
6
|
The CLI is built using Typer and provides two main commands:
|
7
7
|
1. 'config': Generates a sample configuration file.
|
8
8
|
2. 'runsim': Runs the cell simulation using a provided configuration file.
|
9
9
|
|
10
10
|
Main Components:
|
11
|
-
-
|
11
|
+
- typer_app_asms_bp: The main Typer application object.
|
12
12
|
- cell_simulation(): Callback function that displays the version information.
|
13
13
|
- generate_config(): Command to generate a sample configuration file.
|
14
14
|
- run_cell_simulation(): Command to run the cell simulation using a configuration file.
|
@@ -37,7 +37,7 @@ from .configio.saving import save_config_frames
|
|
37
37
|
|
38
38
|
cli_help_doc = str(
|
39
39
|
"""
|
40
|
-
CLI tool to run [underline]A[/underline]dvanced [underline]M[/underline]olecule [underline]S[/underline]imulation: [underline]
|
40
|
+
CLI tool to run [underline]A[/underline]dvanced [underline]M[/underline]olecule [underline]S[/underline]imulation: [underline]AMS[/underline]-BP. GitHub: [green]https://github.com/joemans3/AMS_BP[/green].
|
41
41
|
[Version: [bold]{0}[/bold]]
|
42
42
|
""".format(__version__)
|
43
43
|
)
|
AMS_BP/sim_config.toml
CHANGED
@@ -77,20 +77,49 @@ oversample_motion_time = 20 # ms
|
|
77
77
|
[Condensate_Parameters]
|
78
78
|
initial_centers = [
|
79
79
|
[
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
[
|
81
|
+
5.5,
|
82
|
+
5,
|
83
|
+
0.05,
|
84
|
+
],
|
85
|
+
[
|
86
|
+
5,
|
87
|
+
5,
|
88
|
+
-0.15,
|
89
|
+
],
|
90
|
+
[
|
91
|
+
5,
|
92
|
+
6,
|
93
|
+
-0.15,
|
94
|
+
],
|
95
|
+
[
|
96
|
+
5,
|
97
|
+
5.5,
|
98
|
+
-0.15,
|
99
|
+
],
|
100
|
+
[
|
101
|
+
6,
|
102
|
+
5.5,
|
103
|
+
-0.15,
|
104
|
+
],
|
83
105
|
],
|
84
106
|
[
|
85
|
-
|
86
|
-
|
87
|
-
|
107
|
+
[
|
108
|
+
5.5,
|
109
|
+
5,
|
110
|
+
0.05,
|
111
|
+
],
|
112
|
+
[
|
113
|
+
5,
|
114
|
+
7,
|
115
|
+
-0.15,
|
116
|
+
],
|
88
117
|
],
|
89
|
-
] # um
|
90
|
-
initial_scale = [0.26, 0.26] # um
|
91
|
-
diffusion_coefficient = [0, 0] # um^2/s
|
92
|
-
hurst_exponent = [0.2, 0.2]
|
93
|
-
density_dif = 10 # density of the condensate vs the background.
|
118
|
+
] # um. First dimension is the types of molecules as in Molecule Parameters.num_molecules. second dimension is the # of condentates. center = [x,y,z]
|
119
|
+
initial_scale = [[0.26, 0.26, 0.13, 0.13, 0.26], [0.26, 0.26]] # um
|
120
|
+
diffusion_coefficient = [[0, 0, 0, 0, 0], [0, 0]] # um^2/s
|
121
|
+
hurst_exponent = [[0.2, 0.2, 0.2, 0.2, 0.2], [0.2, 0.2]]
|
122
|
+
density_dif = [10, 10] # density of the condensate vs the background.
|
94
123
|
|
95
124
|
[Output_Parameters]
|
96
125
|
output_path = "<YOUR-PATH-HERE-CAN-BE-ABSOLUTE-OR-RELATIVE>"
|
@@ -246,6 +275,7 @@ custom_path = ""
|
|
246
275
|
[psf.parameters]
|
247
276
|
numerical_aperture = 1.4 # typical range: 0.1 - 1.5
|
248
277
|
refractive_index = 1.0 # default is air (1.0)
|
278
|
+
#pinhole_diameter = 1.0 # Do not include for no pinhole else float in um units
|
249
279
|
|
250
280
|
# Multiple Laser Configuration File
|
251
281
|
|
AMS_BP/sim_microscopy.py
CHANGED
@@ -276,7 +276,7 @@ class VirtualMicroscope:
|
|
276
276
|
PhysicalSizeXUnit="m",
|
277
277
|
PhysicalSizeY=self.camera.pixel_size * 1e-6,
|
278
278
|
PhysicalSizeYUnit="m",
|
279
|
-
|
279
|
+
Channel={"Name": self.channels.names},
|
280
280
|
)
|
281
281
|
|
282
282
|
# return frames in the format ZCTYX
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: AMS_BP
|
3
|
-
Version: 0.0.
|
4
|
-
Summary: Advanced
|
3
|
+
Version: 0.0.22
|
4
|
+
Summary: Advanced Microscopy Simulations developed for the Weber Lab by Baljyot Singh Parmar
|
5
5
|
Project-URL: Documentation, https://joemans3.github.io/AMS_BP/
|
6
6
|
Project-URL: Source code, https://github.com/joemans3/AMS_BP
|
7
7
|
Author-email: Baljyot Singh Parmar <baljyotparmar@hotmail.com>
|
@@ -19,11 +19,17 @@ Requires-Dist: tomli>=2.0.2
|
|
19
19
|
Requires-Dist: typer>=0.12.5
|
20
20
|
Description-Content-Type: text/markdown
|
21
21
|
|
22
|
-
# AMS-BP
|
23
|
-
|
22
|
+
# AMS-BP
|
23
|
+
<p>
|
24
|
+
<img src="./docs/assets/icons/drawing.svg" alt="AMS-BP Logo" width="500" height="200">
|
25
|
+
</p>
|
26
|
+
|
27
|
+
## Advanced Fluorescence Microscopy Simulation Tool
|
24
28
|
|
25
29
|
AMS-BP is a powerful simulation tool for advanced fluorescence microscopy experiments. This guide covers both command-line usage and library integration.
|
26
30
|
|
31
|
+
> **_NOTE:_** Please note that this application DOES NOT currently model the process of stimulated emission, and as such is not suitable for simulating stimulated emission microscopy ([STED](https://en.wikipedia.org/wiki/STED_microscopy))-type experiments. Work in this area is ongoing.
|
32
|
+
|
27
33
|
## Table of Contents
|
28
34
|
- [Installation](#installation)
|
29
35
|
- [Command Line Interface](#command-line-interface)
|
@@ -49,6 +55,14 @@ uv tool install AMS_BP
|
|
49
55
|
- `run_AMS_BP config` : This is a helper tool to generate a template config file for the simulation. (see `run_AMS_BP config --help` for more details)
|
50
56
|
- Note: using `run_AMS_BP --help` will show you all the available commands.
|
51
57
|
4. You can now use these tools (they are isolated in their own env created by uv, which is cool).
|
58
|
+
|
59
|
+
### ***PyPi***
|
60
|
+
|
61
|
+
1. Run:
|
62
|
+
```bash
|
63
|
+
pip install AMS_BP
|
64
|
+
```
|
65
|
+
|
52
66
|
## Command Line Interface
|
53
67
|
|
54
68
|
AMS-BP provides a command-line interface with two main commands:
|
@@ -70,7 +84,7 @@ run_AMS_BP runsim CONFIG_FILE
|
|
70
84
|
|
71
85
|
The configuration file (sim_config.toml) is divided into several key sections:
|
72
86
|
|
73
|
-
#### For a detailed description of the configuration file, refer to the [Configuration File Reference](
|
87
|
+
#### For a detailed description of the configuration file, refer to the [Configuration File Reference](https://joemans3.github.io/AMS_BP/API_Documentation/sim_config/).
|
74
88
|
### Basic Units
|
75
89
|
```toml
|
76
90
|
version = "0.1"
|
@@ -158,40 +172,3 @@ frames, metadata = function_exp(microscope=microscope, config=config_exp)
|
|
158
172
|
from AMS_BP.configio.saving import save_config_frames
|
159
173
|
save_config_frames(metadata, frames, setup_config["base_config"].OutputParameters)
|
160
174
|
```
|
161
|
-
|
162
|
-
### Key Components When Using as Library
|
163
|
-
|
164
|
-
1. **ConfigLoader**: Handles configuration file parsing and validation
|
165
|
-
2. **Microscope**: Represents the virtual microscope setup
|
166
|
-
3. **Experiment Functions**: Control experiment execution
|
167
|
-
4. **Save Functions**: Handle data output
|
168
|
-
|
169
|
-
### Custom Experiment Types
|
170
|
-
|
171
|
-
When using AMS-BP as a library, you can create custom experiment types by:
|
172
|
-
|
173
|
-
1. Extending the base experiment class
|
174
|
-
2. Implementing custom scanning patterns
|
175
|
-
3. Defining new molecule behaviors
|
176
|
-
4. Creating specialized analysis routines
|
177
|
-
|
178
|
-
## Tips and Best Practices
|
179
|
-
|
180
|
-
1. **Configuration Management**
|
181
|
-
- Keep separate config files for different experiment types
|
182
|
-
- Version control your configurations
|
183
|
-
- Document any custom modifications
|
184
|
-
|
185
|
-
2. **Resource Usage**
|
186
|
-
- Monitor memory usage for large simulations
|
187
|
-
- Use appropriate sampling rates
|
188
|
-
|
189
|
-
3. **Data Output**
|
190
|
-
- Set appropriate output paths
|
191
|
-
- Use meaningful naming conventions
|
192
|
-
- Consider data format requirements for analysis
|
193
|
-
|
194
|
-
## Troubleshooting
|
195
|
-
|
196
|
-
Common issues and their solutions:
|
197
|
-
TODO
|
@@ -1,19 +1,19 @@
|
|
1
|
-
AMS_BP/__init__.py,sha256=
|
2
|
-
AMS_BP/run_cell_simulation.py,sha256=
|
3
|
-
AMS_BP/sim_config.toml,sha256=
|
4
|
-
AMS_BP/sim_microscopy.py,sha256=
|
1
|
+
AMS_BP/__init__.py,sha256=NlkysP1_GeDxvsm-dQaJIW9U1iNFB0jI_34DmCYn-bg,327
|
2
|
+
AMS_BP/run_cell_simulation.py,sha256=7InopFikjo0HfaLO2siXskBIbyCIte9avG4YXjjaWCI,7420
|
3
|
+
AMS_BP/sim_config.toml,sha256=LVpxp2zv-y6Ic-ve2AG7Ted1Fr_Tni-8yh8l5gp-7oM,12056
|
4
|
+
AMS_BP/sim_microscopy.py,sha256=0UZfyT44nrB4JdfnFnRPTVBm3tPbCyOnPXiBBZs8xIc,18617
|
5
5
|
AMS_BP/cells/__init__.py,sha256=yWFScBC1uOGDkeC8i1m1ZBtIREcyt4JHxYa72LxbBZU,177
|
6
6
|
AMS_BP/cells/base_cell.py,sha256=FIPB9J8F40tb53vv7C6qG-SaAFLOI8-MGIk1mmZ-gnI,1503
|
7
7
|
AMS_BP/cells/rectangular_cell.py,sha256=5yGxvTXYvgldLXyWXpE_SD9Zx2NLerC-I2j02reHsJ0,2515
|
8
8
|
AMS_BP/cells/rod_cell.py,sha256=jQ1kLEk74Pv2rcXPRJ6-QJJhux-mYiDSytzqlxCNWfA,3181
|
9
9
|
AMS_BP/cells/spherical_cell.py,sha256=n3ou3tW0nCxXIwv6uLkVKHkYCfgoNn8VI6CVTLBIll0,2140
|
10
10
|
AMS_BP/configio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
AMS_BP/configio/configmodels.py,sha256=
|
12
|
-
AMS_BP/configio/convertconfig.py,sha256=
|
11
|
+
AMS_BP/configio/configmodels.py,sha256=Isc6THk3RAIVdjEUBW4c_OD0I122dYufgEvAcGJQ5uo,3046
|
12
|
+
AMS_BP/configio/convertconfig.py,sha256=Fg9pOCZSxmWuHnrg-5xZRvhPEK6Qc1kXqu6LL9e9QYw,34741
|
13
13
|
AMS_BP/configio/experiments.py,sha256=HdfaSi0gPPJ_wLF87XcW5ICja19Uezx7-ygFEwNzi30,3995
|
14
14
|
AMS_BP/configio/saving.py,sha256=596QgAadV32rzsN4B2FngGFcBWCzCDnLFN-qtQsv3bM,857
|
15
15
|
AMS_BP/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
AMS_BP/metadata/metadata.py,sha256=
|
16
|
+
AMS_BP/metadata/metadata.py,sha256=YDumjc5sI3lY_UZx8f0ZhMqbG2qKQkysXwl7CY4ZtnY,2927
|
17
17
|
AMS_BP/motion/__init__.py,sha256=cy3W-wCRjjlN1DrTqYc-JltYwcE8SZCXMVPJ2o6q_BQ,178
|
18
18
|
AMS_BP/motion/condensate_movement.py,sha256=cGLHIOL7VUJ7U-JrJXetcnUF2v9SepIBznoqu6AQPxU,13252
|
19
19
|
AMS_BP/motion/track_gen.py,sha256=Z3QJLVMP1gX4SlgOXFxBg8sJhBG0Xq25ixnBoEHEAZI,19462
|
@@ -31,7 +31,7 @@ AMS_BP/optics/filters/channels/channelschema.py,sha256=SConyA5yVdfnI_8sgcxVC8SV7
|
|
31
31
|
AMS_BP/optics/lasers/__init__.py,sha256=T7dHohhyLf_pBw4TidarYHWmiwxVXGE71-Bf1aeBbuc,564
|
32
32
|
AMS_BP/optics/lasers/laser_profiles.py,sha256=J9czY646XcW8GzXx9Eb16mG7tQdWw4oVYveOrihZCeY,22745
|
33
33
|
AMS_BP/optics/psf/__init__.py,sha256=ezrKPgpTeR4gTHOvF0mhF6u2zMMTd8Bgp8PGeOf11fA,121
|
34
|
-
AMS_BP/optics/psf/psf_engine.py,sha256=
|
34
|
+
AMS_BP/optics/psf/psf_engine.py,sha256=wabdBszY4CcGUtt7ye8e3tQXQQxDJ8griGD7FMgAdIo,9192
|
35
35
|
AMS_BP/photophysics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
AMS_BP/photophysics/photon_physics.py,sha256=QRG_QIZ4csJ3g5qGP9Wtk7kzqm8_MUbVHfFef6cMtHQ,6671
|
37
37
|
AMS_BP/photophysics/state_kinetics.py,sha256=0cc7Vc4LtAbEdGDeg22IJmRGLsONOty4c32hXHO-TSU,5281
|
@@ -48,8 +48,8 @@ AMS_BP/utils/decorators.py,sha256=4qFdvzPJne0dhkhD1znPxRln1Rfr5NX8rdcCDcbATRU,62
|
|
48
48
|
AMS_BP/utils/errors.py,sha256=7BOd-L4_YeKmWn3Q4EOdTnNF3Bj_exDa3eg5X0yCZrc,759
|
49
49
|
AMS_BP/utils/maskMaker.py,sha256=2ca3n2nc8rFtUh1LurKXOJJsUmhrOpWbRnVX7fjRVvs,335
|
50
50
|
AMS_BP/utils/util_functions.py,sha256=jI6WBh09_khdABnEoVK7SK1WRvCLHuw40f5ALyflzlc,9478
|
51
|
-
ams_bp-0.0.
|
52
|
-
ams_bp-0.0.
|
53
|
-
ams_bp-0.0.
|
54
|
-
ams_bp-0.0.
|
55
|
-
ams_bp-0.0.
|
51
|
+
ams_bp-0.0.22.dist-info/METADATA,sha256=VQheoFTH5ZdmZTZwrb58UxP9YTowy8U7r6zW5kabIMI,5316
|
52
|
+
ams_bp-0.0.22.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
53
|
+
ams_bp-0.0.22.dist-info/entry_points.txt,sha256=MFUK9bZWW61djfsavqopMqiVPVn4lJtt6v8qzyEFyNM,76
|
54
|
+
ams_bp-0.0.22.dist-info/licenses/LICENSE,sha256=k_-JV1DQKvO0FR8WjvOisqdTl0kp6VJ7RFM3YZhao0c,1071
|
55
|
+
ams_bp-0.0.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|