pyfast_adt.main =============== .. py:module:: pyfast_adt.main Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pyfast_adt/main/FAST_ADT_gui/index /autoapi/pyfast_adt/main/adaptor/index /autoapi/pyfast_adt/main/beam_calibration/index /autoapi/pyfast_adt/main/client_sharedmemory_stream/index /autoapi/pyfast_adt/main/client_socket_stream/index /autoapi/pyfast_adt/main/fast_adt_func/index /autoapi/pyfast_adt/main/handpanels_simulator/index /autoapi/pyfast_adt/main/main_GUI/index /autoapi/pyfast_adt/main/server_sharedmemory_stream/index /autoapi/pyfast_adt/main/server_socket_stream/index /autoapi/pyfast_adt/main/temscript_remote_test/index /autoapi/pyfast_adt/main/tkinter_test/index /autoapi/pyfast_adt/main/tracking/index Attributes ---------- .. autoapisummary:: pyfast_adt.main.path1 pyfast_adt.main.insitu_tracker Classes ------- .. autoapisummary:: pyfast_adt.main.Tem_fei pyfast_adt.main.Tem_gatan_fei pyfast_adt.main.Tem_gatan_jeol pyfast_adt.main.Tem_jeol pyfast_adt.main.Tem_fei_temspy pyfast_adt.main.Tem_base pyfast_adt.main.KalmanFilter pyfast_adt.main.Tomography_tracker pyfast_adt.main.InSituTracker Package Contents ---------------- .. py:class:: Tem_fei(ip='192.168.21.1', port=8080, cam_table=None, master=None) Bases: :py:obj:`pyfast_adt.main.adaptor.microscope.adaptor_tem.Tem_base` every angle for moving the satge must be in deg as input and output, velocity for the stage in radian/s and um for the stage xyz movement .. py:attribute:: tem :value: None .. py:attribute:: result :value: [] .. py:attribute:: master :value: None .. py:attribute:: client .. py:attribute:: calibrated_speed :value: None .. py:method:: move_stage_up(stage_ampl) .. py:method:: move_stage_down(stage_ampl) .. py:method:: move_stage_left(stage_ampl) .. py:method:: move_stage_right(stage_ampl) .. py:method:: move_stage_z_up(stage_ampl) .. py:method:: move_stage_z_down(stage_ampl) .. py:method:: move_beam_up(beam_ampl) .. py:method:: move_beam_down(beam_ampl) .. py:method:: move_beam_left(beam_ampl) .. py:method:: move_beam_right(beam_ampl) .. py:method:: move_stem_beam_up(beam_ampl) .. py:method:: move_stem_beam_down(beam_ampl) .. py:method:: move_stem_beam_left(beam_ampl) .. py:method:: move_stem_beam_right(beam_ampl) .. py:method:: diffraction(checked_diff_value, kl=None) " this function set directly to 350 KL to fix a bug in temscript, this is ok only for the tecnai spirit, we should set in an external file which is the standard KL to set .. py:method:: get_defocus() .. py:method:: set_defocus(defocus) .. py:method:: euc_focus() .. py:method:: wobbler(checked_wobbler_value) .. py:method:: move_screen(checked_screen_value) .. py:method:: get_screen_position() .. py:method:: beam_blank(checked_blank_value) .. py:method:: apply_rotation(vector, theta=216.4) .. py:method:: fake() .. py:method:: get_stage(standard=False) "get the stage position in um and deg .. py:method:: set_stage_position(x=None, y=None, z=None, a=None, b=None) "set the stage position in um and deg .. py:method:: get_beam_shift() return the value of the beam shift .. py:method:: set_beam_shift(beam_pos) set the value of the beam shift .. py:method:: connect(ip, port) .. py:method:: get_projection_mode() return 'IMAGING' or 'DIFFRACTION' depending on what you are using .. py:method:: set_magnification(mag_value) .. py:method:: get_magnification() .. py:method:: set_KL(kl_value) .. py:method:: get_KL() "return the KL value in mm .. py:method:: get_intensity(slot=0) .. py:method:: set_intensity(intensity=0, slot=0) .. py:method:: get_spotsize() return the c1 index value, in fei/termofisher this is the spotsize .. py:method:: load_calibration_table(cam_table) .. py:method:: set_alpha(angle, velocity=1) .. py:method:: microscope_thread_setup(tracking_file='tracking.txt', tracking_dict=None, timer=None, event=None, stop_event=None) "this function read the tracking file and set up the threads necessary for the acqusition. 3 sockets are necessary to work. if tracking_positions == None and experiment_type == "continuous", the stage is threaded only for continuous rotation (trackless experiment). if tracking positions != None and experiment_type == "continuous", the stage is threaded for continuous rotation and the beam is threaded for tracking. if experiment_type == "stepwise", the beam only is threaded for tracking waiting to pass the target angle to apply the tracking beamshift. in the case of cred, results are displayed in the variable self.result .. py:method:: calc_stage_speed(speed) "calculate the speed in degrees/s for the tecnai series, 1 is equivalent to the maximum (normalized). speed is provided in degrees/s and return it in rad/s. .. py:method:: angle_tracking(final_angle, result: list, timer=None, event=None, stop_event=None) .. py:method:: beamshift_tracking(tracking_dict, result=None, timer=None, event=None, stop_event=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: beamshift_tracking_stem(tracking_dict, result=None, timer=None, event=None, stop_event=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: get_voltage() .. py:method:: test_tracking(tracking, ub_class=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: test_tracking_stem(ub_class) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: continuous_rotation(a, speed, event=None, stop_event=None) .. py:method:: get_illumination_mode() return micro or nanoprobe for the condenser minilens fei .. py:method:: set_illumination_mode(mode) set micro or nanoprobe for the condenser minilens fei .. py:method:: get_instrument_mode() return the current instrument mode i.e. TEM/STEM .. py:method:: set_instrument_mode(mode) set the current instrument mode i.e. TEM/STEM .. py:class:: Tem_gatan_fei(ip='192.168.21.1', port=8080, cam_table=None) Bases: :py:obj:`pyfast_adt.main.adaptor.microscope.adaptor_tem.Tem_base` .. py:attribute:: tem :value: None .. py:method:: move_stage_up(stage_ampl) .. py:method:: move_stage_down(stage_ampl) .. py:method:: move_stage_left(stage_ampl) .. py:method:: move_stage_right(stage_ampl) .. py:method:: move_stage_z_up(stage_ampl) .. py:method:: move_stage_z_down(stage_ampl) .. py:method:: move_beam_up(beam_ampl) .. py:method:: move_beam_down(beam_ampl) .. py:method:: move_beam_left(beam_ampl) .. py:method:: move_beam_right(beam_ampl) .. py:method:: diffraction(checked_diff_value, kl=None) .. py:method:: euc_focus() .. py:method:: wobbler(checked_wobbler_value) .. py:method:: move_screen(checked_screen_value) .. py:method:: get_screen_position() .. py:method:: apply_rotation(vector, theta=212) .. py:method:: fake() .. py:method:: get_stage() .. py:method:: get_beam_shift() .. py:method:: connect(ip, port) .. py:method:: microscope_thread_setup(tracking_file='tracking.txt', tracking_dict=None) .. py:method:: calc_stage_speed(speed) "calculate the speed in degrees/s for the tecnai series, 1 is equivalent to the maximum (normalized). speed is provided in degrees/s and return it in rad/s. .. py:method:: beamshift_tracking(experiment_type, tracking_step, tracking_positions) .. py:method:: get_voltage() .. py:method:: get_projection_mode() .. py:class:: Tem_gatan_jeol(ip='192.168.21.1', port=8080, cam_table=None) Bases: :py:obj:`pyfast_adt.main.adaptor.microscope.adaptor_tem.Tem_base` every angle for moving the satge must be in deg as input and output, velocity for the stage in radian/s and um for the stage xyz movement .. py:attribute:: tem :value: None .. py:method:: move_stage_up(stage_ampl) ' take a float as stage ampl (um) and move the stage on +y of that quantity, rotation and scale to um already inside .. py:method:: move_stage_down(stage_ampl) .. py:method:: move_stage_left(stage_ampl) .. py:method:: move_stage_right(stage_ampl) .. py:method:: move_stage_z_up(stage_ampl) .. py:method:: move_stage_z_down(stage_ampl) .. py:method:: move_beam_up(beam_ampl) .. py:method:: move_beam_down(beam_ampl) .. py:method:: move_beam_left(beam_ampl) .. py:method:: move_beam_right(beam_ampl) .. py:method:: diffraction(checked_diff_value, kl=None) .. py:method:: euc_focus() .. py:method:: wobbler(checked_wobbler_value) .. py:method:: move_screen(checked_screen_value) .. py:method:: get_screen_position() .. py:method:: apply_rotation(vector, theta=212) .. py:method:: fake() .. py:method:: get_stage() .. py:method:: get_beam_shift() .. py:method:: connect(ip, port) .. py:method:: microscope_thread_setup(tracking_file='tracking.txt', tracking_dict=None) .. py:method:: calc_stage_speed(speed) "calculate the speed in degrees/s for the tecnai series, 1 is equivalent to the maximum (normalized). speed is provided in degrees/s and return it in rad/s. .. py:method:: beamshift_tracking(experiment_type, tracking_step, tracking_positions) .. py:method:: get_voltage() .. py:method:: get_projection_mode() .. py:class:: Tem_jeol(cam_table=None, master=None) Bases: :py:obj:`pyfast_adt.main.adaptor.microscope.adaptor_tem.Tem_base` every angle for moving the satge must be in deg as input and output, velocity for the stage in radian/s and um for the stage xyz movement .. py:attribute:: tem :value: None .. py:attribute:: result :value: [] .. py:attribute:: master :value: None .. py:attribute:: calibrated_speed :value: None .. py:attribute:: FUNCTION_MODES :value: ('mag1', 'mag2', 'lowmag', 'samag', 'diff') .. py:method:: move_stage_up(stage_ampl) stage ampl is in um and need to be converted to m to work in FEI/ThermoFisher (from API FEI works in m). before was set at -90 as fei, but is needed another 90 deg clockwise to be sincronized properly that's why now is -180 if it doesn't work try 0 deg .. py:method:: move_stage_down(stage_ampl) .. py:method:: move_stage_left(stage_ampl) .. py:method:: move_stage_right(stage_ampl) .. py:method:: move_stage_z_up(stage_ampl) .. py:method:: move_stage_z_down(stage_ampl) .. py:method:: move_beam_up(beam_ampl) .. py:method:: move_beam_down(beam_ampl) .. py:method:: move_beam_left(beam_ampl) .. py:method:: move_beam_right(beam_ampl) .. py:method:: move_stem_beam_up(beam_ampl) .. py:method:: move_stem_beam_down(beam_ampl) .. py:method:: move_stem_beam_left(beam_ampl) .. py:method:: move_stem_beam_right(beam_ampl) .. py:method:: getFunctionMode() return one of these strings: Mag1, mag2, lowmag, samag, diff. .. py:method:: setFunctionMode(value) you can input in value both a string or an integer of the corresponding mode to change Mag1:0, mag2:1, lowmag:2, samag:3, diff:4. .. py:method:: diffraction(checked_diff_value, kl=None) " this function set directly to 350 KL to fix a bug in temscript, this is ok only for the tecnai spirit, we should set in an external file which is the standard KL to set .. py:method:: get_defocus() function that return the objective lens defocus value as an integer?? there are 2 functions OLc and OLf, meaning to coarse and fine, to checkout what is useful .. py:method:: set_defocus(defocus) function that set the objective lens defocus value from an integer?? there are 2 functions OLc and OLf, meaning to coarse and fine, to checkout what is settlable .. py:method:: euc_focus() .. py:method:: wobbler(checked_wobbler_value) .. py:method:: move_screen(checked_screen_value) function to move the fluorescent screen if checked_screen_value is True will move up, otherwise move it down. .. py:method:: get_screen_position() return if the screen is up or down as 'UP' or 'DOWN'. .. py:method:: beam_blank(checked_blank_value) function to enable beam blanking if checked_blank_value is True blank the beam, otherwise unblank it .. py:method:: apply_rotation(vector, theta=216.4) input an x,y vector and return a rotated vector of theta degree, usually used for syncronize the movement of the beam shift with the user reference. the rotation is counterclockwise!! .. py:method:: fake() .. py:method:: get_stage(standard=False) return the current stage position of x, y, z in um a and b in deg. from default API from JEOL return nm and deg .. py:method:: set_stage_position(x=None, y=None, z=None, a=None, b=None) set the stage position of x, y, z provided in um a and b given in radians. JEOL API works in nm and deg, so we need to convert the values. .. py:method:: get_beam_shift() get the beam shift value in ?? units, it's using CLA1 lens in JEOL i don't know if it is correct .. py:method:: set_beam_shift(beam_pos) set the beam shift value in ?? units .. py:method:: connect() microscope remote connection trough JEOL COM interface generated by TemExt.dll .. py:method:: get_projection_mode() .. py:method:: set_magnification(mag_value) tricky function there are 2 ways to get the info using: getMagnification that return a value integer or using getMagnificationIndex that return an integer as index .. py:method:: get_magnification() tricky function there are 2 ways to get the info using: getMagnification that return a value integer or using getMagnificationIndex that return an integer as index .. py:method:: set_KL(kl_value) .. py:method:: get_KL() "return the KL value should be in mm?? .. py:method:: get_intensity(slot=0) from instamatic the brightness control in the 2100f is CL3. for now implemented using CL3 .. py:method:: set_intensity(intensity=0, slot=0) from instamatic the brightness control in the 2100f is CL3. for now implemented using CL3 .. py:method:: get_spotsize() return the cl1 index value, in jeol this should be the the spotsize, 0-based indexing for GetSpotSize, add 1 to be consistent with JEOL software. .. py:method:: set_spotsize(value) Set the spotsize .. py:method:: load_calibration_table(cam_table) jeol have different mode we need to check the indexes such as mag1 mag2 samag lowmag diff .. py:method:: set_alpha(angle, velocity=1) stage alpha movement, velocity in jeol cannot be set directly, the function will wait for the goniometer to stop, the angle should be provided in deg .. py:method:: isStageMoving() .. py:method:: microscope_thread_setup(tracking_file='tracking.txt', tracking_dict=None, timer=None, event=None, stop_event=None) "this function read the tracking file and set up the threads necessary for the acqusition. 3 sockets are necessary to work. if tracking_positions == None and experiment_type == "continuous", the stage is threaded only for continuous rotation (trackless experiment). if tracking positions != None and experiment_type == "continuous", the stage is threaded for continuous rotation and the beam is threaded for tracking. if experiment_type == "stepwise", the beam only is threaded for tracking waiting to pass the target angle to apply the tracking beamshift. in the case of cred, results are displayed in the variable self.result .. py:method:: calc_stage_speed(speed) "calculate the speed in rad/s for jeol. speed is provided in degrees/s and return it in rad/s. .. py:method:: angle_tracking(final_angle, result: list, timer=None, event=None, stop_event=None) .. py:method:: beamshift_tracking(tracking_dict, result=None, timer=None, event=None, stop_event=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: beamshift_tracking_stem(tracking_dict, result=None, timer=None, event=None, stop_event=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: get_voltage() Get the actual accelaration voltage in kV. .. py:method:: test_tracking(tracking, ub_class=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: test_tracking_stem(ub_class) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: continuous_rotation(a, speed, event=None, stop_event=None) in jeol the gonio velocity can be changed only using goniotool an external exe from service. self.tem_stage is an object of the class RemoteMicroscope in fei that control the stage rotation, settled up by the function self.microscope_thread_setup() .. py:method:: get_illumination_mode() return micro or nanoprobe for the condenser minilens .. py:method:: set_illumination_mode(mode) set micro or nanoprobe for the condenser minilens .. py:method:: get_instrument_mode() return the current instrument mode i.e. TEM/STEM .. py:method:: set_instrument_mode(mode) set the current instrument mode i.e. TEM/STEM .. py:class:: Tem_fei_temspy(ip='192.168.21.1', port=8080, cam_table=None, master=None) Bases: :py:obj:`pyfast_adt.main.adaptor.microscope.adaptor_tem.Tem_base` every angle for moving the satge must be in deg as input and output, velocity for the stage in radian/s and um for the stage xyz movement .. py:attribute:: tem :value: None .. py:attribute:: result :value: [] .. py:attribute:: master :value: None .. py:attribute:: client .. py:attribute:: calibrated_speed :value: None .. py:method:: move_stage_up(stage_ampl) ' take a float as stage ampl (um) and move the stage on +y of that quantity, rotation and scale to um already inside .. py:method:: move_stage_down(stage_ampl) .. py:method:: move_stage_left(stage_ampl) .. py:method:: move_stage_right(stage_ampl) .. py:method:: move_stage_z_up(stage_ampl) .. py:method:: move_stage_z_down(stage_ampl) .. py:method:: move_beam_up(beam_ampl) .. py:method:: move_beam_down(beam_ampl) .. py:method:: move_beam_left(beam_ampl) .. py:method:: move_beam_right(beam_ampl) .. py:method:: move_stem_beam_up(beam_ampl) .. py:method:: move_stem_beam_down(beam_ampl) .. py:method:: move_stem_beam_left(beam_ampl) .. py:method:: move_stem_beam_right(beam_ampl) .. py:method:: diffraction(checked_diff_value, kl=None) " this function set directly to 350 KL to fix a bug in temscript, this is ok only for the tecnai spirit, we should set in an external file which is the standard KL to set .. py:method:: get_defocus() .. py:method:: set_defocus(defocus) .. py:method:: euc_focus() .. py:method:: wobbler(checked_wobbler_value) .. py:method:: move_screen(checked_screen_value) .. py:method:: get_screen_position() .. py:method:: beam_blank(checked_blank_value) .. py:method:: apply_rotation(vector, theta=216.4) .. py:method:: fake() .. py:method:: get_stage(standard=False) return it in deg and um if standard == True return also the measuring units .. py:method:: set_stage_position(x=None, y=None, z=None, a=None, b=None) .. py:method:: get_beam_shift() return the value of the beam shift .. py:method:: set_beam_shift(beam_pos) set the value of the beam shift .. py:method:: connect(ip, port) .. py:method:: get_projection_mode() .. py:method:: set_magnification(mag_value) .. py:method:: get_magnification() .. py:method:: set_KL(kl_value) .. py:method:: get_KL() "return the KL value in mm .. py:method:: get_intensity(slot=0) slot: 0,1,2, where 0 is not store the c2% value, 1 is store in beam_intensity_1, and 2 in the beam_intensity_2 .. py:method:: set_intensity(intensity=0, slot=0) .. py:method:: get_spotsize() return the c1 index value, in fei/termofisher this is the spotsize .. py:method:: load_calibration_table(cam_table) .. py:method:: set_alpha(angle, velocity=1) .. py:method:: set_alpha_temspy(angle, velocity=1, event=None, stop_event=None) this is not really compatible with the prague method right now, because the bot start changing the value and the wait event will only press the button but all the threads starts togheter .. py:method:: microscope_thread_setup(tracking_file='tracking.txt', tracking_dict=None, timer=None, event=None, stop_event=None) "this function read the tracking file and set up the threads necessary for the acqusition. 3 sockets are necessary to work. if tracking_positions == None and experiment_type == "continuous", the stage is threaded only for continuous rotation (trackless experiment). if tracking positions != None and experiment_type == "continuous", the stage is threaded for continuous rotation and the beam is threaded for tracking. if experiment_type == "stepwise", the beam only is threaded for tracking waiting to pass the target angle to apply the tracking beamshift. in the case of cred, results are displayed in the variable self.result .. py:method:: calc_stage_speed(speed) "calculate the speed in degrees/s for the tecnai series, 1 is equivalent to the maximum (normalized). speed is provided in degrees/s and return it in rad/s. .. py:method:: angle_tracking(final_angle, result: list, timer=None, event=None, stop_event=None) .. py:method:: beamshift_tracking(tracking_dict, result=None, timer=None, event=None, stop_event=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: beamshift_tracking_stem(tracking_dict, result=None, timer=None, event=None, stop_event=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: get_voltage() .. py:method:: test_tracking(tracking, ub_class=None) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: test_tracking_stem(ub_class) this thread live in a separate socket and check continuously the position of the stage. when the angle is in the one to apply the tracking, the beamshift is applied to track the crystal. the thread work passivly waiting for the angle to be reached/passed to work .. py:method:: continuous_rotation(a, speed, event=None, stop_event=None) modified cred function for fei_temspy because the stage is rotated by the bot. so it's normal that the wait here is commented because the wait is in the set_alpha_temspy function. a input in deg and speed in a.u. (radians) .. py:method:: get_illumination_mode() return micro or nanoprobe for the condenser minilens fei .. py:method:: set_illumination_mode(mode) set micro or nanoprobe for the condenser minilens fei .. py:method:: get_instrument_mode() return the current instrument mode i.e. TEM/STEM .. py:method:: set_instrument_mode(mode) set the current instrument mode i.e. TEM/STEM .. py:class:: Tem_base Bases: :py:obj:`abc.ABC` every angle for moving the satge must be in deg as input and output, velocity for the stage in radian/s and um for the stage xyz movement .. py:attribute:: var :value: None .. py:attribute:: x :value: 0 .. py:attribute:: y :value: 0 .. py:attribute:: beam_intensity_1 :value: None .. py:attribute:: beam_intensity_2 :value: None .. py:method:: move_stage_up(stage_ampl) :abstractmethod: ' take a float as stage ampl (um) and move the stage on +y of that quantity, rotation and scale to um already inside .. py:method:: move_stage_down(stage_ampl) :abstractmethod: .. py:method:: move_stage_left(stage_ampl) :abstractmethod: .. py:method:: move_stage_right(stage_ampl) :abstractmethod: .. py:method:: move_stage_z_up(stage_ampl) :abstractmethod: .. py:method:: move_stage_z_down(stage_ampl) :abstractmethod: .. py:method:: move_beam_up(beam_ampl) :abstractmethod: .. py:method:: move_beam_down(beam_ampl) :abstractmethod: .. py:method:: move_beam_left(beam_ampl) :abstractmethod: .. py:method:: move_beam_right(beam_ampl) :abstractmethod: .. py:method:: diffraction(checked_diff_value, kl=None) :abstractmethod: .. py:method:: euc_focus() :abstractmethod: .. py:method:: wobbler(checked_wobbler_value) :abstractmethod: .. py:method:: move_screen(checked_screen_value) :abstractmethod: .. py:method:: get_screen_position() :abstractmethod: .. py:method:: beam_blank(checked_blank_value) :abstractmethod: .. py:method:: apply_rotation(vector, theta=212) :abstractmethod: .. py:method:: fake() :abstractmethod: .. py:method:: get_stage(standard=False) :abstractmethod: .. py:method:: set_stage_position(x=None, y=None, z=None, a=None, b=None) :abstractmethod: .. py:method:: get_beam_shift() :abstractmethod: .. py:method:: set_beam_shift(beam_pos) :abstractmethod: .. py:method:: connect(ip, port) :abstractmethod: .. py:method:: get_projection_mode() :abstractmethod: .. py:method:: set_magnification(mag_value) :abstractmethod: .. py:method:: get_magnification() :abstractmethod: .. py:method:: set_KL(kl_value) :abstractmethod: .. py:method:: get_KL() :abstractmethod: .. py:method:: get_intensity(slot=0) :abstractmethod: slot: 0,1,2, where 0 is not store the c2% value, 1 is store in beam_intensity_1, and 2 in the beam_intensity_2 .. py:method:: set_intensity(intensity=0, slot=0) :abstractmethod: .. py:method:: load_calibration_table(cam_table) :abstractmethod: .. py:method:: set_alpha(angle, velocity=1) :abstractmethod: .. py:method:: microscope_thread_setup(tracking_file='tracking.txt', tracking_dict=None) :abstractmethod: .. py:method:: calc_stage_speed(speed) :abstractmethod: .. py:method:: beamshift_tracking(tracking_dict, result) :abstractmethod: .. py:method:: beamshift_tracking_stem(tracking_dict, result) :abstractmethod: .. py:method:: get_voltage() :abstractmethod: .. py:method:: get_illumination_mode() :abstractmethod: .. py:method:: set_illumination_mode(mode) :abstractmethod: .. py:method:: get_instrument_mode() :abstractmethod: .. py:method:: set_instrument_mode(mode) :abstractmethod: .. py:class:: KalmanFilter(dt, u_x, u_y, std_acc, x_std_meas, y_std_meas) Bases: :py:obj:`object` .. py:attribute:: dt .. py:attribute:: u .. py:attribute:: x .. py:attribute:: A .. py:attribute:: B .. py:attribute:: H .. py:attribute:: Q .. py:attribute:: R .. py:attribute:: P .. py:method:: predict() .. py:method:: update(z) .. py:class:: Tomography_tracker(images=None, visualization=False, existing_roi=None, dt=0.1, exp_type='continuous') this is the core of the patchworkCC algorithm, main method run the tracking asking the user to selct a ROI to track, and return the tracked positions as a list of tuples (predicted_pos (pure KF), template_match (CC), filtered_pos (CC corrected by KF))) just to clarify: --self.CC_positions is brutally pure CC --self.template_matching_result is CC with on top the patchwork to remove ambiguities --predicted_pos is predicted by pureKF using self.template_matching_result to learn(newton law) (-1 iteration) --filtered_pos is template_matching res. corrected by the KF (CC+newton) == more math the self.support1 contain the tracked positions of all the methods. this method is based on a liner KF at constant velocity where the acceleration act as control input if not overwritten in the init step. to overwrite with another KF model after construct the class should be possible to just assign self.KF to another KF model. if intersted check at the bottom the function self.select_other_KF_model(KF_model = your_model) .. py:attribute:: KF .. py:attribute:: KF_lost_position :value: [] .. py:attribute:: KF_corrected_position :value: [] .. py:attribute:: lost_counter :value: 0 .. py:attribute:: support1 :value: [] .. py:attribute:: series :value: None .. py:attribute:: n :value: None .. py:attribute:: backup_roi :value: None .. py:attribute:: series_support :value: [] .. py:attribute:: support_manual :value: [] .. py:attribute:: exp_type :value: 'continuous' .. py:attribute:: list_templates :value: [] .. py:attribute:: counter_img :value: None .. py:attribute:: visualization :value: False .. py:attribute:: existing_roi :value: None .. py:attribute:: custom_model :value: [False, 'linear_KF_2D', 0] .. py:method:: main() .. py:method:: user_defined_ROI(img) .. py:method:: plot_single_track(visualization=False) .. py:method:: plot_tracking() .. py:method:: plot_tracking_reevaluation() .. py:method:: save_tracking(datapoints) .. py:method:: draw_circle(event, x, y, flags, param) .. py:method:: plot_result(color=(255, 0, 0)) .. py:method:: manual_tracking(images=None, visualization=False) .. py:method:: display_tracking(images, tracking_dict, method, beam_size_diff=None) .. py:method:: select_other_KF_model(KF_model=None, KF_from_list=None) function to overwrite the KF model used. the KF should be a class with at least 2 functions predict and update to work properly. a custom KF model can be passed in the argument KF_model (a class to construct). otherwise you can use the argument KF_from_list to select an already implemented KF model. the function construct the class for you. as it's builded the experiment up to now the KF model should be using as measurement for the update step only the x,y position obtained from an object detection method. .. py:data:: path1 :value: 'L:\\Marco\\hardware_microscopes\\TecnaiF30\\sergi_track\\Tracking\\Tomography\\Sequential\\18\\clean' .. py:class:: InSituTracker(shift=None, tilt_step=5, sim_mode=False, tomo_tracker=None) .. py:attribute:: a :value: [] .. py:attribute:: dt :value: 0.1 .. py:attribute:: tilt_step :value: 5 .. py:attribute:: updated_positions :value: [] .. py:attribute:: updated_positions_2 :value: [] .. py:attribute:: second_iteration :value: False .. py:attribute:: tomo_tracker :value: None .. py:method:: main() .. py:method:: shift_image(image_array, shift) .. py:method:: insitu_obj_detection_sim() .. py:method:: in_situ_run(image, frame_number) .. py:method:: plot_insitu_result() .. py:data:: insitu_tracker