Documentation for Environment.py
¶
Environment
¶
Environment
¶
Environment(
mass_spec,
controller,
min_time,
max_time,
progress_bar=True,
out_dir=None,
out_file=None,
save_eval=False,
check_exists=False,
)
Initialises a synchronous environment to run the mass spec and controller
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mass_spec
|
An instance of [vimms.MassSpec.IndependentMassSpectrometer] object |
required | |
controller
|
An instance of [vimms.Controller.base.Controller] object |
required | |
min_time
|
start time for simulation |
required | |
max_time
|
end time for simulation |
required | |
progress_bar
|
True if a progress bar is to be shown, False otherwise |
True
|
|
out_dir
|
output directory to write mzML to |
None
|
|
out_file
|
output mzML file |
None
|
|
save_eval
|
whether to save evaluation information |
False
|
Source code in vimms/Environment.py
15 16 17 18 19 20 21 22 23 24 25 26 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 |
|
add_scan
¶
add_scan(scan)
Adds a newly generated scan. In this case, immediately we process it in the controller without saving the scan.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scan
|
A newly generated scan |
required |
Returns: None
Source code in vimms/Environment.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
close_progress_bar
¶
close_progress_bar()
Close the progress bar, typically when acquisition has finished
Returns: None
Source code in vimms/Environment.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
get_initial_scan_params
¶
get_initial_scan_params()
Get the initial scan parameters before acquisition is even started. Useful when we have controllers with pre-scheduled tasks.
Returns: the list of initial scan parameters from the controller
Source code in vimms/Environment.py
290 291 292 293 294 295 296 297 298 |
|
handle_acquisition_closing
¶
handle_acquisition_closing()
Handle acquisition close event
Returns: None
Source code in vimms/Environment.py
138 139 140 141 142 143 144 145 146 |
|
handle_acquisition_open
¶
handle_acquisition_open()
Handle acquisition open event Returns: None
Source code in vimms/Environment.py
126 127 128 129 130 131 132 133 134 135 136 |
|
handle_state_changed
¶
handle_state_changed(state)
Handle event for any state change on the mass spec
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
a new state, could be any value |
required |
Returns: None
Source code in vimms/Environment.py
148 149 150 151 152 153 154 155 156 157 158 |
|
plot_scan
¶
plot_scan(scan)
Plot a scan Args: scan: a vimms.MassSpec.Scan object.
Returns: None
Source code in vimms/Environment.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
run
¶
run()
Runs the mass spec and controller
Returns: None
Source code in vimms/Environment.py
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 |
|
save
¶
save(outname)
Save certain information from this environment. Currently only save scans, but we could save more.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outname
|
output file to save |
required |
Returns: None
Source code in vimms/Environment.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
|
write_eval_data
¶
write_eval_data(out_dir, out_file)
Writes evaluation data to a pickle file in way that works in methods in Evaluation.py
Parameters:
Name | Type | Description | Default |
---|---|---|---|
out_dir
|
output directory |
required | |
out_file
|
output filename |
required |
Returns: None
Source code in vimms/Environment.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
|
write_mzML
¶
write_mzML(out_dir, out_file)
Writes mzML to output file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
out_dir
|
output directory |
required | |
out_file
|
output filename |
required |
Returns: None
Source code in vimms/Environment.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|