"What just happened???"

Here we take an existing modflow model and setup a very complex parameterization system for arrays and boundary conditions. All parameters are setup as multpliers: the original inputs from the modflow model are saved in separate files and during the forward run, they are multplied by the parameters to form new model inputs. the forward run script ("forward_run.py") is also written. And somewhat meaningful prior covariance matrix is constructed from geostatistical structures with out any additional arguements...oh yeah!


In [1]:
%matplotlib inline
import os
import platform
import shutil
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import flopy
import pyemu


flopy is installed in /Users/jwhite/Dev/my_flopy/flopy

In [2]:
nam_file = "freyberg.nam"
org_model_ws = "freyberg_sfr_update"
temp_model_ws = "temp"
new_model_ws = "template"
# load the model, change dir and run once just to make sure everthing is working
m = flopy.modflow.Modflow.load(nam_file,model_ws=org_model_ws,check=False, exe_name="mfnwt",
                              forgive=False,verbose=True)
m.change_model_ws(temp_model_ws,reset_external=True)
m.write_input()
EXE_DIR = os.path.join("..","bin")
if "window" in platform.platform().lower():
    EXE_DIR = os.path.join(EXE_DIR,"win")
elif "darwin" in platform.platform().lower():
    EXE_DIR = os.path.join(EXE_DIR,"mac")
else:
    EXE_DIR = os.path.join(EXE_DIR,"linux")

[shutil.copy2(os.path.join(EXE_DIR,f),os.path.join(temp_model_ws,f)) for f in os.listdir(EXE_DIR)]

try:
    m.run_model()
except():
    pass


Creating new model with name: freyberg
--------------------------------------------------

Parsing the namefile --> freyberg_sfr_update/freyberg.nam

--------------------------------------------------
External unit dictionary:
{2: filename:freyberg_sfr_update/freyberg.list, filetype:LIST, 11: filename:freyberg_sfr_update/freyberg.dis, filetype:DIS, 13: filename:freyberg_sfr_update/freyberg.bas, filetype:BAS6, 31: filename:freyberg_sfr_update/freyberg.upw, filetype:UPW, 19: filename:freyberg_sfr_update/freyberg.rch, filetype:RCH, 32: filename:freyberg_sfr_update/freyberg.nwt, filetype:NWT, 14: filename:freyberg_sfr_update/freyberg.oc, filetype:OC, 30: filename:freyberg_sfr_update/freyberg.lmt6, filetype:LMT6, 20: filename:freyberg_sfr_update/freyberg.wel, filetype:WEL, 17: filename:freyberg_sfr_update/freyberg.sfr, filetype:SFR, 50: filename:freyberg_sfr_update/freyberg.cbc, filetype:DATA(BINARY), 51: filename:freyberg_sfr_update/freyberg.hds, filetype:DATA(BINARY), 60: filename:freyberg_sfr_update/freyberg.sfr.out, filetype:DATA}
--------------------------------------------------

ModflowBas6 free format:True

loading dis package file...
   Loading dis package with:
      3 layers, 40 rows, 20 columns, and 3 stress periods
   loading laycbd...
   loading delr...
   loading delc...
   loading top...
   loading botm...
      for 3 layers and 0 confining beds
   loading stress period data...
       for 3 stress periods
adding Package:  DIS
   DIS  package load...success
   LIST package load...skipped
loading bas6 package file...
adding Package:  BAS6
   BAS6 package load...success
loading upw package file...
   loading ipakcb, HDRY, NPUPW, IPHDRY...
   loading LAYTYP...
   loading LAYAVG...
   loading CHANI...
   loading LAYVKA...
   loading LAYWET...
   loading hk layer   1...
   loading vka layer   1...
   loading ss layer   1...
   loading hk layer   2...
   loading vka layer   2...
   loading ss layer   2...
   loading hk layer   3...
   loading vka layer   3...
   loading ss layer   3...
Adding freyberg.cbc (unit=50) to the output list.
adding Package:  UPW
   UPW  package load...success
loading rch package file...
   loading rech stress period   1...
   loading rech stress period   2...
   loading rech stress period   3...
adding Package:  RCH
   RCH  package load...success
loading nwt package file...
   did not generate dataset 1 kwargs
adding Package:  NWT
   NWT  package load...success
loading oc package file...
Adding freyberg.hds (unit=51) to the output list.
adding Package:  OC
   OC   package load...success
loading lmt package file...
adding Package:  LMT6
   LMT6 package load...success
loading wel package file...
   loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper     1
   loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper     2
   loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper     3
adding Package:  WEL
   WEL  package load...success
loading sfr2 package file...
Adding freyberg.sfr.out (unit=60) to the output list.
adding Package:  SFR
   SFR  package load...success
   DATA(BINARY) file load...skipped
      freyberg.cbc
   DATA(BINARY) file load...skipped
      freyberg.hds
   DATA file load...skipped
      freyberg.sfr.out
Warning: external file unit 0 does not exist in ext_unit_dict.

   The following 9 packages were successfully loaded.
      freyberg.dis
      freyberg.bas
      freyberg.upw
      freyberg.rch
      freyberg.nwt
      freyberg.oc
      freyberg.lmt6
      freyberg.wel
      freyberg.sfr
   The following 1 packages were not loaded.
      freyberg.list

changing model workspace...
   temp

Writing packages:
   Package:  DIS
   Package:  BAS6
   Package:  UPW
   Package:  RCH
   Package:  NWT
   Package:  OC
   Package:  LMT6
   Package:  WEL
   Package:  SFR
 
FloPy is using the following  executable to run the model: /Users/jwhite/bin/mfnwt

                                  MODFLOW-NWT-SWR1 
    U.S. GEOLOGICAL SURVEY MODULAR FINITE-DIFFERENCE GROUNDWATER-FLOW MODEL
                             WITH NEWTON FORMULATION
                             Version 1.1.3, 8/01/2017                        
                    BASED ON MODFLOW-2005 Version 1.11.0 08/08/2013                       

                    SWR1 Version 1.04.0 09/15/2016                       

 Using NAME file: freyberg.nam 
 Run start date and time (yyyy/mm/dd hh:mm:ss): 2019/09/12 10:36:04

 Solving:  Stress period:     1    Time step:     1    Groundwater-Flow Eqn.
 Solving:  Stress period:     2    Time step:     1    Groundwater-Flow Eqn.
 Solving:  Stress period:     3    Time step:     1    Groundwater-Flow Eqn.
 Run end date and time (yyyy/mm/dd hh:mm:ss): 2019/09/12 10:36:05
 Elapsed run time:  0.124 Seconds

  Normal termination of simulation

You want some pilot points? We got that...how about one set of recharge multiplier pilot points applied to all stress periods? and sy in layer 1?


In [3]:
m.get_package_list()


Out[3]:
['DIS', 'BAS6', 'UPW', 'RCH', 'NWT', 'OC', 'LMT6', 'WEL', 'SFR']

Parameterization


In [4]:
pp_props = [["upw.sy",0], ["rch.rech",None]]

You want some constants (uniform value multipliers)? We got that too....


In [5]:
const_props = []
for iper in range(m.nper): # recharge for past and future
    const_props.append(["rch.rech",iper])
for k in range(m.nlay):
    const_props.append(["upw.hk",k])
    const_props.append(["upw.ss",k])

You want grid-scale parameter flexibility for hk in all layers? We got that too...and how about sy in layer 1 and vka in layer 2 while we are at it


In [6]:
grid_props = [["upw.sy",0],["upw.vka",1]]
for k in range(m.nlay):
    grid_props.append(["upw.hk",k])

Some people like using zones...so we have those too


In [7]:
zn_array = np.loadtxt(os.path.join("Freyberg_Truth","hk.zones"))
plt.imshow(zn_array)


Out[7]:
<matplotlib.image.AxesImage at 0x7fa4a020d0b8>

In [8]:
zone_props = [["upw.ss",0], ["rch.rech",0],["rch.rech",1]]
k_zone_dict = {k:zn_array for k in range(m.nlay)}

But wait, boundary conditions are uncertain too...Can we add some parameter to represent that uncertainty? You know it!


In [9]:
bc_props = []
for iper in range(m.nper):
    bc_props.append(["wel.flux",iper])

In [ ]:

Observations

Since observations are "free", we can carry lots of them around...


In [10]:
# here were are building a list of stress period, layer pairs (zero-based) that we will use
# to setup obserations from every active model cell for a given pair
hds_kperk = []
for iper in range(m.nper):
    for k in range(m.nlay):
        hds_kperk.append([iper,k])

Here it goes...

Now we will use all these args to construct a complete PEST interface - template files, instruction files, control file and even the forward run script! All parameters are setup as multiplers against the existing inputs in the modflow model - the existing inputs are extracted (with flopy) and saved in a sub directory for safe keep and for multiplying against during a forward model run. The constructor will also write a full (covariates included) prior parameter covariance matrix, which is needed for all sorts of important analyses.|


In [11]:
mfp_boss = pyemu.helpers.PstFromFlopyModel(nam_file,new_model_ws,org_model_ws=temp_model_ws,
                                          pp_props=pp_props,spatial_list_props=bc_props,
                                          zone_props=zone_props,grid_props=grid_props,
                                          const_props=const_props,k_zone_dict=k_zone_dict,
                                          remove_existing=True,pp_space=4,sfr_pars=True,
                                          sfr_obs=True,hds_kperk=hds_kperk)
EXE_DIR = os.path.join("..","bin")
if "window" in platform.platform().lower():
    EXE_DIR = os.path.join(EXE_DIR,"win")
elif "darwin" in platform.platform().lower():
    EXE_DIR = os.path.join(EXE_DIR,"mac")
else:
    EXE_DIR = os.path.join(EXE_DIR,"linux")

[shutil.copy2(os.path.join(EXE_DIR,f),os.path.join(new_model_ws,f)) for f in os.listdir(EXE_DIR)]


2019-09-12 10:36:09.082577 starting: loading flopy model

Creating new model with name: freyberg
--------------------------------------------------

Parsing the namefile --> temp/freyberg.nam

--------------------------------------------------
External unit dictionary:
{2: filename:temp/freyberg.list, filetype:LIST, 11: filename:temp/freyberg.dis, filetype:DIS, 13: filename:temp/freyberg.bas, filetype:BAS6, 31: filename:temp/freyberg.upw, filetype:UPW, 19: filename:temp/freyberg.rch, filetype:RCH, 32: filename:temp/freyberg.nwt, filetype:NWT, 14: filename:temp/freyberg.oc, filetype:OC, 30: filename:temp/freyberg.lmt6, filetype:LMT6, 20: filename:temp/freyberg.wel, filetype:WEL, 17: filename:temp/freyberg.sfr, filetype:SFR, 50: filename:temp/freyberg.cbc, filetype:DATA(BINARY), 51: filename:temp/freyberg.hds, filetype:DATA(BINARY), 60: filename:temp/freyberg.sfr.out, filetype:DATA}
--------------------------------------------------

ModflowBas6 free format:True

loading dis package file...
   Loading dis package with:
      3 layers, 40 rows, 20 columns, and 3 stress periods
   loading laycbd...
   loading delr...
   loading delc...
   loading top...
   loading botm...
      for 3 layers and 0 confining beds
   loading stress period data...
       for 3 stress periods
adding Package:  DIS
   DIS  package load...success
   LIST package load...skipped
loading bas6 package file...
adding Package:  BAS6
   BAS6 package load...success
loading upw package file...
   loading ipakcb, HDRY, NPUPW, IPHDRY...
   loading LAYTYP...
   loading LAYAVG...
   loading CHANI...
   loading LAYVKA...
   loading LAYWET...
   loading hk layer   1...
   loading vka layer   1...
   loading ss layer   1...
   loading hk layer   2...
   loading vka layer   2...
   loading ss layer   2...
   loading hk layer   3...
   loading vka layer   3...
   loading ss layer   3...
Adding freyberg.cbc (unit=50) to the output list.
adding Package:  UPW
   UPW  package load...success
loading rch package file...
   loading rech stress period   1...
   loading rech stress period   2...
   loading rech stress period   3...
adding Package:  RCH
   RCH  package load...success
loading nwt package file...
   did not generate dataset 1 kwargs
adding Package:  NWT
   NWT  package load...success
loading oc package file...
Adding freyberg.hds (unit=51) to the output list.
adding Package:  OC
   OC   package load...success
loading lmt package file...
adding Package:  LMT6
   LMT6 package load...success
loading wel package file...
   loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper     1
   loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper     2
   loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper     3
adding Package:  WEL
   WEL  package load...success
loading sfr2 package file...
Adding freyberg.sfr.out (unit=60) to the output list.
adding Package:  SFR
   SFR  package load...success
   DATA(BINARY) file load...skipped
      freyberg.cbc
   DATA(BINARY) file load...skipped
      freyberg.hds
   DATA file load...skipped
      freyberg.sfr.out
Warning: external file unit 0 does not exist in ext_unit_dict.

   The following 9 packages were successfully loaded.
      freyberg.dis
      freyberg.bas
      freyberg.upw
      freyberg.rch
      freyberg.nwt
      freyberg.oc
      freyberg.lmt6
      freyberg.wel
      freyberg.sfr
   The following 1 packages were not loaded.
      freyberg.list
2019-09-12 10:36:09.109993 finished: loading flopy model took: 0:00:00.027416
2019-09-12 10:36:09.110167 starting: updating model attributes
2019-09-12 10:36:09.110230 finished: updating model attributes took: 0:00:00.000063
2019-09-12 10:36:09.110455 WARNING: removing existing 'new_model_ws

creating model workspace...
   template

changing model workspace...
   template
2019-09-12 10:36:10.131259 starting: writing new modflow input files

Writing packages:
   Package:  DIS
Util2d:delr: resetting 'how' to external
Util2d:delc: resetting 'how' to external
Util2d:model_top: resetting 'how' to external
Util2d:botm_layer_0: resetting 'how' to external
Util2d:botm_layer_1: resetting 'how' to external
Util2d:botm_layer_2: resetting 'how' to external
   Package:  BAS6
Util2d:ibound_layer_0: resetting 'how' to external
Util2d:ibound_layer_1: resetting 'how' to external
Util2d:ibound_layer_2: resetting 'how' to external
Util2d:strt_layer_0: resetting 'how' to external
Util2d:strt_layer_1: resetting 'how' to external
Util2d:strt_layer_2: resetting 'how' to external
   Package:  UPW
Util2d:hk: resetting 'how' to external
Util2d:vka: resetting 'how' to external
Util2d:ss: resetting 'how' to external
Util2d:hk: resetting 'how' to external
Util2d:vka: resetting 'how' to external
Util2d:ss: resetting 'how' to external
Util2d:hk: resetting 'how' to external
Util2d:vka: resetting 'how' to external
Util2d:ss: resetting 'how' to external
   Package:  RCH
Util2d:rech_1: resetting 'how' to external
Util2d:rech_2: resetting 'how' to external
Util2d:rech_3: resetting 'how' to external
   Package:  NWT
   Package:  OC
   Package:  LMT6
   Package:  WEL
   Package:  SFR
 
2019-09-12 10:36:10.166745 finished: writing new modflow input files took: 0:00:00.035486
2019-09-12 10:36:10.167107 WARNING: using flopy binary to execute the model:freyberg.nam
2019-09-12 10:36:10.167151 forward_run line:pyemu.os_utils.run('mf2005 freyberg.nam 1>freyberg.nam.stdout 2>freyberg.nam.stderr')
2019-09-12 10:36:10.167357 starting: setting up 'template/arr_org' dir
2019-09-12 10:36:10.167581 finished: setting up 'template/arr_org' dir took: 0:00:00.000224
2019-09-12 10:36:10.167752 starting: setting up 'template/arr_mlt' dir
2019-09-12 10:36:10.167969 finished: setting up 'template/arr_mlt' dir took: 0:00:00.000217
2019-09-12 10:36:10.168027 starting: setting up 'template/list_org' dir
2019-09-12 10:36:10.168318 finished: setting up 'template/list_org' dir took: 0:00:00.000291
2019-09-12 10:36:10.168375 starting: setting up 'template/list_mlt' dir
2019-09-12 10:36:10.168801 finished: setting up 'template/list_mlt' dir took: 0:00:00.000426
2019-09-12 10:36:10.169101 starting: processing spatial_list_props
2019-09-12 10:36:10.223487 finished: processing spatial_list_props took: 0:00:00.054386
2019-09-12 10:36:10.246446 forward_run line:pyemu.helpers.apply_list_pars()

2019-09-12 10:36:10.338422 starting: writing grid tpl:sy1.dat_gr.tpl
2019-09-12 10:36:10.345364 finished: writing grid tpl:sy1.dat_gr.tpl took: 0:00:00.006942
2019-09-12 10:36:10.347592 starting: writing grid tpl:vka0.dat_gr.tpl
2019-09-12 10:36:10.354788 finished: writing grid tpl:vka0.dat_gr.tpl took: 0:00:00.007196
2019-09-12 10:36:10.357005 starting: writing grid tpl:hk0.dat_gr.tpl
2019-09-12 10:36:10.363513 finished: writing grid tpl:hk0.dat_gr.tpl took: 0:00:00.006508
2019-09-12 10:36:10.365612 starting: writing grid tpl:hk1.dat_gr.tpl
2019-09-12 10:36:10.371975 finished: writing grid tpl:hk1.dat_gr.tpl took: 0:00:00.006363
2019-09-12 10:36:10.374113 starting: writing grid tpl:hk2.dat_gr.tpl
2019-09-12 10:36:10.380856 finished: writing grid tpl:hk2.dat_gr.tpl took: 0:00:00.006743
2019-09-12 10:36:10.383142 starting: writing zone tpl:ss0.dat_zn.tpl
2019-09-12 10:36:10.385976 finished: writing zone tpl:ss0.dat_zn.tpl took: 0:00:00.002834
2019-09-12 10:36:10.388040 starting: writing zone tpl:rech1.dat_zn.tpl
2019-09-12 10:36:10.390801 finished: writing zone tpl:rech1.dat_zn.tpl took: 0:00:00.002761
2019-09-12 10:36:10.392823 starting: writing zone tpl:rech2.dat_zn.tpl
2019-09-12 10:36:10.395529 finished: writing zone tpl:rech2.dat_zn.tpl took: 0:00:00.002706
2019-09-12 10:36:10.397531 starting: writing const tpl:rech3.dat_cn.tpl
2019-09-12 10:36:10.401841 finished: writing const tpl:rech3.dat_cn.tpl took: 0:00:00.004310
2019-09-12 10:36:10.403864 starting: writing const tpl:rech4.dat_cn.tpl
2019-09-12 10:36:10.411134 finished: writing const tpl:rech4.dat_cn.tpl took: 0:00:00.007270
2019-09-12 10:36:10.413974 starting: writing const tpl:rech5.dat_cn.tpl
2019-09-12 10:36:10.418736 finished: writing const tpl:rech5.dat_cn.tpl took: 0:00:00.004762
2019-09-12 10:36:10.421088 starting: writing const tpl:hk3.dat_cn.tpl
2019-09-12 10:36:10.425252 finished: writing const tpl:hk3.dat_cn.tpl took: 0:00:00.004164
2019-09-12 10:36:10.427535 starting: writing const tpl:ss1.dat_cn.tpl
2019-09-12 10:36:10.431589 finished: writing const tpl:ss1.dat_cn.tpl took: 0:00:00.004054
2019-09-12 10:36:10.433763 starting: writing const tpl:hk4.dat_cn.tpl
2019-09-12 10:36:10.437655 finished: writing const tpl:hk4.dat_cn.tpl took: 0:00:00.003892
2019-09-12 10:36:10.439850 starting: writing const tpl:ss2.dat_cn.tpl
2019-09-12 10:36:10.443880 finished: writing const tpl:ss2.dat_cn.tpl took: 0:00:00.004030
2019-09-12 10:36:10.446449 starting: writing const tpl:hk5.dat_cn.tpl
2019-09-12 10:36:10.450998 finished: writing const tpl:hk5.dat_cn.tpl took: 0:00:00.004549
2019-09-12 10:36:10.453392 starting: writing const tpl:ss3.dat_cn.tpl
2019-09-12 10:36:10.457852 finished: writing const tpl:ss3.dat_cn.tpl took: 0:00:00.004460
2019-09-12 10:36:10.467701 starting: setting up pilot point process
2019-09-12 10:36:10.467928 WARNING: pp_geostruct is None, using ExpVario with contribution=1 and a=(pp_space*max(delr,delc))
2019-09-12 10:36:10.469587 pp_dict: {0: ['rech0', 'sy0']}
2019-09-12 10:36:10.469886 starting: calling setup_pilot_point_grid()
2019-09-12 10:36:10.470558 WARNING: resetting negative ibound values for PP zonearray in layer 1 : 1
2019-09-12 10:36:10.470680 WARNING: resetting negative ibound values for PP zonearray in layer 2 : 1
2019-09-12 10:36:10.470920 WARNING: resetting negative ibound values for PP zonearray in layer 3 : 1
2019-09-12 10:36:10.564357 64 pilot point parameters created
2019-09-12 10:36:10.564610 pilot point 'pargp':rech0,sy0
2019-09-12 10:36:10.564645 finished: calling setup_pilot_point_grid() took: 0:00:00.094759
2019-09-12 10:36:10.566021 starting: calculating factors for p=rech0, k=0
2019-09-12 10:36:10.566691 saving krige variance file:template/pp_k0_general_zn.fac
2019-09-12 10:36:10.567475 saving krige factors file:template/pp_k0_general_zn.fac
starting interp point loop for 800 points
starting 0
starting 1
starting 2
starting 3
starting 4
starting 5
starting 6
starting 7
starting 8
starting 9
took 0.729361 seconds
2019-09-12 10:36:11.336186 finished: calculating factors for p=rech0, k=0 took: 0:00:00.770165
2019-09-12 10:36:11.337656 starting: calculating factors for p=sy0, k=0
2019-09-12 10:36:11.338668 finished: calculating factors for p=sy0, k=0 took: 0:00:00.001012
2019-09-12 10:36:11.338947 starting: processing pp_prefix:rech0
2019-09-12 10:36:11.346301 starting: processing pp_prefix:sy0
2019-09-12 10:36:11.364730 finished: setting up pilot point process took: 0:00:00.897029
2019-09-12 10:36:11.364990 starting: setting up grid process
2019-09-12 10:36:11.365040 WARNING: grid_geostruct is None, using ExpVario with contribution=1 and a=(max(delc,delr)*10
2019-09-12 10:36:11.365168 finished: setting up grid process took: 0:00:00.000178
2019-09-12 10:36:11.366460 starting: save test mlt array arr_mlt/sy0.dat_pp
2019-09-12 10:36:11.367242 finished: save test mlt array arr_mlt/sy0.dat_pp took: 0:00:00.000782
2019-09-12 10:36:11.367940 starting: save test mlt array arr_mlt/rech0.dat_pp
2019-09-12 10:36:11.368643 finished: save test mlt array arr_mlt/rech0.dat_pp took: 0:00:00.000703
2019-09-12 10:36:11.369213 starting: save test mlt array arr_mlt/sy1.dat_gr
2019-09-12 10:36:11.369902 finished: save test mlt array arr_mlt/sy1.dat_gr took: 0:00:00.000689
2019-09-12 10:36:11.370641 starting: save test mlt array arr_mlt/vka0.dat_gr
2019-09-12 10:36:11.371370 finished: save test mlt array arr_mlt/vka0.dat_gr took: 0:00:00.000729
2019-09-12 10:36:11.371863 starting: save test mlt array arr_mlt/hk0.dat_gr
2019-09-12 10:36:11.372613 finished: save test mlt array arr_mlt/hk0.dat_gr took: 0:00:00.000750
2019-09-12 10:36:11.373336 starting: save test mlt array arr_mlt/hk1.dat_gr
2019-09-12 10:36:11.374032 finished: save test mlt array arr_mlt/hk1.dat_gr took: 0:00:00.000696
2019-09-12 10:36:11.374526 starting: save test mlt array arr_mlt/hk2.dat_gr
2019-09-12 10:36:11.375277 finished: save test mlt array arr_mlt/hk2.dat_gr took: 0:00:00.000751
2019-09-12 10:36:11.375879 starting: save test mlt array arr_mlt/ss0.dat_zn
2019-09-12 10:36:11.376617 finished: save test mlt array arr_mlt/ss0.dat_zn took: 0:00:00.000738
2019-09-12 10:36:11.377313 starting: save test mlt array arr_mlt/rech1.dat_zn
2019-09-12 10:36:11.378051 finished: save test mlt array arr_mlt/rech1.dat_zn took: 0:00:00.000738
2019-09-12 10:36:11.378564 starting: save test mlt array arr_mlt/rech2.dat_zn
2019-09-12 10:36:11.379324 finished: save test mlt array arr_mlt/rech2.dat_zn took: 0:00:00.000760
2019-09-12 10:36:11.379920 starting: save test mlt array arr_mlt/rech3.dat_cn
2019-09-12 10:36:11.380695 finished: save test mlt array arr_mlt/rech3.dat_cn took: 0:00:00.000775
2019-09-12 10:36:11.381204 starting: save test mlt array arr_mlt/rech4.dat_cn
2019-09-12 10:36:11.381986 finished: save test mlt array arr_mlt/rech4.dat_cn took: 0:00:00.000782
2019-09-12 10:36:11.382570 starting: save test mlt array arr_mlt/rech5.dat_cn
2019-09-12 10:36:11.383285 finished: save test mlt array arr_mlt/rech5.dat_cn took: 0:00:00.000715
2019-09-12 10:36:11.383895 starting: save test mlt array arr_mlt/hk3.dat_cn
2019-09-12 10:36:11.384650 finished: save test mlt array arr_mlt/hk3.dat_cn took: 0:00:00.000755
2019-09-12 10:36:11.385251 starting: save test mlt array arr_mlt/ss1.dat_cn
2019-09-12 10:36:11.385960 finished: save test mlt array arr_mlt/ss1.dat_cn took: 0:00:00.000709
2019-09-12 10:36:11.386553 starting: save test mlt array arr_mlt/hk4.dat_cn
2019-09-12 10:36:11.387260 finished: save test mlt array arr_mlt/hk4.dat_cn took: 0:00:00.000707
2019-09-12 10:36:11.387768 starting: save test mlt array arr_mlt/ss2.dat_cn
2019-09-12 10:36:11.388636 finished: save test mlt array arr_mlt/ss2.dat_cn took: 0:00:00.000868
2019-09-12 10:36:11.389276 starting: save test mlt array arr_mlt/hk5.dat_cn
2019-09-12 10:36:11.390220 finished: save test mlt array arr_mlt/hk5.dat_cn took: 0:00:00.000944
2019-09-12 10:36:11.390871 starting: save test mlt array arr_mlt/ss3.dat_cn
2019-09-12 10:36:11.391588 finished: save test mlt array arr_mlt/ss3.dat_cn took: 0:00:00.000717
2019-09-12 10:36:11.492699 forward_run line:pyemu.helpers.apply_array_pars()

flow
all zeros for flow...skipping...
runoff
all zeros for runoff...skipping...
hcond1
pptsw
all zeros for pptsw...skipping...
2019-09-12 10:36:11.529934 starting: processing obs type mflist water budget obs
2019-09-12 10:36:11.565370 forward_run line:pyemu.gw_utils.apply_mflist_budget_obs('freyberg.list',flx_filename='flux.dat',vol_filename='vol.dat',start_datetime='1-1-1970')
2019-09-12 10:36:11.565438 finished: processing obs type mflist water budget obs took: 0:00:00.035504
2019-09-12 10:36:11.565496 starting: processing obs type hyd file
2019-09-12 10:36:11.565756 finished: processing obs type hyd file took: 0:00:00.000260
2019-09-12 10:36:11.565797 starting: processing obs type external obs-sim smp files
2019-09-12 10:36:11.565985 finished: processing obs type external obs-sim smp files took: 0:00:00.000188
2019-09-12 10:36:11.566026 starting: processing obs type hob
2019-09-12 10:36:11.566206 finished: processing obs type hob took: 0:00:00.000180
2019-09-12 10:36:11.566331 starting: processing obs type hds
[[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2]]
2019-09-12 10:36:11.957924 finished: processing obs type hds took: 0:00:00.391593
2019-09-12 10:36:11.958003 starting: processing obs type sfr
writing 'sfr_obs.config' to template/sfr_obs.config
2019-09-12 10:36:12.079780 finished: processing obs type sfr took: 0:00:00.121777
2019-09-12 10:36:12.079845 changing dir in to template
2019-09-12 10:36:12.080176 starting: instantiating control file from i/o files
2019-09-12 10:36:12.080224 tpl files: wel.csv.tpl,sy1.dat_gr.tpl,vka0.dat_gr.tpl,hk0.dat_gr.tpl,hk1.dat_gr.tpl,hk2.dat_gr.tpl,ss0.dat_zn.tpl,rech1.dat_zn.tpl,rech2.dat_zn.tpl,rech3.dat_cn.tpl,rech4.dat_cn.tpl,rech5.dat_cn.tpl,hk3.dat_cn.tpl,ss1.dat_cn.tpl,hk4.dat_cn.tpl,ss2.dat_cn.tpl,hk5.dat_cn.tpl,ss3.dat_cn.tpl,sfr_seg_pars.dat.tpl,sy0pp.dat.tpl,rech0pp.dat.tpl
2019-09-12 10:36:12.080370 ins files: freyberg.hds.dat.ins,vol.dat.ins,freyberg.sfr.out.processed.ins,flux.dat.ins
2019-09-12 10:36:12.199564 finished: instantiating control file from i/o files took: 0:00:00.119388
2019-09-12 10:36:12.285442 starting: writing forward_run.py
2019-09-12 10:36:12.285797 finished: writing forward_run.py took: 0:00:00.000355
2019-09-12 10:36:12.286091 writing pst template/freyberg.pst
noptmax:0, npar_adj:3612, nnz_obs:6633
2019-09-12 10:36:12.740972 starting: running pestchek on freyberg.pst
2019-09-12 10:36:12.818834 WARNING: error running pestchek:run() returned non-zero: 100
2019-09-12 10:36:12.819111 pestcheck:PESTCHEK Version 13.0. Watermark Numerical Computing.
2019-09-12 10:36:12.819154 pestcheck:
2019-09-12 10:36:12.819353 pestcheck:Errors ----->
2019-09-12 10:36:12.819392 pestcheck:Line 38 of file freyberg.pst: parameter name "const_hk3__cn" greater than 12
2019-09-12 10:36:12.819411 pestcheck:characters long.
2019-09-12 10:36:12.819430 pestcheck:Line 39 of file freyberg.pst: parameter name "const_hk4__cn" greater than 12
2019-09-12 10:36:12.819458 pestcheck:characters long.
2019-09-12 10:36:12.819493 pestcheck:Line 40 of file freyberg.pst: parameter name "const_hk5__cn" greater than 12
2019-09-12 10:36:12.819517 pestcheck:characters long.
2019-09-12 10:36:12.819532 pestcheck:Line 41 of file freyberg.pst: parameter name "const_rech3__cn" greater than
2019-09-12 10:36:12.819549 pestcheck:12 characters long.
2019-09-12 10:36:12.819564 pestcheck:Line 42 of file freyberg.pst: parameter name "const_rech4__cn" greater than
2019-09-12 10:36:12.820039 pestcheck:12 characters long.
2019-09-12 10:36:12.820078 pestcheck:Line 43 of file freyberg.pst: parameter name "const_rech5__cn" greater than
2019-09-12 10:36:12.820218 pestcheck:12 characters long.
2019-09-12 10:36:12.820261 pestcheck:Line 44 of file freyberg.pst: parameter name "const_ss1__cn" greater than 12
2019-09-12 10:36:12.820417 pestcheck:characters long.
2019-09-12 10:36:12.820440 pestcheck:Line 45 of file freyberg.pst: parameter name "const_ss2__cn" greater than 12
2019-09-12 10:36:12.820659 pestcheck:characters long.
2019-09-12 10:36:12.820681 pestcheck:Line 46 of file freyberg.pst: parameter name "const_ss3__cn" greater than 12
2019-09-12 10:36:12.820696 pestcheck:characters long.
2019-09-12 10:36:12.820722 pestcheck:Line 2204 of file freyberg.pst: parameter name "rech1_zone:1.0__zn" greater
2019-09-12 10:36:12.820740 pestcheck:than 12 characters long.
2019-09-12 10:36:12.820755 pestcheck:Line 2205 of file freyberg.pst: parameter name "rech1_zone:2.0__zn" greater
2019-09-12 10:36:12.821090 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821112 pestcheck:Line 2206 of file freyberg.pst: parameter name "rech1_zone:3.0__zn" greater
2019-09-12 10:36:12.821264 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821285 pestcheck:Line 2207 of file freyberg.pst: parameter name "rech1_zone:4.0__zn" greater
2019-09-12 10:36:12.821300 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821315 pestcheck:Line 2208 of file freyberg.pst: parameter name "rech1_zone:5.0__zn" greater
2019-09-12 10:36:12.821558 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821582 pestcheck:Line 2209 of file freyberg.pst: parameter name "rech1_zone:6.0__zn" greater
2019-09-12 10:36:12.821597 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821611 pestcheck:Line 2210 of file freyberg.pst: parameter name "rech2_zone:1.0__zn" greater
2019-09-12 10:36:12.821848 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821869 pestcheck:Line 2211 of file freyberg.pst: parameter name "rech2_zone:2.0__zn" greater
2019-09-12 10:36:12.821884 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821898 pestcheck:Line 2212 of file freyberg.pst: parameter name "rech2_zone:3.0__zn" greater
2019-09-12 10:36:12.821913 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821930 pestcheck:Line 2213 of file freyberg.pst: parameter name "rech2_zone:4.0__zn" greater
2019-09-12 10:36:12.821945 pestcheck:than 12 characters long.
2019-09-12 10:36:12.821960 pestcheck:Line 2214 of file freyberg.pst: parameter name "rech2_zone:5.0__zn" greater
2019-09-12 10:36:12.822371 pestcheck:than 12 characters long.
2019-09-12 10:36:12.822391 pestcheck:Line 2215 of file freyberg.pst: parameter name "rech2_zone:6.0__zn" greater
2019-09-12 10:36:12.822406 pestcheck:than 12 characters long.
2019-09-12 10:36:12.822607 pestcheck:Line 2216 of file freyberg.pst: parameter name "ss0_zone:1.0__zn" greater
2019-09-12 10:36:12.822628 pestcheck:than 12 characters long.
2019-09-12 10:36:12.822643 pestcheck:Line 2217 of file freyberg.pst: parameter name "ss0_zone:2.0__zn" greater
2019-09-12 10:36:12.822657 pestcheck:than 12 characters long.
2019-09-12 10:36:12.822798 pestcheck:Line 2218 of file freyberg.pst: parameter name "ss0_zone:3.0__zn" greater
2019-09-12 10:36:12.822817 pestcheck:than 12 characters long.
2019-09-12 10:36:12.822835 pestcheck:Line 2219 of file freyberg.pst: parameter name "ss0_zone:4.0__zn" greater
2019-09-12 10:36:12.822850 pestcheck:than 12 characters long.
2019-09-12 10:36:12.823181 pestcheck:Line 2220 of file freyberg.pst: parameter name "ss0_zone:5.0__zn" greater
2019-09-12 10:36:12.823212 pestcheck:than 12 characters long.
2019-09-12 10:36:12.823229 pestcheck:Line 2221 of file freyberg.pst: parameter name "ss0_zone:6.0__zn" greater
2019-09-12 10:36:12.823426 pestcheck:than 12 characters long.
2019-09-12 10:36:12.823487 finished: running pestchek on freyberg.pst took: 0:00:00.082515
2019-09-12 10:36:12.823663 starting: building prior covariance matrix
2019-09-12 10:36:12.836906 WARNING: geospatial prior not implemented for SFR pars
2019-09-12 10:36:13.669704 saving prior covariance matrix to file template/freyberg.pst.prior.cov
2019-09-12 10:36:16.803405 finished: building prior covariance matrix took: 0:00:03.979742
2019-09-12 10:36:16.803637 starting: saving intermediate _setup_<> dfs into template
2019-09-12 10:36:16.871592 finished: saving intermediate _setup_<> dfs into template took: 0:00:00.067955
2019-09-12 10:36:16.872081 all done
Out[11]:
['template/ascii2pbin',
 'template/pbin2ascii',
 'template/pbin_dump',
 'template/pestpp-opt',
 'template/.DS_Store',
 'template/pestpp-pso',
 'template/pestpp-sen',
 'template/pestpp-glm',
 'template/mfnwt',
 'template/pestpp-ies',
 'template/mt3dusgs',
 'template/pestpp-swp']

The mpf_boss instance containts a pyemu.Pst object (its already been saved to a file, but you may want to manipulate it more)


In [12]:
pst = mfp_boss.pst

In [13]:
pst.npar,pst.nobs


Out[13]:
(3612, 6633)

That was crazy easy - this used to take me weeks to get a PEST interface setup with level of complexity


In [14]:
pst.template_files


Out[14]:
['wel.csv.tpl',
 'sy1.dat_gr.tpl',
 'vka0.dat_gr.tpl',
 'hk0.dat_gr.tpl',
 'hk1.dat_gr.tpl',
 'hk2.dat_gr.tpl',
 'ss0.dat_zn.tpl',
 'rech1.dat_zn.tpl',
 'rech2.dat_zn.tpl',
 'rech3.dat_cn.tpl',
 'rech4.dat_cn.tpl',
 'rech5.dat_cn.tpl',
 'hk3.dat_cn.tpl',
 'ss1.dat_cn.tpl',
 'hk4.dat_cn.tpl',
 'ss2.dat_cn.tpl',
 'hk5.dat_cn.tpl',
 'ss3.dat_cn.tpl',
 'sfr_seg_pars.dat.tpl',
 'sy0pp.dat.tpl',
 'rech0pp.dat.tpl']

In [15]:
pst.instruction_files


Out[15]:
['freyberg.hds.dat.ins',
 'vol.dat.ins',
 'freyberg.sfr.out.processed.ins',
 'flux.dat.ins']

Lets look at that important prior covariance matrix


In [16]:
cov = pyemu.Cov.from_ascii(os.path.join(new_model_ws,m.name+".pst.prior.cov"))

In [17]:
cov = cov.x
cov[cov==0] = np.NaN
plt.imshow(cov)


Out[17]:
<matplotlib.image.AxesImage at 0x7fa4806eab70>

adjusting parameter bounds

Let's say you don't like the parameter bounds in the new control file (note you can pass a par_bounds arg to the constructor).


In [18]:
pst.parameter_data


Out[18]:
parnme partrans parchglim parval1 parlbnd parubnd pargp scale offset dercom
const_hk3__cn const_hk3__cn log factor 1.0 0.10 10.0 cn_hk3 1.0 0.0 1
const_hk4__cn const_hk4__cn log factor 1.0 0.10 10.0 cn_hk4 1.0 0.0 1
const_hk5__cn const_hk5__cn log factor 1.0 0.10 10.0 cn_hk5 1.0 0.0 1
const_rech3__cn const_rech3__cn log factor 1.0 0.10 10.0 cn_rech3 1.0 0.0 1
const_rech4__cn const_rech4__cn log factor 1.0 0.10 10.0 cn_rech4 1.0 0.0 1
const_rech5__cn const_rech5__cn log factor 1.0 0.10 10.0 cn_rech5 1.0 0.0 1
const_ss1__cn const_ss1__cn log factor 1.0 0.10 10.0 cn_ss1 1.0 0.0 1
const_ss2__cn const_ss2__cn log factor 1.0 0.10 10.0 cn_ss2 1.0 0.0 1
const_ss3__cn const_ss3__cn log factor 1.0 0.10 10.0 cn_ss3 1.0 0.0 1
hcond1_0001 hcond1_0001 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0002 hcond1_0002 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0003 hcond1_0003 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0004 hcond1_0004 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0005 hcond1_0005 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0006 hcond1_0006 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0007 hcond1_0007 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0008 hcond1_0008 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0009 hcond1_0009 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0010 hcond1_0010 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0011 hcond1_0011 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0012 hcond1_0012 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0013 hcond1_0013 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0014 hcond1_0014 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0015 hcond1_0015 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0016 hcond1_0016 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0017 hcond1_0017 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0018 hcond1_0018 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0019 hcond1_0019 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0020 hcond1_0020 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0021 hcond1_0021 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
... ... ... ... ... ... ... ... ... ... ...
vka0037006 vka0037006 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037007 vka0037007 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037008 vka0037008 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037009 vka0037009 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037010 vka0037010 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037011 vka0037011 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037012 vka0037012 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037013 vka0037013 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037014 vka0037014 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037015 vka0037015 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037016 vka0037016 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037017 vka0037017 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038005 vka0038005 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038006 vka0038006 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038007 vka0038007 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038008 vka0038008 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038009 vka0038009 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038010 vka0038010 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038011 vka0038011 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038012 vka0038012 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038013 vka0038013 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038014 vka0038014 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038015 vka0038015 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038016 vka0038016 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
wf0200090016 wf0200090016 log factor 1.0 0.10 10.0 welflux_k02 1.0 0.0 1
wf0200110013 wf0200110013 log factor 1.0 0.10 10.0 welflux_k02 1.0 0.0 1
wf0200200014 wf0200200014 log factor 1.0 0.10 10.0 welflux_k02 1.0 0.0 1
wf0200260010 wf0200260010 log factor 1.0 0.10 10.0 welflux_k02 1.0 0.0 1
wf0200290006 wf0200290006 log factor 1.0 0.10 10.0 welflux_k02 1.0 0.0 1
wf0200340012 wf0200340012 log factor 1.0 0.10 10.0 welflux_k02 1.0 0.0 1

3612 rows × 10 columns

Let's change the welflux pars


In [19]:
par = pst.parameter_data #get a ref to the parameter data dataframe
wpars = par.pargp=="welflux_k02"
par.loc[wpars]


Out[19]:
parnme partrans parchglim parval1 parlbnd parubnd pargp scale offset dercom
wf0200090016 wf0200090016 log factor 1.0 0.1 10.0 welflux_k02 1.0 0.0 1
wf0200110013 wf0200110013 log factor 1.0 0.1 10.0 welflux_k02 1.0 0.0 1
wf0200200014 wf0200200014 log factor 1.0 0.1 10.0 welflux_k02 1.0 0.0 1
wf0200260010 wf0200260010 log factor 1.0 0.1 10.0 welflux_k02 1.0 0.0 1
wf0200290006 wf0200290006 log factor 1.0 0.1 10.0 welflux_k02 1.0 0.0 1
wf0200340012 wf0200340012 log factor 1.0 0.1 10.0 welflux_k02 1.0 0.0 1

In [20]:
par.loc[wpars,"parubnd"] = 1.1
par.loc[wpars,"parlbnd"] = 0.9
pst.parameter_data


Out[20]:
parnme partrans parchglim parval1 parlbnd parubnd pargp scale offset dercom
const_hk3__cn const_hk3__cn log factor 1.0 0.10 10.0 cn_hk3 1.0 0.0 1
const_hk4__cn const_hk4__cn log factor 1.0 0.10 10.0 cn_hk4 1.0 0.0 1
const_hk5__cn const_hk5__cn log factor 1.0 0.10 10.0 cn_hk5 1.0 0.0 1
const_rech3__cn const_rech3__cn log factor 1.0 0.10 10.0 cn_rech3 1.0 0.0 1
const_rech4__cn const_rech4__cn log factor 1.0 0.10 10.0 cn_rech4 1.0 0.0 1
const_rech5__cn const_rech5__cn log factor 1.0 0.10 10.0 cn_rech5 1.0 0.0 1
const_ss1__cn const_ss1__cn log factor 1.0 0.10 10.0 cn_ss1 1.0 0.0 1
const_ss2__cn const_ss2__cn log factor 1.0 0.10 10.0 cn_ss2 1.0 0.0 1
const_ss3__cn const_ss3__cn log factor 1.0 0.10 10.0 cn_ss3 1.0 0.0 1
hcond1_0001 hcond1_0001 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0002 hcond1_0002 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0003 hcond1_0003 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0004 hcond1_0004 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0005 hcond1_0005 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0006 hcond1_0006 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0007 hcond1_0007 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0008 hcond1_0008 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0009 hcond1_0009 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0010 hcond1_0010 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0011 hcond1_0011 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0012 hcond1_0012 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0013 hcond1_0013 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0014 hcond1_0014 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0015 hcond1_0015 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0016 hcond1_0016 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0017 hcond1_0017 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0018 hcond1_0018 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0019 hcond1_0019 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0020 hcond1_0020 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
hcond1_0021 hcond1_0021 log factor 1.0 0.01 100.0 hcond1 1.0 0.0 1
... ... ... ... ... ... ... ... ... ... ...
vka0037006 vka0037006 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037007 vka0037007 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037008 vka0037008 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037009 vka0037009 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037010 vka0037010 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037011 vka0037011 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037012 vka0037012 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037013 vka0037013 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037014 vka0037014 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037015 vka0037015 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037016 vka0037016 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0037017 vka0037017 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038005 vka0038005 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038006 vka0038006 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038007 vka0038007 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038008 vka0038008 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038009 vka0038009 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038010 vka0038010 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038011 vka0038011 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038012 vka0038012 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038013 vka0038013 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038014 vka0038014 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038015 vka0038015 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
vka0038016 vka0038016 log factor 1.0 0.10 10.0 gr_vka0 1.0 0.0 1
wf0200090016 wf0200090016 log factor 1.0 0.90 1.1 welflux_k02 1.0 0.0 1
wf0200110013 wf0200110013 log factor 1.0 0.90 1.1 welflux_k02 1.0 0.0 1
wf0200200014 wf0200200014 log factor 1.0 0.90 1.1 welflux_k02 1.0 0.0 1
wf0200260010 wf0200260010 log factor 1.0 0.90 1.1 welflux_k02 1.0 0.0 1
wf0200290006 wf0200290006 log factor 1.0 0.90 1.1 welflux_k02 1.0 0.0 1
wf0200340012 wf0200340012 log factor 1.0 0.90 1.1 welflux_k02 1.0 0.0 1

3612 rows × 10 columns


In [21]:
# now we need to rebuild the prior parameter covariance matrix
cov = mfp_boss.build_prior()


2019-09-12 10:36:21.707451 starting: building prior covariance matrix
2019-09-12 10:36:21.722928 WARNING: geospatial prior not implemented for SFR pars
2019-09-12 10:36:22.518799 saving prior covariance matrix to file template/freyberg.pst.prior.cov
2019-09-12 10:36:25.570656 finished: building prior covariance matrix took: 0:00:03.863205

Boom!


In [23]:
x = cov.x
x[x==0.0] = np.NaN
plt.imshow(x)


Out[23]:
<matplotlib.image.AxesImage at 0x7fa4a02ea3c8>

In [ ]: