# Fait une combinaison de coefficients multiplicateurs de beta

# nom du fichier beta sur lequel on travaille
file='beta_mixed_first_optim_Gael_14.grd'


# premiere version
filout='beta_combin_lin.grd'
coef1=10
coef2=1.8
coef3=8
coef4=3.
coef5=2
coef6=3.5
coef7=1.8
coef8=20
coef9=15
coef10=4.5
coef11=9
coef12=3.5
coef13=3
coef14=0.1

# deuxieme version
file='beta_mixed_first_optim_Gael_14.grd'
filout='beta_combin_lin-V2.grd'
coef1=12
coef2=1.8
coef3=25
coef4=3.3
coef5=2
coef6=3.5
coef7=1.8
coef8=60
coef9=60
coef10=4.5
coef11=18
coef12=3.2
coef13=3
coef14=0.05


# Version pour le beta de Gael
file='beta_Gael_mean_15km.grd'
filout='beta_combin_Gael.grd'
coef1=0.3
coef2=0.82
coef3=10
coef4=0.35
coef5=0.15
coef6=0.21
coef7=0.7
coef8=10
coef9=4
coef10=0.15
coef11=0.6
coef12=0.2
coef13=0.18
coef14=0.1


# troisieme version Cat
file='beta_mixed_first_optim_Gael_14.grd'
filout='beta_combin_lin-V3.grd'
coef1=12
coef2=1.8
coef3=25
coef4=3.3
coef5=2
coef6=3.5
coef7=1.8
coef8=60
coef9=80
coef10=4.5
coef11=18
coef12=4.5
coef13=3
coef14=0.1



grdmath $file 0 MUL = $filout
grdmath mask_regions_15km-0.grd 1 EQ $file MUL $coef1 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 2 EQ $file MUL $coef2 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 3 EQ $file MUL $coef3 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 4 EQ $file MUL $coef4 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 5 EQ $file MUL $coef5 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 6 EQ $file MUL $coef6 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 7 EQ $file MUL $coef7 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 8 EQ $file MUL $coef8 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 9 EQ $file MUL $coef9 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 10 EQ $file MUL $coef10 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 11 EQ $file MUL $coef11 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 12 EQ $file MUL $coef12 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 13 EQ $file MUL $coef13 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout

grdmath mask_regions_15km-0.grd 14 EQ $file MUL $coef14 MUL = beta_region.grd
grdmath beta_region.grd $filout ADD = $filout