提交 be7e6ec3 编辑于 作者: Mijian Xu's avatar Mijian Xu 😷
浏览文件

remove netcdf dependence

上级 9794be9f
......@@ -3,7 +3,7 @@ from obspy import UTCDateTime
import numpy as np
import argparse
from obspy.clients.fdsn import Client
from netCDF4 import Dataset
# from netCDF4 import Dataset
import sys
......@@ -48,19 +48,19 @@ def nc2npz(ncdata, minlat=-90, maxlat=90, minlon=-180, maxlon=180, mindep=0, max
return cut_data, cut_dep, cut_lat, cut_lon
def lsnc():
parser = argparse.ArgumentParser(description="List all fields of netCDF file")
parser.add_argument('-k', help='Key name of fields', type=str, dest='key', default=None)
parser.add_argument('ncfile', type=str, help='Path to netCDF file')
arg = parser.parse_args()
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
ncdata = Dataset(arg.ncfile)
if arg.key is None:
print(ncdata.variables)
else:
print(ncdata.variables[arg.key])
# def lsnc():
# parser = argparse.ArgumentParser(description="List all fields of netCDF file")
# parser.add_argument('-k', help='Key name of fields', type=str, dest='key', default=None)
# parser.add_argument('ncfile', type=str, help='Path to netCDF file')
# arg = parser.parse_args()
# if len(sys.argv) == 1:
# parser.print_help()
# sys.exit(1)
# ncdata = Dataset(arg.ncfile)
# if arg.key is None:
# print(ncdata.variables)
# else:
# print(ncdata.variables[arg.key])
if __name__ == '__main__':
......
......@@ -18,7 +18,7 @@ setup(name='python-seispy',
package_dir={'seispy': 'seispy'},
package_data={'': ['data/*']},
install_requires=[
'netcdf4>=1.5.2',
# 'netcdf4>=1.5.2',
'obspy>=1.2.0',
'pandas>=1.0.0',
'numpy>=1.19.0',
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册