博主的电脑是MacBook Pro,系统是OSX10.14.4。众所周知:
X11 is uninstalled on upgrade to Mountain Lion。
因此x11类工具在macOSX随后的系统版本中不再随系统安装,因此一般情况下X11这类应用无法正常显示。ncview是类linux系统中非常高效的一种nc文件读取和可视化应用,这里介绍一下它的安装和使用过程。
1. 安装
所有依赖项我们都使用brew包管理软件来安装。
# 安装x11(xquartz)
到期官网下载安装https://www.xquartz.org/
# 安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 安装netcdf
brew install netcdf
# 安装 ncview
brew install ncview
# 命令行输入(重要)
launchctl load -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
另外,In macOS, you may need to edit your sshd_config file (typically found at /etc/sshd_config or /etc/ssh/sshd_config) if you have trouble using X forwarding. If sshd_config includes #X11Forwarding no (or just X11Forwarding no), uncomment out the line (remove the leading #), and change it to X11Forwarding yes.
参考https://www.reddit.com/r/osx/comments/y6e59/xquartz_and_apparently_incorrectly_set_display/
2.使用
ncview *.nc