leginon-org / leginon-redmine-archive

1 stars 0 forks source link

normalization #1200

Open leginonbot opened 5 months ago

leginonbot commented 5 months ago

Author Name: Scott Stagg (Scott Stagg) Original Redmine Issue: 1200, https://emg.nysbc.org/redmine/issues/1200 Original Date: 2011-02-24 Original Assignee: Scott Stagg


I am having trouble with my autofocus, and there always seems to be a systematic offset of around 1.5 microns more than the defocus I tell leginon to set. I think I have tracked it down to a normalization problem. I want to try adding in an objective lens normalization right before the autofocus. I see what function to call in tecnai.py in pyscope, but I don't see how to use it. Do you have a suggestion for the best way to do this?

Thanks, Scott

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Scott Stagg (Scott Stagg) Original Date: 2011-02-25T13:51:53Z


Of course, I should mention that this is something that I would only add to my code locally. If it turned out to be something useful more broadly, I would send you the code and see if you could recommend how to incorporate it for all microscopes.

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Jim Pulokas (Jim Pulokas) Original Date: 2011-02-25T20:05:02Z


The pyscope normalizeLens function may never have been tested before, so you should first test it in a small python script or from the python command line. Especially on the Krios, it is possible that the Tecnai Scripting functions have changed since the code was written. Here is a quick test:```from pyscope import tecnai t = tecnai.Tecnai() t.normalizeLens('objective')


Try to note how long it takes the scope to do the normalization, and how that relates to how quickly the normalizeLens function returns.  It is possible that the function will return even though the scope has not finished the operation.  If that happens, it will be a good idea to put a time.sleep(s) in the normalizeLens function.

Next, you can decide where in leginon you want to put it, probably immediately before the call to measureDefocusStig in focuser.py, at line 260 maybe.  It could also be done right after the preset change to fa.  In any case, this is how to call it:```self.instrument.tem.normalizeLens('objective')

If you get it working the way you like, we should add this as a checkbox option in the focus sequence. It could also be added as checkbox option to any preset, such that the normalization happens after the preset change.