dpest.utils.noptmax#
- dpest.utils.noptmax.noptmax(pst_path, new_value=0)[source]#
Updates the NOPTMAX parameter in a PEST control (.pst) file.
The NOPTMAX parameter specifies the number of optimization iterations or model runs that PEST will perform. This function allows you to set NOPTMAX to any integer value, such as 0 (run the model once, no optimization) or a large value for iterative optimization.
Required Arguments:#
- pst_file_path (str):
Path to the
.pstPEST control file whose NOPTMAX value you wish to update.
Optional Arguments:#
- new_value (int, default: 0):
The new value for the NOPTMAX parameter. For example, use
0to run the model once, or10000for iterative calibration.
Returns:#
None
Examples:#
Set NOPTMAX to 0 (single run):
from dpest.utils import noptmax pst_file_path = 'PEST_CONTROL.pst' noptmax(pst_file_path)
Set NOPTMAX to 50 (iterative optimization):
from dpest.utils import noptmax pst_file_path = './ENTRY1/PEST_CONTROL.pst' noptmax(pst_file_path, new_value = 50)