Iterate Module
The iterate module manages the state for each EMC iteration.
This class is usually used in conjunction with the EMCRecon class.
Configuration
Initialize from a configuration file:
from dragonfly.iterate import Iterate
itr = Iterate('config.ini', section_name='emc')
- class dragonfly.iterate.Iterate(config_fname='', section_name='emc', resume=False)
Bases:
objectClass managing state for each EMC iteration.
Handles loading configuration, data, model, and quaternion data for iterative reconstruction.
- Parameters:
- beta
Per-frame beta values.
- beta_start
Initial per-frame beta values.
- bgscale
Per-frame background scale factors.
- blacklist
Frame blacklist mask (1=blacklisted, 0=good).
- calc_beta(self, setval=None)
Calculate beta values for each frame.
- Parameters:
setval (float) – Set all betas to this value. Default None.
- static calculate_size(qmax)
Calculate model size from qmax.
- data
Dataset.
- det_mapping
Mapping from frames to detectors.
- dets
List of detector objects.
- fcounts
Frame photon counts.
- finalize_blacklist(self)
Finalize local blacklist-derived counters after any distribution.
- free(self)
Free allocated iteration memory.
- from_config(self, config_fname, section_name='emc', resume=False)
Load configuration and initialize from file.
- initialize_last_selected(self, fname='')
Initialize or load stochastic coverage sampling history.
- initialize_stochastic_scale(self)
Mark fresh stochastic-EMC scale factors as not yet estimated.
- last_selected
Last iteration where each frame was selected for stochastic EMC.
- likelihood
Current log-likelihood value.
- load_active_data(self, update_powder=False)
Load currently active sparse binary frames for lazy_data mode.
- load_previous_blacklist(self, fname)
Load held dynamic blacklist when resuming within a data fraction period.
- mean_count
Mean photon count per detector.
- model
Current model.
- mutual_info
Current mutual information value.
- normalize_scale(self)
Normalize scale factors.
- num_det
Number of unique detectors.
- num_dfiles
Number of data files.
- params
Parameters.
- parse_blacklist(self, fname, sel_string=None, refresh=False)
Generate or update blacklist.
Blacklist file contains one number (0 or 1) per frame indicating whether the frame is blacklisted (1) or good (0).
- parse_scale(self, fname, bg=False)
Parse or initialize scale factors.
- quat
Quaternion orientations.
- refresh_data_stats(self, update_powder=True)
Recalculate eager data statistics after changing the blacklist.
- rescale
Per-detector rescale factors.
- rms_change
RMS change between iterations.
- scale
Per-frame scale factors.
- set_data(self, CDataset in_dset)
Set the data with a new dataset.
- Parameters:
in_dset (CDataset) – Dataset to use.
- set_params(self, EMCParams param)
Set the parameters.
- Parameters:
param (EMCParams) – Parameters object.
- set_quat(self, Quaternion quaternion)
Set the quaternion orientations.
- Parameters:
quaternion (Quaternion) – Quaternion object.
- static_blacklist
Static frame blacklist mask before stochastic sampling.
- tot_num_data
Total number of frames.
- update_blacklist(self, force=False, finalize=True)
Update active blacklist for the current iteration.