我想这样如下获得与蟒蛇的数学方程求解:数学方程式与Python
# Open netCDF file
fd1 = nc.Dataset(nc_file1, 'r')
# Read variables from the netCDF file
rng1 = fd1.variables['range'][:]
tim1 = fd1.variables['time'][:]
pwr1 = fd1.variables['pwr'][:]
dpl1 = fd1.variables['dpl'][:]
nfft1 = fd1.variables['nfft'][0]
pn1 = fd1.variables['pnoise'][:]
# Close netCDF file
fd1.close()
# Specify beam
ibeam1 = 0
# Time convertion from seconds to hours
tim1 = tim1/3600.0
# Select data and transpose
p_plot1 = pwr1[ibeam1]
for it1 in range(len(tim1)):
p_plot1[it1] = p_plot1[it1] - pn1[ibeam1][it1] - 10.*np.log10(nfft1)
p_plot1 = p_plot1.transpose()
**#Determine Height**
A=6378.1370
Tetha=math.cos((37.5 * math.pi)/180)
for j in range(len(tim1)):
for i in range(len(rng1)):
D[i]=sqrt(A**2+(rng1[i]**2)+(2*A*(rng1[i])*Tetha)
height1(i,j)=(D[i]-A)
从数学方程式(确定身高)我有错误。它可能是Python中等式的语法。实际上,我关注的是tim1,rng1和pwr1三个数据变量。从rng1数据中,我将获得height1,只需通过使用该方程将rng1转换为height1即可。 预先感谢您。
你忘了提问了。 – jonrsharpe
'D [i] = sqrt(A ** 2 +(rng1 [i] ** 2)+(2 * A *(rng1 [i])* Tetha)'末尾需要额外的')' –
只是一个额外的)。因为我给了额外的一个后,仍然有最后一行 – user3346361