pywfm.IWFMModel.get_diversion_purpose#
- IWFMModel.get_diversion_purpose(diversions='all')#
Return the flags for the initial purpose of the diversions as ag, urban, or both
- Parameters:
diversions (int, list, tuple, np.ndarray, or str='all', default='all') – One or more diversion identification numbers used to return the supply purpose.
- Returns:
array of flags for each supply index provided
- Return type:
np.ndarray
Note
This method is intended to be used during a model simulation (is_for_inquiry=0) after the timeseries data are read If it is used when is_for_inquiry=1, it will return the urban flag for each diversion regardless if it is urban, ag, or both
flag equal to 1 for urban water demands flag equal to 10 for agricultural water demand flag equal to 11 for both ag and urban
automatic supply adjustment in IWFM allows the supply purpose to change dynamically, so this only returns the user-specified initial value.
See also
IWFMModel.get_well_pumping_purpose
Return the flags for the initial purpose of the well pumping as ag, urban, or both
IWFMModel.get_element_pumping_purpose
Return the flags for the initial purpose of the element pumping as ag, urban, or both
Examples
>>> from pywfm import IWFMModel >>> pp_file = '../Preprocessor/PreProcessor_MAIN.IN' >>> sim_file = 'Simulation_MAIN.IN' >>> model = IWFMModel(dll, pp_file, sim_file, is_for_inquiry=0) >>> while not model.is_end_of_simulation(): ... # advance the simulation time one time step forward ... model.advance_time() ... ... # read all time series data from input files ... model.read_timeseries_data() ... ... # get diversion supply purpose ... print(model.get_diversion_purpose()) ... ... # Simulate the hydrologic process for the timestep ... model.simulate_for_one_timestep() ... ... # print the results to the user-specified output files ... model.print_results() ... ... # advance the state of the hydrologic system in time ... model.advance_state() . . . [ 1 1 10 10 10] * TIME STEP 2 AT 10/02/1990_24:00 [ 1 1 10 10 10] * TIME STEP 3 AT 10/03/1990_24:00 [ 1 1 10 10 10] . . . * TIME STEP 3652 AT 09/29/2000_24:00 [ 1 1 10 10 10] * TIME STEP 3653 AT 09/30/2000_24:00 [ 1 1 10 10 10] >>> model.kill() >>> model.close_log_file()
>>> from pywfm import IWFMModel >>> pp_file = '../Preprocessor/PreProcessor_MAIN.IN' >>> sim_file = 'Simulation_MAIN.IN' >>> model = IWFMModel(pp_file, sim_file) >>> model.get_diversion_purpose() array([1, 1, 1, 1, 1]) >>> model.kill() >>> model.close_log_file()