You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting a script using the "Full" model to the "BlockFull" model I came across a few differences between those models.
When just changing p.scans.scan00.name = 'Full' to = 'BlockFull' and trying to run the script (which ran before) it complains in the probe initialization:
---- Probe initialization ------------------------------------------------------
Initializing probe storage Sscan00G00 using scan scan00.
...
File ".../ptypy/ptypy/utils/parameters.py", line 104, in getattr
raise AttributeError(ke)
AttributeError: 'diversity'
So adding p.scans.scan00.illumination.diversity = None will make it run. Fine if no probe modes are being used.
Adding p.scans.scan00.illumination.diversity = u.Param() instead, will make it fail again.
First:
File ".../ptypy/ptypy/utils/parameters.py", line 91, in getitem
return super(Param, self).getitem(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'power'
So,adding the power argument explicitly, even though it has a default according to the documentation.
p.scans.scan00.illumination.diversity.power = 0.1
Running that gets you the next error...
File ".../ptypy/ptypy/utils/parameters.py", line 104, in getattr
raise AttributeError(ke)
AttributeError: 'noise'
I remember more of such cases when it came to using 'BlockFull'. For example when putting in a numpy array as initial sample estimate. In all cases the documentation says there is a default for a certain parameter, same as for "Full". But there is not and it needs to be explicitly defined.
The text was updated successfully, but these errors were encountered:
When converting a script using the "Full" model to the "BlockFull" model I came across a few differences between those models.
When just changing
p.scans.scan00.name = 'Full'
to= 'BlockFull'
and trying to run the script (which ran before) it complains in the probe initialization:So adding
p.scans.scan00.illumination.diversity = None
will make it run. Fine if no probe modes are being used.Adding
p.scans.scan00.illumination.diversity = u.Param()
instead, will make it fail again.First:
So,adding the power argument explicitly, even though it has a default according to the documentation.
p.scans.scan00.illumination.diversity.power = 0.1
Running that gets you the next error...
Same story for the noise argument.
p.scans.scan00.illumination.diversity.noise = (0.5, 1.0)
I remember more of such cases when it came to using 'BlockFull'. For example when putting in a numpy array as initial sample estimate. In all cases the documentation says there is a default for a certain parameter, same as for "Full". But there is not and it needs to be explicitly defined.
The text was updated successfully, but these errors were encountered: