def __init__(self, mode, *args, **kwargs): super(SlicedDatabaseWindow, self).__init__(*args, **kwargs) self.setupUi(self) self._setup_tree() self._connect() # Setup database path = __directory__ / config.get_key('paths', 'database') self.database = Database(str(path)) # Open Options Window if mode == 'binding-energy': self.options = SlicedDataBaseOptions() elif mode == 'photon-energy': self.options = SlicedDataBaseOptions2() elif mode == 'cubefile': self.options = SlicedCubefileOptions() # URLs (with extra information if available) chosen self.URLs = [] self.fill_tree() self.show() self.options.show()
def __init__(self, *args, **kwargs): super(OrbitalDatabase, self).__init__(*args, **kwargs) self.setupUi(self) self._setup_tree() self._connect() # Setup database path = __directory__ / config.get_key('paths', 'database') self.database = Database(path) # URLs (with extra information if available) chosen self.URLs = [] self.fill_tree() self.show()
# kMap.py Imports from kmap.library.database import Database from kmap.library.orbital import Orbital from kmap.library.misc import energy_to_k from kmap.library.orbital2povray import Orbital2Povray # here are other possible choices #E_kin = 30; ID = 406; orbital_name = 'H**O'; # bisanthene (gas phase geometry) PBE-GGA, #E_kin = 30; ID = 406; orbital_name = 'LUMO'; # bisanthene (gas phase geometry) PBE-GGA, #E_kin = 60; ID = 406; orbital_name = 'H**O-8';# bisanthene (gas phase geometry) PBE-GGA, #E_kin = 60; ID = 406; orbital_name = 'H**O-9';# bisanthene (gas phase geometry) PBE-GGA, #E_kin = 30; ID = 406; orbital_name = 'H**O-5';# bisanthene (gas phase geometry) PBE-GGA, # define paths and select orbital ID db = Database('../../kmap/resources/misc/molecules.txt') # define path to molecules.txt file # add more elements in povray-image FT_stuff = ''' // x-axis #declare l = 5; union{ cylinder { <0,0,0>,<l,0,0>,0.075 } cone { <l,0,0>, 0.15, <l+0.5,0,0>,0.0 } pigment { rgb<0,0,0>} } // y-axis #declare l = 7.5; union{ cylinder { <0,0,0>,<0,-l,0>,0.075 } cone { <0,-l,0>, 0.15, <0,-l-0.5,0>,0.0 }
# Python Imports from pathlib import Path # Third Party Imports import matplotlib.pyplot as plt # kMap.py Imports from kmap.library.database import Database from kmap.library.sliceddata import SlicedData # Path to data folder; replace with your own; use '/' instead of '+' # when concatenating with strings data_path = Path(__file__).parent / Path('../../kmap/resources/misc') db = Database(data_path / 'molecules.txt') molecule = db.get_molecule_by_ID( 11) # choose pentacene molecule for testing ... # set name and select list of orbitals name = 'pentacene' # set name for SlicedData Object orbitals = [] for orbital in molecule.orbitals[7:-4]: orbitals.append( [orbital.URL, { 'energy': orbital.energy, 'name': orbital.name }]) # set parameters parameters = [
# Third Party Imports # kMap.py Imports from kmap.library.database import Database from kmap.library.orbital2povray import Orbital2Povray # set path to molecules.txt file containing the summary of the OrganicMoelculeDatabase at http://143.50.77.12:5000/ molecules_path = '../../kmap/resources/misc/molecules.txt' # set path to povray settings file settings = Path('settings_povray.ini') ID = 406 # choose molecule ID from database ######################################################## db = Database(molecules_path) molecule = db.get_molecule_by_ID(ID) chosen_orbitals = ['H**O', 'LUMO' ] # give list of orbitals or set choose_orbitals = 'all' for orbital in molecule.orbitals: name = orbital.name.split()[-1] if type(chosen_orbitals) == str or name in chosen_orbitals: with urllib.request.urlopen(orbital.URL) as f: file = f.read().decode('utf-8') # read cube from online-database povray = Orbital2Povray.init_from_cube( file, domain='real', settingsfile=settings) # convert to povray povray.write_povfile('%04i_%s.pov' % (ID, name)) # write povray-file povray.run_povray(executable='povray +W1600 +H1200')
# Python Imports from pathlib import Path # Third Party Imports import matplotlib.pyplot as plt # kMap.py Imports from kmap.library.database import Database from kmap.library.sliceddata import SlicedData # Path to data folder; replace with your own; use '/' instead of '+' # when concatenating with strings data_path = Path(__file__).parent / Path('../../kmap/resources/misc') db = Database(data_path / 'molecules.txt') molecule = db.get_molecule_by_ID( 406) # choose ID from database (406 = bisanthene, PBE-functional) # set name and select list of orbitals name = 'bisanthene' # set name for SlicedData Object hdf5_name = 'bisanthene_ID406.hdf5' # choose name fpr hdf5-file to be written energy_range = [-13, -2] # select a binding energy range pi = ['au', 'b2g', 'b3g', 'b1u'] sigma = ['ag', 'b1g', 'b2u', 'b3u'] selected_symmetry = pi + sigma # choose between pi or sigma orbitals orbitals = [] for orbital in molecule.orbitals: if (energy_range[0] <= orbital.energy <= energy_range[1]) and \ orbital.symmetry in selected_symmetry: