Commit 6dcce4b2 authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

Modulate cadastral value with density of patches elevation

parent d018a8a3
......@@ -5,6 +5,7 @@ import pandas as pd
from Indicator import Indicator
from overrides import overrides
import patutils
from scipy.stats import gaussian_kde
class Productivity(Indicator):
'''
......@@ -15,12 +16,12 @@ class Productivity(Indicator):
'''
@overrides
def __init__(self, social_config=None, initial_patches=None, patches_md5sum=None, targetPAT=None):
pass
self.elevationKernel = gaussian_kde(initial_patches[initial_patches['cultgeopat']==patutils.code_cultgeopat['Fruits et légumes']]['elevation'])
@overrides
def compute_indicator(self, layer_scenario):
valeurs_cad = layer_scenario[layer_scenario['cultgeopat']==patutils.code_cultgeopat['Fruits et légumes']]
valeurs_cad = valeurs_cad['VALEUR_CAD'] / valeurs_cad['SURF_PARC']
fl = layer_scenario[layer_scenario['cultgeopat']==patutils.code_cultgeopat['Fruits et légumes']]
valeurs_cad = self.elevationKernel(fl['elevation'])*fl['VALEUR_CAD'] / fl['SURF_PARC']
return len(valeurs_cad) / valeurs_cad.sum()
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment