def __init__(self, filepath): dir, self.filename = os.path.split(filepath) try: self._file = NetCDFFile(filepath) except: raise OpenFileError('Unable to open file %s.' % filepath)