Project

General

Profile

Premade Realistic-looking calibration and images for simulation » History » Revision 3

Revision 2 (Anchi Cheng, 08/21/2019 03:18 PM) → Revision 3/6 (Anchi Cheng, 08/21/2019 03:20 PM)

h1. Premade Realistic-looking calibration and images for simulation 

 A set of simTEM and simCameras were made to simulate the set up of energy-filtered Krios coupled with Ceta and Gatan K2 camera.    This was made for https://github.com/nysbc/leginon-tutorial 

 Here is what you can do to add it to your development sandbox. 

 h2. Create a folder to hold the simulated images 
 Download the folder simimages and its content from [[leginon:../repository/revisions/myami-tutorial/show/tutorial_data]] [[leginon:/repository/revisions/myami-tutorial/show/tutorial_data]] 
 Make sure the directory is writable by the user starting the leginon. 

 h2. Modify your Instruments.cfg to include these instruments 
 <pre> 
 [Sim TEM] 
 class: simtem.SimTEM300 
 cs: 2.7e-3 
 simpar: /abosolute_path_to_your/simimages 

 [Sim Cam] 
 class: simccdcamera2.SimCCDCamera 
 zplane: 40 
 height: 4096 
 width: 4096 
 simpar: /abosolute_path_to_your/simimages 

 [Sim K2] 
 class: simccdcamera2.SimK2CountingCamera 
 zplane: 70 
 width: 3710 
 height: 3838 
 simpar: /abosolute_path_to_your/simimages 
 </pre> 

 *These two steps makes the camera look for the images in your simimages directory according to the simTEM magnification and binning* 

 h2. Import instruments, calibrations and presets 

 h3. 1. Go to your myami clone under dbschema/tools to access these python scripts: 

 <pre> 
 import_leginon_instruments.py 
 import_leginon_cal.py 
 import_leginon_preset.py 
 </pre> 

 h3. 2. Download these files attached to this wiki page to current directory (Find them at the bottom of this page by opening the tab "Files") 

 <pre> 
 instruments.json 
 mags_leginon-docker+SimTEM300.json 
 preset_SimTEM300+leginon-docker+SimCCDCamera.json 
 preset_SimTEM300+leginon-docker+SimK2CountingCamera.json 
 cal_SimTEM300+leginon-docker+SimCCDCamera.json 
 cal_SimTEM300+leginon-docker+SimK2CountingCamera.json 
 </pre> 

 h3. 3. Modify the hostname in the json files 

 These files are exported from a computer with hostname "leginon-docker".    Do import these to your host, you need to change that part of the filename to your hostname.    If you are not sure, proceed to the next step and it will give you an error and a hint on what name you should change it to. 

 h3. 4. Performing the import 

 Let's say that your sinedon.cfg specify the host to be localhost, and your host mapping has been set up to use leginon-docker as the hostname within leginon operation in pyami.cfg, then you should run these in order 

 <pre> 
 ./import_leginon_instruments.py localhost 
 ./import_leginon_presets.py localhost preset_SimTEM300+leginon-docker+SimCCDCamera.json 
 ./import_leginon_presets.py localhost preset_SimTEM300+leginon-docker+SimK2CountingCamera.json 
 ./import_leginon_cal.py localhost cal_SimTEM300+leginon-docker+SimCCDCamera.json 
 ./import_leginon_cal.py localhost cal_SimTEM300+leginon-docker+SimK2CountingCamera.json 
 </pre>