This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pycuda.driver as cuda | |
| import pycuda.autoinit | |
| from pycuda.compiler import SourceModule | |
| import numpy as np | |
| def compute_xcorr_cpu(d): | |
| dc = d.astype('float32').view('complex64') | |
| dc = dc.transpose((0,2,3,1)).copy() | |
| xcorr_cpu = np.einsum('...i,...j', dc, np.conj(dc)).view('float32').astype('int32').sum(axis=-4) | |
| return xcorr_cpu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # GL interoperability example, by Peter Berrington. | |
| # Draws a rotating teapot, using cuda to invert the RGB value | |
| # each frame | |
| from OpenGL.GL import * | |
| from OpenGL.GLUT import * | |
| from OpenGL.GLU import * | |
| from OpenGL.GL.ARB.vertex_buffer_object import * | |
| from OpenGL.GL.ARB.pixel_buffer_object import * |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from OpenGL import GL | |
| from PyQt5 import QtWidgets, QtCore, QtGui, QtOpenGL | |
| from OpenGL.GL.ARB.texture_rg import GL_R32F | |
| import numpy as np | |
| import ctypes | |
| import time | |
| w, h = 400, 400 | |
| class TestWidget(QtOpenGL.QGLWidget): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file is part of VISVIS. This file may be distributed | |
| # seperately, but under the same license as VISVIS (LGPL). | |
| # | |
| # images2gif is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU Lesser General Public License as | |
| # published by the Free Software Foundation, either version 3 of | |
| # the License, or (at your option) any later version. | |
| # | |
| # images2gif is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by Tim Vandermeersch, with a blog post at | |
| # http://timvdm.blogspot.com/2009/05/using-avogadro-library-from-python.html | |
| # | |
| #import openbabel | |
| # needed for OB formats on linux (can be omitted by importing openbabel first) | |
| import sys | |
| if sys.platform.find('linux') != -1: | |
| try: | |
| import dl | |
| except ImportError: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from PySide.QtCore import QObject, Slot | |
| from PySide.QtGui import QApplication | |
| from PySide.QtWebKit import QWebView | |
| html = """ | |
| <html> | |
| <body> | |
| <h1>Hello!</h1><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- coding:utf-8 -*- | |
| # | |
| # Copyright 2012 Adrià Cereto Massagué <adrian.cereto@urv.cat> | |
| # This is the jython version of Jmol's Integration.java. | |
| # It is under public domain | |
| """ | |
| An example of integrating the Jmol viewer into a jython application, with optional console. | |
| """ | |
| from java.lang.System import exit |
NewerOlder