Skip to content
Open
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
13 changes: 12 additions & 1 deletion examples/example_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@
"gas_object = CH4()\n",
"dispersion_model = GaussianPlume(source_map=deepcopy(source_map))\n",
"true_emission_rates = np.array([[15], [10]])\n",
"\n",
"for current_sensor in sensor_group.values():\n",
" coupling_matrix = dispersion_model.compute_coupling(\n",
" sensor_object=current_sensor,\n",
Expand Down Expand Up @@ -422,6 +423,8 @@
"source_model.dispersion_model = dispersion_model\n",
"source_model.update_precision = False\n",
"source_model.site_limits = site_limits\n",
"source_model.n_sources_max = 10\n",
"source_model.n_sources_min = 0\n",
"source_model.coverage_detection = 0.1 # ppm\n",
"source_model.coverage_test_source = 3.0 # kg/hr\n",
"\n",
Expand Down Expand Up @@ -457,7 +460,15 @@
"execution_count": null,
"id": "241d1ea1-9935-417b-b1d2-296983aca7b8",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" 8%|▊ | 424/5000 [2:19:46<00:53, 85.98it/s] "
]
}
],
"source": [
"elq_model = ELQModel(\n",
" sensor_object=prepocessor_object.sensor_object,\n",
Expand Down
6 changes: 5 additions & 1 deletion src/pyelq/component/source_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ class SourceModel(Component, SourceGrouping, SourceDistribution):
solution can change). Unused in the case of a Uniform prior (self.distribution_number_sources == "Uniform").
n_sources_max (int): maximum number of sources that can feature in the solution. Only relevant for cases where
reversible_jump == True (where the number of sources in the solution can change).
n_sources_min (int): minimum number of sources that can feature in the solution. Only relevant for cases where
reversible_jump == True (where the number of sources in the solution can change).
emission_proposal_std (float): standard deviation of the truncated Gaussian distribution used to propose the
new source emission rate in case of a birth move.

Expand Down Expand Up @@ -536,6 +538,7 @@ class SourceModel(Component, SourceGrouping, SourceDistribution):
site_limits: np.ndarray = None
rate_num_sources: int = 5
n_sources_max: int = 20
n_sources_min: int = 0
emission_proposal_std: float = 0.5

update_precision: bool = False
Expand Down Expand Up @@ -930,7 +933,7 @@ def make_model(self, model: list) -> list:
model.append(
Uniform(
response=self.map["number_sources"],
domain_response_lower=1,
domain_response_lower=self.n_sources_min,
domain_response_upper=self.n_sources_max,
)
)
Expand Down Expand Up @@ -1028,6 +1031,7 @@ def make_sampler_rjmcmc(self, model: Model, sampler_list: list) -> list:
step=np.array([1.0], ndmin=2),
associated_params=self.map["source_location"],
n_max=self.n_sources_max,
n_min=self.n_sources_min,
state_birth_function=self.birth_function,
state_death_function=self.death_function,
matching_params=matching_params,
Expand Down