Exemplo n.º 1
0
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, render_to_response
from collections import deque, namedtuple

import networkx as nx
import numpy as np
import matplotlib as plt

plt.use('Agg')
import matplotlib.pyplot as plt

plt.switch_backend('Agg')
import pylab
from matplotlib.figure import Figure
import numpy as np
import pandas as pd


@login_required
def edged(request):
    # we'll use infinity
    inf = float('inf')
    Edge = namedtuple('Edge', 'start, end, cost')

    def make_edge(start, end, cost=1):
        return Edge(start, end, cost)

    class Graph:
        def __init__(self, edges):
            # let's check that the data is right
            wrong_edges = [i for i in edges if len(i) not in [2, 3]]
Exemplo n.º 2
0
from __future__ import unicode_literals, print_function

# Author: Marnik Bercx (University of Antwerp), Kamal Choudhary (NIST)
# Forked and adjusted from https://github.com/ldwillia/SL3ME
"""
Calculate spectroscopy limited maximum efficiency (SLME) given dielectric function data
"""

import os
import numpy as np
import matplotlib as plt
import scipy.constants as constants
from scipy.integrate import simps
import matplotlib.pyplot as plt

plt.switch_backend("agg")
import glob, os, math
from pymatgen.io.vasp.outputs import Vasprun
from numpy import loadtxt, arange, logspace
from math import pi, sqrt
from scipy.constants import physical_constants, speed_of_light
from pymatgen.electronic_structure.core import Spin

eV_to_recip_cm = 1.0 / (physical_constants["Planck constant in eV s"][0] *
                        speed_of_light * 1e2)


def nelec_out(out=""):
    f = open(out, "r")
    lines = f.read().splitlines()
    f.close()
Exemplo n.º 3
0
from __future__ import  unicode_literals, print_function

# Author: Marnik Bercx (University of Antwerp), Kamal Choudhary (NIST)
# Forked and adjusted from https://github.com/ldwillia/SL3ME

"""
Calculate spectroscopy limited maximum efficiency (SLME) given dielectric function data
"""

import os
import numpy as np
import matplotlib as plt
import scipy.constants as constants
from scipy.integrate import simps
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import glob,os,math
from pymatgen.io.vasp.outputs import Vasprun
from numpy import loadtxt, arange, logspace
from math import pi, sqrt
from scipy.constants import physical_constants, speed_of_light
from pymatgen.electronic_structure.core import Spin



eV_to_recip_cm = 1.0/(physical_constants['Planck constant in eV s'][0]*speed_of_light*1e2)

def nelec_out(out=''):
 f=open(out,'r')
 lines=f.read().splitlines()
 f.close()