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))
def AGFFile(file): return AGF(unix.cat(file)) # Slurp up the file - Fixing up UNICODE
# 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
# 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):
def UDAFile(file): return UDA(unix.cat(file)) # Slurp up the file - Fixing up UNICODE
# 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