コード例 #1
0
ファイル: import_data_panel.py プロジェクト: bnmajor/hexrdgui
 def load_instrument_config(self):
     fname = f'default_{self.instrument.lower()}_config.yml'
     with resource_loader.resource_path(hexrd.ui.resources.calibration,
                                        fname) as f:
         for overlay in HexrdConfig().overlays:
             overlay['visible'] = False
         HexrdConfig().load_instrument_config(f)
コード例 #2
0
 def create_shape(self, module, file_name):
     with resource_loader.resource_path(module, file_name) as f:
         data = np.loadtxt(f)
     verts = self.panels['default'].cartToPixel(data)
     verts[:, [0, 1]] = verts[:, [1, 0]]
     self.shape = patches.Polygon(verts, fill=False, lw=1)
     self.connect_translate()
     self.raw_axes.add_patch(self.shape)
     self.redraw()
コード例 #3
0
ファイル: import_data_panel.py プロジェクト: HEXRD/hexrdgui
 def load_instrument_config(self):
     temp = tempfile.NamedTemporaryFile(delete=False, suffix='.yml')
     self.config_file = temp.name
     HexrdConfig().save_instrument_config(self.config_file)
     fname = f'default_{self.instrument.lower()}_config.yml'
     with resource_loader.resource_path(
             hexrd.ui.resources.calibration, fname) as f:
         for overlay in HexrdConfig().overlays:
             overlay['visible'] = False
         HexrdConfig().load_instrument_config(f, import_raw=True)
コード例 #4
0
ファイル: interactive_template.py プロジェクト: cjh1/hexrdgui
 def create_shape(self, module, file_name, det):
     with resource_loader.resource_path(module, file_name) as f:
         data = np.loadtxt(f)
     verts = self.panels[det].cartToPixel(data)
     verts[:, [0, 1]] = verts[:, [1, 0]]
     self.shape = patches.Polygon(verts, fill=False, lw=1, color='cyan')
     self.center = self.get_midpoint()
     self.connect_translate()
     self.raw_axes.add_patch(self.shape)
     self.redraw()
コード例 #5
0
 def create_shape(self, module, file_name, det, instr):
     with resource_loader.resource_path(module, file_name) as f:
         data = np.loadtxt(f)
     verts = self.panels['default'].cartToPixel(data)
     verts[:, [0, 1]] = verts[:, [1, 0]]
     self.shape = patches.Polygon(verts, fill=False, lw=1, color='cyan')
     self.shape_styles.append({'line': '-', 'width': 1, 'color': 'cyan'})
     self.center = self.get_midpoint()
     self.update_position(instr, det)
     self.connect_translate()
     self.raw_axes = self.parent.raw_axes[0]
     self.raw_axes.add_patch(self.shape)
     self.redraw()
コード例 #6
0
ファイル: import_data_panel.py プロジェクト: johnkit/hexrdgui
 def load_instrument_config(self, name):
     fname = 'default_' + name.lower() + '_config.yml'
     with resource_loader.resource_path(hexrd.ui.resources.calibration,
                                        fname) as f:
         HexrdConfig().load_instrument_config(f)