def _init_from_file(self, filename):
        """Create detector from detx file."""
        if not filename.endswith("detx"):
            raise NotImplementedError('Only the detx format is supported.')
        self._open_file(filename)
        self._extract_comments()
        self._parse_header()
        self._parse_doms()
        self._det_file.close()
def _init_from_file ( self , filename ) : if not filename . endswith ( "detx" ) : raise NotImplementedError ( 'Only the detx format is supported.' ) self . _open_file ( filename ) self . _extract_comments ( ) self . _parse_header ( ) self . _parse_doms ( ) self . _det_file . close ( )
Create detector from detx file.