Example #1
0
    def __init__(self, filename, src):
        self.src = src

        self.unit = 1e-3

        self.source_material = '\"\"'

        self.field_angles = {}

        self.surfaces    = []
        self.surfcounter = 0

        self.prev_disz = 0.0

        self.stop  = 0
        self.float = 0

        self.mce_curr = []
        self.mce_ops  = []

        self.default_surf = { "CONI": 0.0, "PARM": [] }
        self.current = deepcopy(self.default_surf)

        for line in unix.cat(filename).split('\n'):
            line = line.split()

            if len(line): getattr(self, line[0])(*line[1:])        # Call internal methods to parse lines

        self.surfaces.append(getConic(self.current))
Example #2
0
File: agf.py Project: fquiros/CEO
def AGFFile(file):
    return AGF(unix.cat(file))                         # Slurp up the file - Fixing up UNICODE
Example #3
0
File: agf.py Project: fquiros/CEO
# Zemax AGF file.
#
# 
import glob
import unix

from cffi import FFI
cffi = FFI()

cffi.cdef(unix.cat("glass.hh"))

class AttrDict(dict):
    def __init__(self, *args, **kwargs):
        super(AttrDict, self).__init__(*args, **kwargs)
        self.__dict__ = self

def AGFFile(file):
    return AGF(unix.cat(file))                         # Slurp up the file - Fixing up UNICODE

class AGF(object):

    def __init__(self, agf):
        self.current = None
        self.glass   = []

        for line in agf.split('\n'):
            line = line.split()

            if len(line) : getattr(self, line[0])(*line)        # Call internal methods to parse lines

Example #4
0
File: agf.py Project: sdimoudi/CEO
def AGFFile(file):
    return AGF(unix.cat(file))  # Slurp up the file - Fixing up UNICODE
Example #5
0
File: agf.py Project: sdimoudi/CEO
# Zemax AGF file.
#
#
import glob
import unix

from cffi import FFI
cffi = FFI()

cffi.cdef(unix.cat("glass.hh"))


class AttrDict(dict):
    def __init__(self, *args, **kwargs):
        super(AttrDict, self).__init__(*args, **kwargs)
        self.__dict__ = self


def AGFFile(file):
    return AGF(unix.cat(file))  # Slurp up the file - Fixing up UNICODE


class AGF(object):
    def __init__(self, agf):
        self.current = None
        self.glass = []

        for line in agf.split('\n'):
            line = line.split()

            if len(line):
Example #6
0
File: uda.py Project: jbroll/acorn
def UDAFile(file):
    return UDA(unix.cat(file))  # Slurp up the file - Fixing up UNICODE
Example #7
0
File: agf.py Project: jbroll/acorn
# Zemax AGF file.
#
# 
import glob
import unix

from cffi import FFI
cffi = FFI()

cffi.cdef(unix.cat("../glass/glass.hh"))

class AttrDict(dict):
    def __init__(self, *args, **kwargs):
	super(AttrDict, self).__init__(*args, **kwargs)
	self.__dict__ = self

class AGFFile(file):
    return AGF(unix.cat(file)) 						# Slurp up the file - Fixing up UNICODE

class AGF(object):

    def __init__(self, agf):
	self.current = None
	self.glass   = []

	for line in agf.split('\n'):
	    line = line.split()

	    if len(line) : getattr(self, line[0])(*line)		# Call internal methods to parse lines

Example #8
0
File: uda.py Project: jbroll/acorn
def UDAFile(file):
    return UDA(unix.cat(file)) 						# Slurp up the file - Fixing up UNICODE