我正在尝试远程读取一个netcdf文件。
我使用Paramiko软件包来读取我的文件,就像这样:
import paramiko
from netCDF4 import Dataset
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=’hostname’, username=’usrname’, password=’mypassword’)
sftp_client = client.open_sftp()
ncfile = sftp_client.open('mynetCDFfile')
b_ncfile = ncfile.read() # ****
nc = Dataset('test.nc', memory=b_ncfile)
但是ncfile.read()
的运行速度非常慢。
因此我的问题是:是否有其他方法可以远程读取netcdf文件,或者是否有方法可以加快paramiko.sftp_file.SFTPFile.read()
的读取速度?