使用python从netCDF文件中提取变量而不重复值

时间:2016-06-30 18:00:22

标签: python numpy netcdf

我尝试输出每年的降水量但是当print precip执行时,我得到的值相同9.969209968386869e+36

import arcpy
import numpy
import netCDF4
f =netCDF4.Dataset('Y:\\Projects\\ToriW\\NC Files\\TP40Years.nc', 'r',Format='NetCDF4')

#The dimensions and variables of the netCDF file
lon = numpy.array(f.variables['lon'][:])
lat = numpy.array(f.variables['lat'][:])
time =numpy.array(f.variables['time'][:])
precip = numpy.array(f.variables['pre'][:], dtype=type(f.variables))  
for i in time:
      print ("Precipitation for:", i)
      print (precip[i][:][:])

我的问题是如何删除此号码?我已经尝试了numpy.putmask,但是大数字一直在输出。我还能做什么?

0 个答案:

没有答案
相关问题