ism3d.modeling.model.model_setup¶
-
ism3d.modeling.model.
model_setup
(mod_dct, dat_dct, verbose=False)[source]¶ - create model container
this function can be ran only once before starting fitting iteration, so that the memory allocation/ allication will happen once during a fitting run. The output will provide the dataframework where the reference model can be mapped into.
it will also initilize some informationed used for modeling (e.g. sampling array / header / WCS)
notes on evaluating efficiency:
While building the intrinsic data-model from a physical model can be expensive, the simulated observation (2D/3D convolution) is usually the bottle-neck.
- some tips to improve the effeciency:
exclude empty (masked/flux=0) region for the convolution
- joint all objects in the intrinsic model before the convolution, e.g.
overlapping objects, lines
use to low-dimension convolution when possible (e.g. for the narrow-band continumm)
- before splitting line & cont models:
— apicall : 2.10178 seconds —
- after splitting line & cont models:
— apicall : 0.84662 seconds —
- note: imod2dHold emission componnets with Frequency-Dependent Spatial Distribution
imod3d : Hold emission conponents with Frequency-Dependent Spatial Distribution imodel=imod2d+imod3d : We always keep a copy of imod2d and imod3d to improve the effeicnecy in simobs()
- uvmodel: np.complex64
imodel: np.float32