接口调通

This commit is contained in:
自由的飞翔 2018-12-19 02:43:07 +08:00
parent f90e16a295
commit 5d00dfb0c2
2 changed files with 3 additions and 2 deletions

View File

@ -130,6 +130,7 @@ def get_spi_dataframe(station_polygon, newdata_path, month):
for i in range(0, month - 1): for i in range(0, month - 1):
spi_month_data.append("1") spi_month_data.append("1")
spei_month_data.append("1;1") spei_month_data.append("1;1")
print(newdata.iloc[index])
spi_month_data.append(str(newdata.iloc[index].rain)) spi_month_data.append(str(newdata.iloc[index].rain))
spei_month_data.append(str(newdata.iloc[index].rain) + ";" + str(newdata.iloc[index].temp)) spei_month_data.append(str(newdata.iloc[index].rain) + ";" + str(newdata.iloc[index].temp))
index += 1 index += 1

View File

@ -61,8 +61,8 @@ def get_type_path(type):
@csrf_exempt @csrf_exempt
def calc_hailstones_impact(request): def calc_hailstones_impact(request):
type = request.POST['type'] type = request.POST['type']
county = request.POST['county'] # 是否划分县域 1 or 0 county = request.POST.get('county', '0') # 是否划分县域 1 or 0
calc_dem = request.POST['dem'] # 是否计算dem 1 or 0 calc_dem = request.POST.get('dem', '0') # 是否计算dem 1 or 0
csv_path = handle_uploaded_file(request.FILES['file_path']) # 冰雹雷达数据 csv_path = handle_uploaded_file(request.FILES['file_path']) # 冰雹雷达数据
hailstones_data = get_hailstones(csv_path) hailstones_data = get_hailstones(csv_path)