Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ray_tracing/glass_function/refractiveIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import yaml
import sys
import argparse
import numpy
import numpy


class RefractiveIndex:
Expand Down Expand Up @@ -60,6 +60,10 @@ def __init__(self, databasePath=os.path.join(os.path.dirname(os.path.realpath(__
def getMaterialFilename(self, shelf, book, page):
cwd = os.getcwd()
rootdir = cwd + "/opticspy/ray_tracing/glass_database/"
if not os.path.exists(rootdir):
rootdir = self.referencePath
if not os.path.exists(rootdir):
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), rootdir)
glass_catalog = book
filename = page + '.yml'
for root, subFolders, files in os.walk(rootdir):
Expand Down