iwfm.calibΒΆ

Classes, methods and functions for interactions between IWFM model calibration.

Modules

bias_calc(predictions, targets)

Return the Bias between measured (targets) and simulated (predictions) values.

calib

Typer subapp for IWFM calibration utilities.

calib_stats

Read a PEST .smp file, IWFM groundwater hydrograph file, and IWFM groundwater.dat file, and print a text file with the RMSE and bias of each well and of all observations.

compare(list1, list2)

Return two lists.

divshort2obs(budget_file, reach_file[, nwidth])

Convert diversion shortages from IWFM Stream Budget to the SMP file format for use by PEST.

do_avgonly(smp_in, ins_lines, pcf_lines)

Replace each node's observation columns with their row-wise average.

fac2iwfm(pp_file_name, param_file_name, ...)

Transfer parameter values from pilot points to model nodes from fac2reali.f90 by M Tonkin.

find_nearest_index(array, value)

Find the index of the value in the first column of the array that is closest to the given value.

get_hyd_fname(ftype, file_dict[, debug])

Return the hydrograph file name.

get_hyd_info(ftype, file_dict[, model_dir])

Unpack control variables from file_dict for one hydrograph type.

get_hyd_names(ftype, file_dict[, verbose])

Return hydrograph names.

get_obs_hyd(obs_file, start_date)

Read an observation sample bore (smp) file, and return a list of observation sites and a list of observation data as [site_id, days since start, date as datetime object].

get_sim_hyd(nt, file_name, start_date)

Get simulated hydrograph values and return as a list of lists with row=timestep, 1st col=dates and remaining cols=sites, dates as datetime objects, everything else as numpy arrays of floats.

headdiff_hyds(hdiff_pairs, hdiff_data, ...)

Calculate vertical head differences and write them to a sample bore (smp) file.

headdiff_read(headdiff_file)

Read the file with paired locations for calculation of vertical head differences and the observation ID of the head difference.

hyds_missed(sim_sites, obs_sites)

Compare lists of sites and return the sites from each list that are not in the other list.

idw(x, y, elem, nnodes, nlayers, nodexy, ...)

Interpolate per-layer nodal values to the point (x, y) using inverse distance weighting over the nodes of the element containing the point.

interp_val(obs_date, early_date, early_val, ...)

Return the simulated value that corresponds to the observation date.

iwfm2obs([verbose, head_divisor])

Interpolate model output to match the times and locations of calibration observations and put them into a PEST-compatible smp-formatted output file.

iwfm_exe_time([infile, outfile])

Extract the simulation time from SimulationMessages.out and write to a file as the number of seconds to execute the model.

krige(A, B)

Perform spatial interpolation using kriging factors from grid A to grid B.

ltbud(budget_file, output_file[, ...])

Read an IWFM Budget-format output file and log-transform the values.

ltsmp(input_file, output_file[, ...])

Read a PEST SMP-format file, log-transform the observation values, and write to a SMP-format file.

obs_smp(obs_lines, sim_sites)

Return observation bore sample info for sites in sim_sites.

par2iwfm(A, B)

Implement krige function to create new parameter values.

params2gw

Read parameter values for model from an IWFM overwrite file and write them to an IWFM Groundwater file.

pest_res_stats(pest_res_file[, verbose])

Read a PEST .res file, and print a text file with the RMSE and bias of each observation site.

ppk2fac

Use inverse-distance weighting to calculate factors to translate parameter values from pilot points to model nodes, and write to a file for use by PEST.

ppk2fac_trans(factors_file, trans_file, out_file)

Convert the ppk2fac file to the fac2fac file.

read_gw_file

Read an IWFM Groundwater file and return the number of nodes, the scaling factors, and the parameter values.

read_obs_wells(gw_file)

Read observation well information from the Groundwater.dat file and return a dictionary of groundwater hydrograph info and gwhyd_sim columns.

read_overwrite_file(overwrite_file, nnodes, ...)

Open and read an IWFM-2015 overwrite file or overwrite template file, and return the number of nodes, the scaling factors, and the parameter values.

read_settings([in_file])

Subroutine read_settings reads the settings.fig file located in the current directory.

real2iwfm([verbose])

Read pilot point parameters and write to IWFM Overwrite.dat file.

res_stats(pest_smp_file, gwhyd_info_file, ...)

Read a PEST .smp file, IWFM groundwater hydrograph file, and IWFM groundwater.dat file, and print a text file with the RMSE and bias of each well and of all observations.

rmse_calc(predictions, targets)

Return the RMSE between measured (targets) and simulated (predictions) values.

setrot(ang1, ang2, ang3, anis1, anis2)

Set up the matrix to transform cartesian coordinates to coordinates accounting for angles and anisotropy (from setrot() by C.

sim_4_sites(sim_data, obs_sites)

Select simulated values at sites with observed values, and return an array of simulated values for these sites and a corresponding list of dates for the simulated values.

sim_equiv(simhyd, date, simhyd_col[, ...])

Calculate the simulated value for a given date from a simulated hydrograph.

sim_obs_list

Calculate simulated equivalents for observations and difference between them.

sim_smp(smp_list)

Process text lines from a sample bore (smp) file (smp_list) into observation data sets of [site_id, datetime object, observed value].

simout2gw(simout_file, gw_in_file, output_file)

Read groundwater parameters from SimulationMessages.out file, replace parameters in template groundwater.dat file, and write to a new groundwater.dat file.

smp_avg(smp_file[, verbose])

Read an smp file and average the observations values for each observation ID.

smp_format

Read an smp file and reformat.

smp_read(smp_file_name)

Read observed values smp file into list of lists obs.

stacdep2obs(budget_file, reach_file[, nwidth])

Convert stream-groundwater flows from IWFM Stream Budget to the SMP file format for use by PEST.

to_smp_ins(obs_site, obs_dt, obs_val, ts)

Write smp and ins file lines for one observation.

well_pairs_2_obs_list(well_pair_file, obs_file)

Read a file of paired observation well locations for groundwater head differences and a file of head observations.

write_missing(missing, obs_file[, fname, ...])

Take a list of observation IDs and filename obs_file, and write them to an output files (default output file name missing.tmp).

write_overwrite_file(overwrite_file, ...[, ...])

Receive a list of parameters and write them to an IWFM-2015 overwrite file.

write_results(name, date, meas, sim, start_date)

Write simulated and observed values for one observation well to a text file.

write_rmse_bias(output_filename, well_dict, ...)

Write the RMSE and Bias values plus well info (name,x,y,layer) for all observation wells to a text file.