我有十年的天气数据,包括每天的最高气温(^{
首先,我想使用以下方程式计算每天的蒸散量(ETo):
ETo=0.0023*(((Tmax+Tmin)/2)+17.8)*sqrt(Tmax-Tmin)*Ra
然后,计算所有参数的月平均值和年平均值(Tmax,Tmin, Rainfall, Ra and ETo)
,并以Excel格式打印
我写了一些部分。你能帮我完成吗?我想它可能需要一个循环
import numpy as np
import pandas as pd
import math as mh
# load the weather data file
data_file = pd.read_excel(r'weather data.xlsx', sheet_name='city_1')
# defining time
year = data_file['Year']
month = data_file['month']
day = data_file['day']
# defining weather parameters
Tmax = data_file.loc[:,'Tmax']
Tmin = data_file.loc[:,'Tmin']
Rainfall = data_file.loc[:,'Rainfall']
Ra = data_file.loc[:,'Ra']
# adjusting time to start at zero
year = year-year[0]
month=month-month[0]
day=day-day[0]
#calculation process for estimation of evapotranspiration
ET0=(0.0023*(((Tmax+Tmin)/2)+17.8)*(mh.sqrt(Tmax-Tmin))*Ra
看起来您每天有一个数据行(记录)
由于行中已经有Tmax、Tmin、雨量和日照时数,因此可以添加一个净ET0行,计算如下:
相关问题 更多 >
编程相关推荐