Offset
Offset module.
PerSensor
dataclass
Bases: Component
Offset implementation which assumes an additive offset between sensors.
The offset is which is constant in space and time and accounts for calibration differences between sensors. To maintain parameter identifiability, the offset for the first sensor (with index 0) is assumed to be 0, and other sensor offsets are defined relative to this beam.
Attributes:
Name | Type | Description |
---|---|---|
n_sensor |
int
|
number of sensors in the sensor object used for analysis. |
offset |
ndarray
|
array of sampled offset values, populated in self.from_mcmc() after the MCMC run is completed. |
precision_scalar |
ndarray
|
array of sampled offset precision values, populated in self.from_mcmc() after the MCMC run is completed. Only populated if update_precision is True. |
indicator_basis |
csc_matrix
|
[nof_observations x (nof_sensors - 1)] sparse matrix which assigns the offset parameters to the correct observations. |
update_precision |
bool
|
logical indicating whether the offset prior precision parameter should be updated as part of the analysis. |
mean_offset |
float
|
prior mean parameter for the offsets, assumed to be the same for each beam. Default is 0. |
prior_precision_shape |
float
|
shape parameter for the prior gamma distribution for the scalar precision parameter. Default is 1e-3. |
prior_precision_rate |
float
|
rate parameter for the prior gamma distribution for the scalar precision parameter(s). Default is 1e-3. |
initial_precision |
float
|
initial value for the scalar precision parameter. Default is 1.0. |
Source code in src/pyelq/component/offset.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
initialise(sensor_object, meteorology, gas_species)
Take data inputs and extract relevant properties.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sensor_object
|
SensorGroup
|
sensor data |
required |
meteorology
|
MeteorologyGroup
|
meteorology data wind data |
required |
gas_species
|
GasSpecies
|
gas species information |
required |
Source code in src/pyelq/component/offset.py
64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
make_model(model=None)
Take model list and append new elements from current model component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
list
|
Current list of model elements. Defaults to []. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
model output list. |
Source code in src/pyelq/component/offset.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
make_sampler(model, sampler_list=None)
Take sampler list and append new elements from current model component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Model
|
Full model list of distributions. |
required |
sampler_list
|
list
|
Current list of samplers. Defaults to []. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
sampler output list. |
Source code in src/pyelq/component/offset.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
make_state(state=None)
Take state dictionary and append initial values from model component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
dict
|
current state vector. Defaults to {}. |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
current state vector with components added. |
Source code in src/pyelq/component/offset.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
from_mcmc(store)
Extract results of mcmc from mcmc.store and attach to components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
store
|
dict
|
mcmc result dictionary. |
required |
Source code in src/pyelq/component/offset.py
136 137 138 139 140 141 142 143 144 145 |
|
plot_iterations(plot, sensor_object, burn_in_value)
Plots the offset values for every sensor with respect to the MCMC iterations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sensor_object
|
Union[SensorGroup, Sensor]
|
Sensor object associated with the offset_model |
required |
burn_in_value
|
int
|
Burn in value to show in plot. |
required |
plot
|
Plot
|
Plot object to which this figure will be added in the figure dictionary |
required |
Returns:
Name | Type | Description |
---|---|---|
plot |
Plot
|
Plot object to which this figure is added in the figure dictionary with key 'offset_iterations' |
Source code in src/pyelq/component/offset.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
plot_distributions(plot, sensor_object, burn_in_value)
Plots the distribution of the offset values after the burn in for every sensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sensor_object
|
Union[SensorGroup, Sensor]
|
Sensor object associated with the offset_model |
required |
burn_in_value
|
int
|
Burn in value to use for plot. |
required |
plot
|
Plot
|
Plot object to which this figure will be added in the figure dictionary |
required |
Returns:
Name | Type | Description |
---|---|---|
plot |
Plot
|
Plot object to which this figure is added in the figure dictionary with key 'offset_distributions' |
Source code in src/pyelq/component/offset.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|