flopy.utils.swroutputfile module¶
- class SwrBudget(filename, precision='double', verbose=False)[source]¶
Bases:
flopy.utils.swroutputfile.SwrFile
Read binary SWR budget output from MODFLOW SWR Process binary output files
- Parameters
filename (string) – Name of the swr budget output file
precision (string) – ‘single’ or ‘double’. Default is ‘double’.
verbose (bool) – Write information to the screen. Default is False.
Notes
Examples
>>> import flopy >>> stageobj = flopy.utils.SwrStage('mymodel.swr.bud')
- class SwrExchange(filename, precision='double', verbose=False)[source]¶
Bases:
flopy.utils.swroutputfile.SwrFile
Read binary SWR surface-water groundwater exchange output from MODFLOW SWR Process binary output files
- Parameters
filename (string) – Name of the swr surface-water groundwater exchange output file
precision (string) – ‘single’ or ‘double’. Default is ‘double’.
verbose (bool) – Write information to the screen. Default is False.
Notes
Examples
>>> import flopy >>> stageobj = flopy.utils.SwrStage('mymodel.swr.qaq')
- class SwrFile(filename, swrtype='stage', precision='double', verbose=False)[source]¶
Bases:
flopy.utils.utils_def.FlopyBinaryData
Read binary SWR output from MODFLOW SWR Process binary output files The SwrFile class is the super class from which specific derived classes are formed. This class should not be instantiated directly
- Parameters
filename (string) – Name of the swr output file
swrtype (str) – swr data type. Valid data types are ‘stage’, ‘budget’, ‘flow’, ‘exchange’, or ‘structure’. (default is ‘stage’)
precision (string) – ‘single’ or ‘double’. Default is ‘double’.
verbose (bool) – Write information to the screen. Default is False.
Notes
Examples
>>> import flopy >>> so = flopy.utils.SwrFile('mymodel.swr.stage.bin')
- get_connectivity()[source]¶
Get connectivity data from the file.
- Returns
data – Array has size (nrecord, 3). None is returned if swrtype is not ‘flow’
- Return type
numpy array
Notes
Examples
- get_data(idx=None, kswrkstpkper=None, totim=None)[source]¶
Get data from the file for the specified conditions.
- Parameters
idx (int) – The zero-based record number. The first record is record 0. (default is None)
kswrkstpkper (tuple of ints) – A tuple containing the swr time step, time step, and stress period (kswr, kstp, kper). These are zero-based kswr, kstp, and kper values. (default is None)
totim (float) – The simulation time. (default is None)
- Returns
data – Array has size (nitems).
- Return type
numpy record array
Notes
if both kswrkstpkper and totim are None, will return the last entry
Examples
- get_kswrkstpkper()[source]¶
Get a list of unique stress periods, time steps, and swr time steps in the file
- Returns
out – List of unique kswr, kstp, kper combinations in binary file. kswr, kstp, and kper values are zero-based.
- Return type
list of (kswr, kstp, kper) tuples
- get_nrecords()[source]¶
Get the number of records in the file
- Returns
out – A tupe with the number of records and number of flow items in the file. The number of flow items is non-zero only if swrtype=’flow’.
- Return type
tuple of int
- get_ntimes()[source]¶
Get the number of times in the file
- Returns
out – The number of simulation times (totim) in binary file.
- Return type
int
- get_record_names()[source]¶
Get a list of unique record names in the file
- Returns
out – List of unique text names in the binary file.
- Return type
list of strings
- get_times()[source]¶
Get a list of unique times in the file
- Returns
out – List contains unique simulation times (totim) in binary file.
- Return type
list of floats
- get_ts(irec=0, iconn=0, klay=0, istr=0)[source]¶
Get a time series from a swr binary file.
- Parameters
irec (int) – is the zero-based reach (stage, qm, qaq) or reach group number (budget) to retrieve. (default is 0)
iconn (int) – is the zero-based connection number for reach (irch) to retrieve qm data. iconn is only used if qm data is being read. (default is 0)
klay (int) – is the zero-based layer number for reach (irch) to retrieve qaq data . klay is only used if qaq data is being read. (default is 0)
klay – is the zero-based structure number for reach (irch) to retrieve structure data . isrt is only used if structure data is being read. (default is 0)
- Returns
out – Array has size (ntimes, nitems). The first column in the data array will contain time (totim). nitems is 2 for stage data, 15 for budget data, 3 for qm data, and 11 for qaq data.
- Return type
numpy recarray
Notes
The irec, iconn, and klay values must be zero-based.
Examples
- class SwrFlow(filename, precision='double', verbose=False)[source]¶
Bases:
flopy.utils.swroutputfile.SwrFile
Read binary SWR flow output from MODFLOW SWR Process binary output files
- Parameters
filename (string) – Name of the swr flow output file
precision (string) – ‘single’ or ‘double’. Default is ‘double’.
verbose (bool) – Write information to the screen. Default is False.
Notes
Examples
>>> import flopy >>> stageobj = flopy.utils.SwrStage('mymodel.swr.flow')
- class SwrStage(filename, precision='double', verbose=False)[source]¶
Bases:
flopy.utils.swroutputfile.SwrFile
Read binary SWR stage output from MODFLOW SWR Process binary output files
- Parameters
filename (string) – Name of the swr stage output file
precision (string) – ‘single’ or ‘double’. Default is ‘double’.
verbose (bool) – Write information to the screen. Default is False.
Notes
Examples
>>> import flopy >>> stageobj = flopy.utils.SwrStage('mymodel.swr.stg')
- class SwrStructure(filename, precision='double', verbose=False)[source]¶
Bases:
flopy.utils.swroutputfile.SwrFile
Read binary SWR structure output from MODFLOW SWR Process binary output files
- Parameters
filename (string) – Name of the swr structure output file
precision (string) – ‘single’ or ‘double’. Default is ‘double’.
verbose (bool) – Write information to the screen. Default is False.
Notes
Examples
>>> import flopy >>> stageobj = flopy.utils.SwrStage('mymodel.swr.str')