|
@@ -51,66 +51,66 @@ def soil_bulk_density(arr): #arr为计算过的数组
|
|
|
print('颗粒含量加和判断出错!请检查soil_bulk_density中判断颗粒含量加和内容',err)
|
|
|
|
|
|
|
|
|
- soilList = []
|
|
|
- soilContent = []
|
|
|
- soilContentTarget = []
|
|
|
- xSLErr = []
|
|
|
- xSLTarget = []
|
|
|
- try:
|
|
|
-
|
|
|
- for index, row in arr.iterrows():
|
|
|
-
|
|
|
- plusSoil = row['0.2-0.02mm颗粒含量%'] + row['2-0.2mm颗粒含量%']
|
|
|
- small_002_list = row['0.02-0.002mm颗粒含量%']
|
|
|
- small_0002_list = row['0.002mm以下颗粒含量%']
|
|
|
- if np.isnan(plusSoil) or np.isnan(small_002_list) or np.isnan(small_0002_list):
|
|
|
- soilList.append('')
|
|
|
-
|
|
|
- elif small_0002_list >=65 and small_0002_list <100:
|
|
|
- soilList.append('重黏土')
|
|
|
- elif small_0002_list >= 45 and small_0002_list <65:
|
|
|
- soilList.append('黏土')
|
|
|
- elif small_0002_list >= 25 and small_0002_list <45 and small_002_list >= 45 and small_002_list <75:
|
|
|
- soilList.append('粉(砂)质黏土')
|
|
|
- elif small_0002_list >= 25 and small_0002_list<45 and small_002_list>=0 and small_002_list<45 and plusSoil>=10 and plusSoil <55:
|
|
|
- soilList.append('壤质黏土')
|
|
|
- elif small_0002_list >= 25 and small_0002_list<45 and small_002_list>=0 and small_002_list<20 and plusSoil>=55 and plusSoil <75:
|
|
|
- soilList.append('砂质黏土')
|
|
|
- elif small_0002_list >= 15 and small_0002_list<25 and small_002_list>=45 and small_002_list<85:
|
|
|
- soilList.append('粉(砂)质黏壤土')
|
|
|
- elif small_0002_list >= 15 and small_0002_list<25 and small_002_list>=20 and small_002_list<45 and plusSoil>=30 and plusSoil <55:
|
|
|
- soilList.append('黏壤土')
|
|
|
- elif small_0002_list >= 15 and small_0002_list<25 and small_002_list>=0 and small_002_list<30 and plusSoil>=55 and plusSoil <85:
|
|
|
- soilList.append('砂质黏壤土')
|
|
|
- elif small_0002_list >= 0 and small_0002_list<15 and small_002_list>=45 and small_002_list<100:
|
|
|
- soilList.append('粉(砂)质壤土')
|
|
|
- elif small_0002_list >= 0 and small_0002_list<15 and small_002_list>=30 and small_002_list<45 and plusSoil>=40 and plusSoil <55:
|
|
|
- soilList.append('壤土')
|
|
|
- elif small_0002_list >= 0 and small_0002_list<15 and small_002_list>=0 and small_002_list<45 and plusSoil>=55 and plusSoil <85:
|
|
|
- soilList.append('砂质壤土')
|
|
|
- elif small_0002_list >= 0 and small_0002_list<15 and small_002_list>=0 and small_002_list<15 and plusSoil>=85 and plusSoil <100:
|
|
|
- soilList.append('砂土及壤质砂土')
|
|
|
- else:
|
|
|
- soilList.append('')
|
|
|
-
|
|
|
-
|
|
|
- arr['土壤质地(判断)'] = soilList
|
|
|
- for index, row in arr.iterrows():
|
|
|
- if (row['土壤质地(判断)'] != row['土壤质地']) and (not pd.isna(row['土壤质地'])):
|
|
|
- soilContent.append('存疑:土壤质地填报与判断不一致')
|
|
|
- soilContentTarget.append('土壤质地。')
|
|
|
- else:
|
|
|
- soilContent.append('')
|
|
|
- soilContentTarget.append('')
|
|
|
-
|
|
|
- if (not pd.isna(row['pH']) and row['pH'] > 7 and pd.isna(row['洗失量(吸管法需填)%'])):
|
|
|
- xSLErr.append('洗失量:ph>7但洗失量未检测。')
|
|
|
- xSLTarget.append('洗失量。')
|
|
|
- else:
|
|
|
- xSLErr.append('')
|
|
|
- xSLTarget.append('')
|
|
|
- except Exception as err:
|
|
|
- print('土壤类型判断出错!请检查soil_bulk_density中判断土壤类型内容', err)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -118,15 +118,15 @@ def soil_bulk_density(arr): #arr为计算过的数组
|
|
|
|
|
|
|
|
|
pdData = pd.DataFrame({
|
|
|
- '审核结果': pd.Series(shenHeList) + pd.Series(tRTypeList) + pd.Series(plusShenHeList) + pd.Series(soilContent) + pd.Series(xSLErr),
|
|
|
- '土壤质地(判断)': soilList,
|
|
|
- '异常指标': pd.Series(shenHeTarget) + pd.Series(tRTypeTarget) + pd.Series(plusShenHeTarget) + pd.Series(soilContentTarget) + pd.Series(xSLTarget),
|
|
|
+ '审核结果': pd.Series(shenHeList) + pd.Series(tRTypeList) + pd.Series(plusShenHeList),
|
|
|
+
|
|
|
+ '异常指标': pd.Series(shenHeTarget) + pd.Series(tRTypeTarget) + pd.Series(plusShenHeTarget),
|
|
|
})
|
|
|
return pdData
|
|
|
|
|
|
|
|
|
-def is_not_in_range(value):
|
|
|
- return value <30 or value > 90
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -409,7 +409,7 @@ def cation_value(arr):
|
|
|
summaryList.append('')
|
|
|
summaryListTar.append('')
|
|
|
else:
|
|
|
- summaryList.append('存疑:PH值、阳离子交换量、交换性盐总量、离子总和、盐基饱和度之间关系存疑。')
|
|
|
+ summaryList.append('存疑:pH值、阳离子交换量、交换性盐总量、离子总和、盐基饱和度之间关系存疑。')
|
|
|
summaryListTar.append('盐基饱和度。')
|
|
|
soilRes = soilTypeValue(row)
|
|
|
soilTypeList.append(soilRes)
|
|
@@ -561,8 +561,8 @@ def eight_ion_coun(arr, summary):
|
|
|
changeComArr.append('存疑:交换性盐基总量低于于水溶性盐离子。')
|
|
|
else:
|
|
|
changeComArr.append('')
|
|
|
-
|
|
|
- if not pd.isna(row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100']) and (row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100'] < -0.2 or row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100'] > 0.2) :
|
|
|
+
|
|
|
+ if not pd.isna(row['(全盐量-水溶性八大离子加和)x2/(全盐量+水溶性八大离子加和)*100']) and (row['(全盐量-水溶性八大离子加和)x2/(全盐量+水溶性八大离子加和)*100'] < -0.2 or row['(全盐量-水溶性八大离子加和)x2/(全盐量+水溶性八大离子加和)*100'] > 0.2) :
|
|
|
rateArr.append('存疑:全盐量与水溶性八大离子加和的相对相差超过±20%,复核合理性。')
|
|
|
else:
|
|
|
rateArr.append('')
|