PEST_utilities Module
a m!ke@usgs joint
contact: mnfienen@usgs.gov

Several Utilties are included
#######################
# beopest_launcher.py #
#######################
Options for this code (specified in the XML file) are to:
1) make a user-specified number of worker subfolders
2) start a master 
3) start the user-specified number of workers in their subfolders.

Pretty bare-bones....


####################
# PriorStripper.py #
####################
Simple code to remove prior information for all fixed parameters.
This is key when, for example, using pilot points with regularization
and need to fix some (PEST doesn't accept prior information for 
fixed parameters).
This code reads in a PST file (user sets input and output filenames
near the top of the code) and identifies all parameters that are 'fixed'.
For all fizxed parameters, prior information is deleted. The output file 
is a new version of the PST file with counter updated and appropriate 
prior information removed.

#################
# RMR_RIPPER.py #
#################
This is a simple program that returns some of the statistics on 
which machines ran which jobs on an HTCondor + beoPEST set of runs.

depends on an up-to-date version of name_IP_lookup.dat

Also must update the RMR filename in the code for now.

################
# recRipper.py #
################
This code parses a REC file from PEST and puts out
files to investigate the evolution of PHI over iterations.

The two output files are: basename.rec_tphi, which is to 
show total phi over iterations, and
basename.recout, which shows PHI components in the form that
can be used with Google plotting for "bubble charts".
Bubble Charts are also called Google Motion Charts:
http://code.google.com/apis/visualization/documentation/gallery/motionchart.html

################
# plot_bpas.py #
################
This code plots parameter values for each value over iterations in the
<basecase>.bpa.# files. The <basecase>.bpa file is ignored.

Output is <basecase>_parvalues.pdf with a page for each parameter.

###############################################
# plot_reis.py --> driving REIripperCONSOL.py #
###############################################
This code plots bar charts and one-to-one plots of residuals as recorded in
<basecase>.rei.# files. For each file, residuals are plotted by group
(including regularization groups which can, generally, be ignored).

Output files are:
<basecase><group>one2one.pdf
<basecase><group>histogram.pdf
<basecase><group>residuals_summary.dat

The one2one plots show modeled vs. measured plots.
The histogram plots show residuals as histograms to look for bias.
The summary files include testing for normality.

The PDF files are consolidated with a page per iteration.
This file, as of this commit, replaces the deprecated REIripper.py

#############################################################################
# re12arc.py --> GFLOW residuals linked with locations from TP file for ARC #
#############################################################################
This code reads an REI file and a TP file (exported from GFLOW) to align
residuals with X and Y locations for plotting in ARC. It creates a different
file for each observation group, also one with absolute residuals, another with
negative (over) and a final with positive (under) residuals showing bias.

###############################################################
# tweak_bounds.py --> adjust upper and lower bounds if failed #
###############################################################
Reads a PST control file and, if curent value is outside the range of bounds, 
the bound is moved out by 2 orders of magnitude. It's a kludge but can be useful and the USER MUST SPECIFY INPUT AND OUTPUT FILENAMES IN TOP OF CODE. 

############
# uberPEST #
############
uberPEST.py

a m!ke@usgs joint
contact: Mike Fienen <mnfienen@usgs.gov>

This project is a wrapper around PEST (although generalizable) that
uses gmail protocols to send an email upon completion of a PEST
or (more often) beoPEST model run.

The dependencies are: gmail_sender.py and a config file the *must* be named uberPEST.par.

An example ubserPEST.par file is included.

This code uses gmail to send the email out, so the user must set up an account
at gmail.com. The login name of the account <myaccount>@<gmail.com> gets listed in the
parameter file (in this example, it is: wwsc.modeling.center@gmail.com). The code securely
prompts for the password.

Elsewhere in the parameter file (uberPEST.par), variables are generally read from the start of the line
to the first whitespace. All other text on the line is treated as a comment and ignored. An exception to
this rule is for the PEST flags line in which all information (including whitespace) up to the "#" comment
indicator is read and used in the model call.

On lines where "none" is listed as an option, simply type "none" without quotation marks.