Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# HLAVO
Sowftware part of the HLAVO project.
Software part of the HLAVO project.

# Local run
Use docker image: `martinspetlik/kalman_parflow:v1.0.0`

```bash
docker run --rm -it -v HLAVO_repository:/HLAVO martinspetlik/kalman_parflow:v1.0.0 python3.10 /HLAVO/soil_model/kalman.py work_dir /HLAVO/soil_model/configs/case_parameter_inv_synth.yaml
```


# Charon run
First singularity image has to be created:
```bash
export SINGULARITY_CACHEDIR="user home dir"
export SINGULARITY_LOCALCACHEDIR="user scratch dir"
export SINGULARITY_TMPDIR=$SCRATCHDIR

singularity build kalman_parflow.sif docker://martinspetlik/kalman_parflow:v1.0.0
```

Run Kalman on a directory that contains a configuration file
```bash
./charon_run_kalman.sh directory
```


26 changes: 26 additions & 0 deletions charon_run_kalman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -x
pbs_script=`pwd`/run_kalman.pbs

work_dir=$1

HLAVODIR="/storage/liberec3-tul/home/martin_spetlik/HLAVO"

cat >$pbs_script <<EOF
#!/bin/bash
#PBS -S /bin/bash
#PBS -l select=1:ncpus=20:cgroups=cpuacct:scratch_local=32gb:mem=32Gb
#PBS -l walltime=48:00:00
#PBS -q charon
#PBS -N kalman_soil_model_transform_param_n_exp_1
#PBS -j oe


cd ${work_dir}

singularity exec -B ${HLAVODIR} -B ${work_dir} /storage/liberec3-tul/home/martin_spetlik/kalman_parflow.sif python3 "${HLAVODIR}/soil_model/kalman.py" ${work_dir} config_0_experiments.yaml
EOF

qsub $pbs_script

169 changes: 169 additions & 0 deletions soil_model/configs/case_parameter_inv_synth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
seed: 123456
model_config:
model_class_name: "ToyProblem"
init_pressure: [-10, -100] #[-0.1, -4] # bottom, top ; [temporary solution]
static_params:
ComputationalGrid:
"Lower.Z": -500
"DZ": 10 #0.2
"NZ": 50 #, 0] # Number of grid cells in z-direction
params:
vG_K_s: "Geom.domain.Perm.Value"
vG_n: ["Geom.domain.Saturation.N", "Geom.domain.RelPerm.N"]
vG_Th_s: "Geom.domain.Saturation.SSat"
vG_Th_r: "Geom.domain.Saturation.SRes"
vG_alpha: ["Geom.domain.Saturation.Alpha", "Geom.domain.RelPerm.Alpha"]
# "Geom.domain":
# :
# "Saturation.N": [3.7, 0.1]
evapotranspiration_params:
names:
- "n"
- "T"
- "u2"
- "Tmax"
- "Tmin"
- "RHmax"
- "RHmin"
- "month"
values:
- 14
- 20
- 10
- 27
- 12
- 0.55
- 0.35
- 6
measurements_config:
model_time_step: 0.025 #2.5e-2
model_n_time_steps_per_iter: 1200 #40
rain_periods:
#- [2, 0]
- [2, -0.01667]
- [4, 0]
#- [280, -0.01667]
# - [430, 0]
kalman_config:
model_time_step: 2.5e-2
#model_n_time_steps_per_iter: 40
state_params:
pressure_field:
mean_linear:
top: -1
bottom: -500 # top, bottom
cov_exponential:
std: 2.0
rel_std_Q: 0.007
ref:
# ref: TODO: make ref accept mean clases
# correlation_length: 0.5
vG_K_s:
ref: 0.0737
#mean_std: [12.833, 0.01]
mean_std: [-2.60775248, 0.01] #[0.0737, 0.001] # transformed mean:
rel_std_Q: 0.00028 #0.01
transform: lognormal # transform to normal distribution
#conf_interval: [0.0001, 0.01] # implicit 0.95 confidence interval
#vG_n:
# ref: 1.89
#mean_std: [1.89, 0.05]
# mean_std: [-0.116533816, 0.005]
# rel_std_Q: 0.081 #0.005 #0.007273926
# transform: log_minus_one # transform to normal distribution
#conf_interval: [0.0001, 0.01] # implicit 0.95 confidence interval
#vG_Th_s:
# ref: 0.41
# mean_std: [-0.363, 0.01] #[0.41, 0.01]
# rel_std_Q: 0.001 #0.000243902
# transform: logit
#vG_Th_r:
# ref: 0.065
# mean_std: [-2.667, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
# transform: logit
#vG_alpha:
# ref: 0.75
# mean_std: [-0.287682072, 0.001]
# rel_std_Q: 0.0026 # 0.001 #0.000133333
# transform: lognormal # transform to normal distribution
#conf_interval: [0.0001, 0.01] # implicit 0.95 confidence interval
#Th_s:
# transform: none
#
# conf_interval: [0.35, 0.41, 0.9] # explicit 0.9 confidence interval
#calibration_coeffs:
# - z_pos: -10
# ref: 1
# mean_std: [1, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
#- z_pos: -15
# ref: 1
# mean_std: [1, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
# - z_pos: -20
# ref: 1
# mean_std: [1, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
# - z_pos: -40
# ref: 1
# mean_std: [1, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
# - z_pos: -60
# ref: 1
# mean_std: [1, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
# - z_pos: -100
# ref: 1
# mean_std: [1, 0.01] #[0.065, 0.01]
# rel_std_Q: 0.0001 #0.001538462
train_measurements:
saturation:
z_pos: [-10, -20, -40, -60, -100] #[-10, -20, -30, -40, -50, -60, -70, -80, -90, -100, 110, -120, -130, -140, -150] ##[-0.5, -2.5]
noise_level: 0.01
noise_distr_type: gaussian
#pressure:
# z_pos: [-15]
# noise_level: 0.1
# noise_distr_type: uniform
#velocity:
# z_pos: [0.75]
# noise_level: 0.1
# noise_distr_type: uniform
test_measurements:
saturation:
z_pos: [-50, -80, -200, -400]
noise_level: 0.01
noise_distr_type: gaussian
velocity:
z_pos: [-100, -200, -500]
noise_level: 0.01
noise_distr_type: gaussian
#pressure:
# z_pos: [1.6, 3.0]
# noise_level: 0.1
# noise_distr_type: uniform


#measurements_data_name: "saturation" # Possible values: "saturation" or "pressure"
#mes_locations_train:
# - 0.5
# - 1.4
#- 2.5
#- 3.5
#mes_locations_test:
# - 0.2
# - 0.8
# - 1.6
# - 3.0
#measurements_noise_level: 0.01
noise_distr_type: gaussian #gaussian
# model_params_noise_level: 0.1
pressure_saturation_data_noise_level: 0.01 # init state noise
init_cov_P_multiplicator: 1
#pressure_saturation_data_std: 3.2
#Q_var: 5.0e-5
#Q_model_params_var: 1e-8
sigma_points_params: {"alpha": 0.01, "beta": 2, "kappa": 1}
postprocess:
show: True